SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Downloaden Sie, um offline zu lesen
A Multidimensional
Distributed Array Abstraction
for PGAS
www.dash-project.org
Tobias Fuchs
fuchst@nm.ifi.lmu.de
Ludwig-Maximilians-Universität München, MNM-Team
| 2DASH
DASH - Overview
 DASH is a C++ template library that offers
– distributed data structures and parallel algorithms
– a complete PGAS (part. global address space) programming
system without a custom (pre-)compiler
 PGAS Terminology – SHMEM Analogy
Unit: The individual participants in a DASH
program, usually full OS processes.
Private
Shared
Unit 0 Unit 1 Unit N-1
int b;
int c;
dash::Array a(1000);
int a;
…
dash::Shared s;
10..190..9 ..999
Shared data:
managed by DASH
in a virtual global
address space
Private data:
managed by regular
C/C++ mechanisms
| 3DASH
DASH Project Structure
Phase I (2013-2015) Phase II (2016-2018)
LMU Munich
Project lead,
C++ template library
Project lead,
C++ template library,
data dock
TU Dresden
Libraries and
interfaces, tools
Smart data
structures, resilience
HLRS Stuttgart DART runtime DART runtime
KIT Karlsruhe Application studies
IHR Stuttgart
Smart deployment,
Application studies
| 4DASH
DASH - Partitioned Global Address Space
 Data affinity
– data has well-defined owner but can be accessed by any unit
– data locality important for performance
– support for the owner computes execution model
 DASH:
– unified access to
local and remote
data in global
memory space
| 5DASH
DASH - Partitioned Global Address Space
 Data affinity
– data has well-defined owner but can be accessed by any unit
– data locality important for performance
– support for the owner computes execution model
 DASH:
– unified access to
local and remote
data in global
memory space
– and explicit views
on local memory
space
| 6DASH
DASH Distributed Data Structures Overview
Container Description Data distribution
Array<T> 1D Array static, configurable
NArray<T, N> N-dim. Array static, configurable
Shared<T> Shared scalar fixed (at 0)
Directory(*)<T> Variable-size,
locally indexed
array
manual,
load-balanced
List<T> Variable-size
linked list
dynamic,
load-balanced
Map<T> Variable-size
associative map
dynamic, balanced
by hash function
(*) Under construction
| 7DASH
DASH Distributed Data Structures Overview
Container Description Data distribution
Array<T> 1D Array static, configurable
NArray<T, N> N-dim. Array static, configurable
Shared<T> Shared scalar fixed (at 0)
Directory(*)<T> Variable-size,
locally indexed
array
manual,
load-balanced
List<T> Variable-size
linked list
dynamic,
load-balanced
Map<T> Variable-size
associative map
dynamic, balanced
by hash function
(*) Under construction
| 8DASH
Multidimensional Data Distribution (1)
 dash::Pattern<N> specifies N-dim data distribution
– Blocked, cyclic, and block-cyclic in multiple dimensions
Pattern<2>(20, 15)
(BLOCKED,
NONE)
(NONE,
BLOCKCYCLIC(2))
(BLOCKED,
BLOCKCYCLIC(3))
Extent in first and
second dimension
Distribution in first and
second dimension
| 9DASH
Multidimensional Data Distribution (2)
 Example: tiled and tile-shifted data distribution
(TILE(4), TILE(3))
ShiftTilePattern<2>(32, 24)TilePattern<2, COL_MAJOR>(20, 15)
(TILE(5), TILE(5))
| 10DASH
Multidimensional Views
 Lightweight Multidimensional Views
// 8x8 2D array
dash::NArray<int, 2> mat(8,8);
// linear access using iterators
dash::distance(mat.begin(), mat.end()) == 64
// create 2x5 region view
auto reg = matrix.cols(2,5).rows(3,2);
// region can be used just like 2D array
cout << reg[1][2] << endl; // ‘7’
dash::distance(reg.begin(), reg.end()) == 10
| 11DASH
Multidimensional Views
 Lightweight Multidimensional Views
– Local and block views
dash::NArray<int, 2> mat(80000,17000);
// view to block element range
auto block = matrix.block(3,2);
// use view as Cartesian space:
auto elem = block[30][20];
dash::NArray<int, 2> mat(80000,17000);
if (dash::myid() == 1) {
// view to local element range
auto local_elems = matrix.local;
// use view as sequential range:
for (auto elem : local_elems) { … }
}
| 12DASH
Multidimensional Views
 Multidimensional Iterator Ranges
– Global iterators provide access to the
underlying view of their index space
– DASH global iterators on multi-dimensional regions can
still be passed to standard library algorithms
auto r = mat.sub(0, { 4,7 }) // rows
.sub(1, { 2,7 }); // cols
auto r_view = r.begin().view();
r_view.extents() == { 3,5 }
r_view.offsets() == { 4,2 }
// DASH algorithms use n-dim. view:
dash::summa(r.begin(), r.end(), …);
// multidimensional iterators still
// are sequential:
std::for_each(r.begin(), r.end(), …);
| 13DASH
Multidimensional Views
 Multidimensional Iterator Ranges
– Global iterators provide access to the
data distribution pattern of their iteration space
auto r = mat.sub(0, { 4,7 }) // rows
.sub(1, { 2,7 }); // cols
auto r_pattern = r.begin().pattern();
r_pattern.blocksize() == 4
r_pattern.blocks() == 16
r_pattern.blocks_at(dash::myid()) == 4
| 14DASH
DASH Algorithms
 Growing number of DASH equivalents to STL algorithms:
 Examples of STL algorithms ported to DASH, also work
for multidimensional ranges:
dash::GlobIter<T> dash::fill(GlobIter<T> begin,
GlobIter<T> end,
T val);
- dash::fill range[i] <- val
- dash::generate range[i] <- func()
- dash::for_each func(range[i])
- dash::transform range[i] = func(range2[i])
- dash::accumulate sum(range[i]) (0<=i<=n-1)
- dash::min_element min(range[i]) (0<=i<=n-1)
- dash::copy range[i] <- range2[i]
| 15DASH
DASH Algorithms
 Growing number of DASH equivalents to STL algorithms:
 Examples of STL algorithms ported to DASH, also work
for multidimensional ranges:
dash::GlobIter<T> dash::fill(GlobIter<T> begin,
GlobIter<T> end,
T val);
- dash::fill range[i] <- val
- dash::generate range[i] <- func()
- dash::for_each func(range[i])
- dash::transform range[i] = func(range2[i])
- dash::accumulate sum(range[i]) (0<=i<=n-1)
- dash::min_element min(range[i]) (0<=i<=n-1)
- dash::copy range[i] <- range2[i]
| 16DASH
Asynchronous Copying for Latency Hiding
 Asynchronous Operations
– Async. algorithm interface:
dash::copy_async()
– Launch policy:
dash::launch::async (in upcoming DASH release 0.3.0)
std::vector<int> lcopy(block.size());
// starts async. copy of global range to local memory
// … via algorithm interface:
auto fut = dash::copy_async(block.begin(), block.end(),
lcopy.begin());
// … or via launch policy:
auto fut = dash::copy(dash::launch::async,
block.begin(), block.end(),
lcopy.begin());
overlapping computation();
auto copy_end = fut.get(); // blocks until copy received
| 17DASH
 Block matrix-matrix multiplication with prefetching
while(!done) {
blk_a = matrixA.local.block(k); …
blk_b = matrixB.local.block(k); …
// prefetch
auto get_a = dash::copy_async(blk_a.begin(), blk_a.end(), lblk_a_get);
auto get_b = dash::copy_async(blk_b.begin(), blk_b.end(), lblk_b_get);
// local DGEMM
dash::multiply(lblk_a_comp, lblk_b_comp, lblk_c_comp);
// wait for transfer to finish
get_a.wait(); get_b.wait();
// swap buffers
swap(lblk_a_get, lblk_a_comp); swap(lblk_b_get, lblk_b_comp);
}
Case Study: S(R)UMMA Algorithm
| 18DASH
 Block matrix-matrix multiplication with prefetching
while(!done) {
blk_a = matrixA.local.block(k); …
blk_b = matrixB.local.block(k); …
// prefetch
auto get_a = dash::copy_async(blk_a.begin(), blk_a.end(), lblk_a_get);
auto get_b = dash::copy_async(blk_b.begin(), blk_b.end(), lblk_b_get);
// local DGEMM
dash::multiply(lblk_a_comp, lblk_b_comp, lblk_c_comp);
// wait for transfer to finish
get_a.wait(); get_b.wait();
// swap buffers
swap(lblk_a_get, lblk_a_comp); swap(lblk_b_get, lblk_b_comp);
}
Case Study: S(R)UMMA Algorithm
DISCLAIMER
This code is simplified for brevity.
Get the real source code here:
https://github.com/dash-project/dash/blob/development/dash/include/dash/algorithm/SUMMA.h
| 19DASH
 Block matrix-matrix multiplication with prefetching
while(!done) {
blk_a = matrixA.local.block(k); …
blk_b = matrixB.local.block(k); …
// prefetch
auto get_a = dash::copy_async(blk_a.begin(), blk_a.end(), lblk_a_get);
auto get_b = dash::copy_async(blk_b.begin(), blk_b.end(), lblk_b_get);
// local DGEMM
dash::multiply(lblk_a_comp, lblk_b_comp, lblk_c_comp);
// wait for transfer to finish
get_a.wait(); get_b.wait();
// swap buffers
swap(lblk_a_get, lblk_a_comp); swap(lblk_b_get, lblk_b_comp);
}
Case Study: S(R)UMMA Algorithm
Schedules block
transmissions to
minimize network
congestion
| 20DASH
 Block matrix-matrix multiplication with prefetching
while(!done) {
blk_a = matrixA.local.block(k); …
blk_b = matrixB.local.block(k); …
// prefetch
auto get_a = dash::copy_async(blk_a.begin(), blk_a.end(), lblk_a_get);
auto get_b = dash::copy_async(blk_b.begin(), blk_b.end(), lblk_b_get);
// local DGEMM
dash::multiply(lblk_a_comp, lblk_b_comp, lblk_c_comp);
// wait for transfer to finish
get_a.wait(); get_b.wait();
// swap buffers
swap(lblk_a_get, lblk_a_comp); swap(lblk_b_get, lblk_b_comp);
}
Case Study: S(R)UMMA Algorithm
Local submatrix
multiplication using
DGEMM from serial
Intel MKL
Schedules block
transmissions to
minimize network
congestion
| 21DASH
DASH vs. DGEMM: Intel MKL, PLASMA
| 22DASH
DASH vs. PDGEMM: ScaLAPACK
 Good.
But acing singular benchmarks
is not the actual point.
Most important:
 the NArray concept allows intuitive
design of efficient algorithms
 we achieved portable, robust
efficiency on different hardware
and system environments
| 23DASH
Summary
 NArray Concept
– Views simplify design of efficient algorithms
– First-class support for locality-based operations
– Complies to existing C++ standard library concepts
 DASH algorithms on n-dim. ranges
– SUMMA case study: straight-forward, compact
implementation
– Leveraged portable efficiency of Intel MKL
– Beats performance in (P)DGEMM compared to
Intel MKL, PLASMA, ScaLAPACK
– Robust scalability in a variety of node-level and
highly distributed benchmark scenarios
http://www.dash-project.org/
http://github.com/dash-project/
| 24DASH
Acknowledgements
DASH on GitHub:
https://github.com/dash-project/dash/
 Funding
 The DASH Team
T. Fuchs (LMU), R. Kowalewski (LMU), D. Hünich (TUD), A. Knüpfer
(TUD), J. Gracia (HLRS), C. Glass (HLRS), H. Zhou (HLRS), K. Idrees
(HLRS), J. Schuchart (HLRS), F. Mößbauer (LMU), K. Fürlinger (LMU)

Weitere ähnliche Inhalte

Was ist angesagt?

Bringing Algebraic Semantics to Mahout
Bringing Algebraic Semantics to MahoutBringing Algebraic Semantics to Mahout
Bringing Algebraic Semantics to Mahout
sscdotopen
 
0015.register allocation-graph-coloring
0015.register allocation-graph-coloring0015.register allocation-graph-coloring
0015.register allocation-graph-coloring
sean chen
 
Behm Shah Pagerank
Behm Shah PagerankBehm Shah Pagerank
Behm Shah Pagerank
gothicane
 

Was ist angesagt? (20)

Bringing Algebraic Semantics to Mahout
Bringing Algebraic Semantics to MahoutBringing Algebraic Semantics to Mahout
Bringing Algebraic Semantics to Mahout
 
AU exam
AU examAU exam
AU exam
 
Matlab bode diagram_instructions
Matlab bode diagram_instructionsMatlab bode diagram_instructions
Matlab bode diagram_instructions
 
0015.register allocation-graph-coloring
0015.register allocation-graph-coloring0015.register allocation-graph-coloring
0015.register allocation-graph-coloring
 
How Matlab Helps
How Matlab HelpsHow Matlab Helps
How Matlab Helps
 
Hadoop map reduce concepts
Hadoop map reduce conceptsHadoop map reduce concepts
Hadoop map reduce concepts
 
Lecture set 5
Lecture set 5Lecture set 5
Lecture set 5
 
R tools for HiC data visualization
R tools for HiC data visualizationR tools for HiC data visualization
R tools for HiC data visualization
 
slides_v1
slides_v1slides_v1
slides_v1
 
Computer Science Assignment Help
Computer Science Assignment Help Computer Science Assignment Help
Computer Science Assignment Help
 
Raster package jacob
Raster package jacobRaster package jacob
Raster package jacob
 
Lecture13
Lecture13Lecture13
Lecture13
 
Eclipse Con Europe 2014 How to use DAWN Science Project
Eclipse Con Europe 2014 How to use DAWN Science ProjectEclipse Con Europe 2014 How to use DAWN Science Project
Eclipse Con Europe 2014 How to use DAWN Science Project
 
Pretzel: optimized Machine Learning framework for low-latency and high throug...
Pretzel: optimized Machine Learning framework for low-latency and high throug...Pretzel: optimized Machine Learning framework for low-latency and high throug...
Pretzel: optimized Machine Learning framework for low-latency and high throug...
 
Assembly language (addition and subtraction)
Assembly language (addition and subtraction)Assembly language (addition and subtraction)
Assembly language (addition and subtraction)
 
MPEG-4 BIFS and MPEG-2 TS: Latest developments for digital radio services
MPEG-4 BIFS and MPEG-2 TS: Latest developments for digital radio servicesMPEG-4 BIFS and MPEG-2 TS: Latest developments for digital radio services
MPEG-4 BIFS and MPEG-2 TS: Latest developments for digital radio services
 
JGrass-NewAge probabilities backward component
JGrass-NewAge probabilities backward component JGrass-NewAge probabilities backward component
JGrass-NewAge probabilities backward component
 
Behm Shah Pagerank
Behm Shah PagerankBehm Shah Pagerank
Behm Shah Pagerank
 
Start From A MapReduce Graph Pattern-recognize Algorithm
Start From A MapReduce Graph Pattern-recognize AlgorithmStart From A MapReduce Graph Pattern-recognize Algorithm
Start From A MapReduce Graph Pattern-recognize Algorithm
 
JGrass-NewAge probabilities forward component
JGrass-NewAge probabilities forward component JGrass-NewAge probabilities forward component
JGrass-NewAge probabilities forward component
 

Andere mochten auch (9)

Pooja
PoojaPooja
Pooja
 
Matrix transapose in c++
Matrix transapose in c++Matrix transapose in c++
Matrix transapose in c++
 
~ Project-student report-card.cpp[1]
~ Project-student report-card.cpp[1]~ Project-student report-card.cpp[1]
~ Project-student report-card.cpp[1]
 
2. Linear Data Structure Using Arrays - Data Structures using C++ by Varsha P...
2. Linear Data Structure Using Arrays - Data Structures using C++ by Varsha P...2. Linear Data Structure Using Arrays - Data Structures using C++ by Varsha P...
2. Linear Data Structure Using Arrays - Data Structures using C++ by Varsha P...
 
Students report card for C++ project..
Students report card for C++ project..Students report card for C++ project..
Students report card for C++ project..
 
1. Fundamental Concept - Data Structures using C++ by Varsha Patil
1. Fundamental Concept - Data Structures using C++ by Varsha Patil1. Fundamental Concept - Data Structures using C++ by Varsha Patil
1. Fundamental Concept - Data Structures using C++ by Varsha Patil
 
C programming project by navin thapa
C programming project by navin thapaC programming project by navin thapa
C programming project by navin thapa
 
Project report
Project reportProject report
Project report
 
Computer science project work
Computer science project workComputer science project work
Computer science project work
 

Ähnlich wie A Multidimensional Distributed Array Abstraction for PGAS (HPCC'16)

HDFS-HC: A Data Placement Module for Heterogeneous Hadoop Clusters
HDFS-HC: A Data Placement Module for Heterogeneous Hadoop ClustersHDFS-HC: A Data Placement Module for Heterogeneous Hadoop Clusters
HDFS-HC: A Data Placement Module for Heterogeneous Hadoop Clusters
Xiao Qin
 
Scrap Your MapReduce - Apache Spark
 Scrap Your MapReduce - Apache Spark Scrap Your MapReduce - Apache Spark
Scrap Your MapReduce - Apache Spark
IndicThreads
 

Ähnlich wie A Multidimensional Distributed Array Abstraction for PGAS (HPCC'16) (20)

Big Data Analytics with Scala at SCALA.IO 2013
Big Data Analytics with Scala at SCALA.IO 2013Big Data Analytics with Scala at SCALA.IO 2013
Big Data Analytics with Scala at SCALA.IO 2013
 
R Language Introduction
R Language IntroductionR Language Introduction
R Language Introduction
 
Apache Spark: What? Why? When?
Apache Spark: What? Why? When?Apache Spark: What? Why? When?
Apache Spark: What? Why? When?
 
Spark 4th Meetup Londond - Building a Product with Spark
Spark 4th Meetup Londond - Building a Product with SparkSpark 4th Meetup Londond - Building a Product with Spark
Spark 4th Meetup Londond - Building a Product with Spark
 
Automatic Task-based Code Generation for High Performance DSEL
Automatic Task-based Code Generation for High Performance DSELAutomatic Task-based Code Generation for High Performance DSEL
Automatic Task-based Code Generation for High Performance DSEL
 
Transformations and actions a visual guide training
Transformations and actions a visual guide trainingTransformations and actions a visual guide training
Transformations and actions a visual guide training
 
Introduction to Map-Reduce Programming with Hadoop
Introduction to Map-Reduce Programming with HadoopIntroduction to Map-Reduce Programming with Hadoop
Introduction to Map-Reduce Programming with Hadoop
 
2015 03 27_ml_conf
2015 03 27_ml_conf2015 03 27_ml_conf
2015 03 27_ml_conf
 
Mastering Hadoop Map Reduce - Custom Types and Other Optimizations
Mastering Hadoop Map Reduce - Custom Types and Other OptimizationsMastering Hadoop Map Reduce - Custom Types and Other Optimizations
Mastering Hadoop Map Reduce - Custom Types and Other Optimizations
 
Michal Malohlava presents: Open Source H2O and Scala
Michal Malohlava presents: Open Source H2O and Scala Michal Malohlava presents: Open Source H2O and Scala
Michal Malohlava presents: Open Source H2O and Scala
 
Overview of Apache SystemML by Berthold Reinwald and Nakul Jindal
Overview of Apache SystemML by Berthold Reinwald and Nakul JindalOverview of Apache SystemML by Berthold Reinwald and Nakul Jindal
Overview of Apache SystemML by Berthold Reinwald and Nakul Jindal
 
Overview of Apache SystemML by Berthold Reinwald and Nakul Jindal
Overview of Apache SystemML by Berthold Reinwald and Nakul JindalOverview of Apache SystemML by Berthold Reinwald and Nakul Jindal
Overview of Apache SystemML by Berthold Reinwald and Nakul Jindal
 
HDFS-HC: A Data Placement Module for Heterogeneous Hadoop Clusters
HDFS-HC: A Data Placement Module for Heterogeneous Hadoop ClustersHDFS-HC: A Data Placement Module for Heterogeneous Hadoop Clusters
HDFS-HC: A Data Placement Module for Heterogeneous Hadoop Clusters
 
Presentation on use of r statistics
Presentation on use of r statisticsPresentation on use of r statistics
Presentation on use of r statistics
 
Spark training-in-bangalore
Spark training-in-bangaloreSpark training-in-bangalore
Spark training-in-bangalore
 
Sandy Ryza – Software Engineer, Cloudera at MLconf ATL
Sandy Ryza – Software Engineer, Cloudera at MLconf ATLSandy Ryza – Software Engineer, Cloudera at MLconf ATL
Sandy Ryza – Software Engineer, Cloudera at MLconf ATL
 
Stratosphere Intro (Java and Scala Interface)
Stratosphere Intro (Java and Scala Interface)Stratosphere Intro (Java and Scala Interface)
Stratosphere Intro (Java and Scala Interface)
 
No more struggles with Apache Spark workloads in production
No more struggles with Apache Spark workloads in productionNo more struggles with Apache Spark workloads in production
No more struggles with Apache Spark workloads in production
 
Scrap Your MapReduce - Apache Spark
 Scrap Your MapReduce - Apache Spark Scrap Your MapReduce - Apache Spark
Scrap Your MapReduce - Apache Spark
 
5 R Tutorial Data Visualization
5 R Tutorial Data Visualization5 R Tutorial Data Visualization
5 R Tutorial Data Visualization
 

Kürzlich hochgeladen

%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Kürzlich hochgeladen (20)

%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 

A Multidimensional Distributed Array Abstraction for PGAS (HPCC'16)

  • 1. A Multidimensional Distributed Array Abstraction for PGAS www.dash-project.org Tobias Fuchs fuchst@nm.ifi.lmu.de Ludwig-Maximilians-Universität München, MNM-Team
  • 2. | 2DASH DASH - Overview  DASH is a C++ template library that offers – distributed data structures and parallel algorithms – a complete PGAS (part. global address space) programming system without a custom (pre-)compiler  PGAS Terminology – SHMEM Analogy Unit: The individual participants in a DASH program, usually full OS processes. Private Shared Unit 0 Unit 1 Unit N-1 int b; int c; dash::Array a(1000); int a; … dash::Shared s; 10..190..9 ..999 Shared data: managed by DASH in a virtual global address space Private data: managed by regular C/C++ mechanisms
  • 3. | 3DASH DASH Project Structure Phase I (2013-2015) Phase II (2016-2018) LMU Munich Project lead, C++ template library Project lead, C++ template library, data dock TU Dresden Libraries and interfaces, tools Smart data structures, resilience HLRS Stuttgart DART runtime DART runtime KIT Karlsruhe Application studies IHR Stuttgart Smart deployment, Application studies
  • 4. | 4DASH DASH - Partitioned Global Address Space  Data affinity – data has well-defined owner but can be accessed by any unit – data locality important for performance – support for the owner computes execution model  DASH: – unified access to local and remote data in global memory space
  • 5. | 5DASH DASH - Partitioned Global Address Space  Data affinity – data has well-defined owner but can be accessed by any unit – data locality important for performance – support for the owner computes execution model  DASH: – unified access to local and remote data in global memory space – and explicit views on local memory space
  • 6. | 6DASH DASH Distributed Data Structures Overview Container Description Data distribution Array<T> 1D Array static, configurable NArray<T, N> N-dim. Array static, configurable Shared<T> Shared scalar fixed (at 0) Directory(*)<T> Variable-size, locally indexed array manual, load-balanced List<T> Variable-size linked list dynamic, load-balanced Map<T> Variable-size associative map dynamic, balanced by hash function (*) Under construction
  • 7. | 7DASH DASH Distributed Data Structures Overview Container Description Data distribution Array<T> 1D Array static, configurable NArray<T, N> N-dim. Array static, configurable Shared<T> Shared scalar fixed (at 0) Directory(*)<T> Variable-size, locally indexed array manual, load-balanced List<T> Variable-size linked list dynamic, load-balanced Map<T> Variable-size associative map dynamic, balanced by hash function (*) Under construction
  • 8. | 8DASH Multidimensional Data Distribution (1)  dash::Pattern<N> specifies N-dim data distribution – Blocked, cyclic, and block-cyclic in multiple dimensions Pattern<2>(20, 15) (BLOCKED, NONE) (NONE, BLOCKCYCLIC(2)) (BLOCKED, BLOCKCYCLIC(3)) Extent in first and second dimension Distribution in first and second dimension
  • 9. | 9DASH Multidimensional Data Distribution (2)  Example: tiled and tile-shifted data distribution (TILE(4), TILE(3)) ShiftTilePattern<2>(32, 24)TilePattern<2, COL_MAJOR>(20, 15) (TILE(5), TILE(5))
  • 10. | 10DASH Multidimensional Views  Lightweight Multidimensional Views // 8x8 2D array dash::NArray<int, 2> mat(8,8); // linear access using iterators dash::distance(mat.begin(), mat.end()) == 64 // create 2x5 region view auto reg = matrix.cols(2,5).rows(3,2); // region can be used just like 2D array cout << reg[1][2] << endl; // ‘7’ dash::distance(reg.begin(), reg.end()) == 10
  • 11. | 11DASH Multidimensional Views  Lightweight Multidimensional Views – Local and block views dash::NArray<int, 2> mat(80000,17000); // view to block element range auto block = matrix.block(3,2); // use view as Cartesian space: auto elem = block[30][20]; dash::NArray<int, 2> mat(80000,17000); if (dash::myid() == 1) { // view to local element range auto local_elems = matrix.local; // use view as sequential range: for (auto elem : local_elems) { … } }
  • 12. | 12DASH Multidimensional Views  Multidimensional Iterator Ranges – Global iterators provide access to the underlying view of their index space – DASH global iterators on multi-dimensional regions can still be passed to standard library algorithms auto r = mat.sub(0, { 4,7 }) // rows .sub(1, { 2,7 }); // cols auto r_view = r.begin().view(); r_view.extents() == { 3,5 } r_view.offsets() == { 4,2 } // DASH algorithms use n-dim. view: dash::summa(r.begin(), r.end(), …); // multidimensional iterators still // are sequential: std::for_each(r.begin(), r.end(), …);
  • 13. | 13DASH Multidimensional Views  Multidimensional Iterator Ranges – Global iterators provide access to the data distribution pattern of their iteration space auto r = mat.sub(0, { 4,7 }) // rows .sub(1, { 2,7 }); // cols auto r_pattern = r.begin().pattern(); r_pattern.blocksize() == 4 r_pattern.blocks() == 16 r_pattern.blocks_at(dash::myid()) == 4
  • 14. | 14DASH DASH Algorithms  Growing number of DASH equivalents to STL algorithms:  Examples of STL algorithms ported to DASH, also work for multidimensional ranges: dash::GlobIter<T> dash::fill(GlobIter<T> begin, GlobIter<T> end, T val); - dash::fill range[i] <- val - dash::generate range[i] <- func() - dash::for_each func(range[i]) - dash::transform range[i] = func(range2[i]) - dash::accumulate sum(range[i]) (0<=i<=n-1) - dash::min_element min(range[i]) (0<=i<=n-1) - dash::copy range[i] <- range2[i]
  • 15. | 15DASH DASH Algorithms  Growing number of DASH equivalents to STL algorithms:  Examples of STL algorithms ported to DASH, also work for multidimensional ranges: dash::GlobIter<T> dash::fill(GlobIter<T> begin, GlobIter<T> end, T val); - dash::fill range[i] <- val - dash::generate range[i] <- func() - dash::for_each func(range[i]) - dash::transform range[i] = func(range2[i]) - dash::accumulate sum(range[i]) (0<=i<=n-1) - dash::min_element min(range[i]) (0<=i<=n-1) - dash::copy range[i] <- range2[i]
  • 16. | 16DASH Asynchronous Copying for Latency Hiding  Asynchronous Operations – Async. algorithm interface: dash::copy_async() – Launch policy: dash::launch::async (in upcoming DASH release 0.3.0) std::vector<int> lcopy(block.size()); // starts async. copy of global range to local memory // … via algorithm interface: auto fut = dash::copy_async(block.begin(), block.end(), lcopy.begin()); // … or via launch policy: auto fut = dash::copy(dash::launch::async, block.begin(), block.end(), lcopy.begin()); overlapping computation(); auto copy_end = fut.get(); // blocks until copy received
  • 17. | 17DASH  Block matrix-matrix multiplication with prefetching while(!done) { blk_a = matrixA.local.block(k); … blk_b = matrixB.local.block(k); … // prefetch auto get_a = dash::copy_async(blk_a.begin(), blk_a.end(), lblk_a_get); auto get_b = dash::copy_async(blk_b.begin(), blk_b.end(), lblk_b_get); // local DGEMM dash::multiply(lblk_a_comp, lblk_b_comp, lblk_c_comp); // wait for transfer to finish get_a.wait(); get_b.wait(); // swap buffers swap(lblk_a_get, lblk_a_comp); swap(lblk_b_get, lblk_b_comp); } Case Study: S(R)UMMA Algorithm
  • 18. | 18DASH  Block matrix-matrix multiplication with prefetching while(!done) { blk_a = matrixA.local.block(k); … blk_b = matrixB.local.block(k); … // prefetch auto get_a = dash::copy_async(blk_a.begin(), blk_a.end(), lblk_a_get); auto get_b = dash::copy_async(blk_b.begin(), blk_b.end(), lblk_b_get); // local DGEMM dash::multiply(lblk_a_comp, lblk_b_comp, lblk_c_comp); // wait for transfer to finish get_a.wait(); get_b.wait(); // swap buffers swap(lblk_a_get, lblk_a_comp); swap(lblk_b_get, lblk_b_comp); } Case Study: S(R)UMMA Algorithm DISCLAIMER This code is simplified for brevity. Get the real source code here: https://github.com/dash-project/dash/blob/development/dash/include/dash/algorithm/SUMMA.h
  • 19. | 19DASH  Block matrix-matrix multiplication with prefetching while(!done) { blk_a = matrixA.local.block(k); … blk_b = matrixB.local.block(k); … // prefetch auto get_a = dash::copy_async(blk_a.begin(), blk_a.end(), lblk_a_get); auto get_b = dash::copy_async(blk_b.begin(), blk_b.end(), lblk_b_get); // local DGEMM dash::multiply(lblk_a_comp, lblk_b_comp, lblk_c_comp); // wait for transfer to finish get_a.wait(); get_b.wait(); // swap buffers swap(lblk_a_get, lblk_a_comp); swap(lblk_b_get, lblk_b_comp); } Case Study: S(R)UMMA Algorithm Schedules block transmissions to minimize network congestion
  • 20. | 20DASH  Block matrix-matrix multiplication with prefetching while(!done) { blk_a = matrixA.local.block(k); … blk_b = matrixB.local.block(k); … // prefetch auto get_a = dash::copy_async(blk_a.begin(), blk_a.end(), lblk_a_get); auto get_b = dash::copy_async(blk_b.begin(), blk_b.end(), lblk_b_get); // local DGEMM dash::multiply(lblk_a_comp, lblk_b_comp, lblk_c_comp); // wait for transfer to finish get_a.wait(); get_b.wait(); // swap buffers swap(lblk_a_get, lblk_a_comp); swap(lblk_b_get, lblk_b_comp); } Case Study: S(R)UMMA Algorithm Local submatrix multiplication using DGEMM from serial Intel MKL Schedules block transmissions to minimize network congestion
  • 21. | 21DASH DASH vs. DGEMM: Intel MKL, PLASMA
  • 22. | 22DASH DASH vs. PDGEMM: ScaLAPACK  Good. But acing singular benchmarks is not the actual point. Most important:  the NArray concept allows intuitive design of efficient algorithms  we achieved portable, robust efficiency on different hardware and system environments
  • 23. | 23DASH Summary  NArray Concept – Views simplify design of efficient algorithms – First-class support for locality-based operations – Complies to existing C++ standard library concepts  DASH algorithms on n-dim. ranges – SUMMA case study: straight-forward, compact implementation – Leveraged portable efficiency of Intel MKL – Beats performance in (P)DGEMM compared to Intel MKL, PLASMA, ScaLAPACK – Robust scalability in a variety of node-level and highly distributed benchmark scenarios http://www.dash-project.org/ http://github.com/dash-project/
  • 24. | 24DASH Acknowledgements DASH on GitHub: https://github.com/dash-project/dash/  Funding  The DASH Team T. Fuchs (LMU), R. Kowalewski (LMU), D. Hünich (TUD), A. Knüpfer (TUD), J. Gracia (HLRS), C. Glass (HLRS), H. Zhou (HLRS), K. Idrees (HLRS), J. Schuchart (HLRS), F. Mößbauer (LMU), K. Fürlinger (LMU)