34
dr hgf dj hngng f mhgm gh mgh j mgh f mf Tom Peterka [email protected] Mathematics and Computer Science Division ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows for Scientific Applications Three-stage workflow “Data movement, rather than computational processing, will be the constrained resource at exascale.” Dongarra et al. 2011 converting particles into a density image

Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

d rh g fd jh n g n gfmh g mg hmg hjmg hfm f

Tom [email protected]

Mathematics and Computer Science Division

ASCR Research SDMAV Portfolio ReviewJuly 26, 2017

Nested Task Parallel Workflows for Scientific Applications

Three-stage workflow

“Data movement, rather than computational processing, will be the constrained resource at exascale.”

– Dongarra et al. 2011

converting particles into a density image

Page 2: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Integrated Simulation and Experiment in Materials Science

2Ulvestad et al.: In-situ 3D Imaging of Catalysis Induced Strain in Gold Nanoparticles. Physical Chemistry Letters, 2016.

The comparison of a molecular dynamics simulation with high-energy X-ray microscopy of the same material system requires integrating computational and experimental workflows. Challenge: combining workflows across facilities.

Page 3: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Computational Science: Complex Combination of Multiple Tasks

3

• 3 categories levels of tasks are common• One parallel operation in shared or

distributed memory of a program (L1)• One program in HPC a workflow (L2)• One workflow in a distributed federation (L3)

• Different models for each level• L1 distributed and shared memory• L2 in situ workflows• L3 scripts

• Lack of interoperability between levels• Unnecessary complexity• Sacrificed performance and scalability

Three-level hierarchy of integrated materials science problem.

Page 4: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Background and Progress to Date

4

Decaf: Dataflows for Workflows

Page 5: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Workflow Model: Directed Graph

A directed workflow graph. The graph does not have to be acyclic (digraph, not DAG).

• A directed graph of tasks and communication between them

• Graph nodes are the tasks• Large tasks (ie., programs), not small

tasks (ie., threads)• Programs are parallel

• Graph links are the communication• Also parallel

TaskA

B

C

D E

F

cycles are OK

parallelprograms

parallelcommunication

5

Page 6: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Dataflow Model: Parallel Communication in a Workflow

Dataflow between 2 workflow graph nodes. One may decompose any complex graph into a set of producer-consumer groups

• For a pair of nodes connected by a directed edge (link) in the workflow graph,

• Dataflow is communication over the links in a workflow

• Workflow is in terms of tasks; dataflow is in terms of ranks

Producer

Dataflow

Workflow

Consumer

6

Page 7: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Links are Parallel

• Translate task-level put/get calls into rank-level MPI calls• Links (can) have resources too

• Run a parallel program, (almost) just like a node task

Dataflow(Conceptual)

Dataflow(Detail)

7

The dataflow can do more than just transmit messages. By assigning resources and running code in the dataflow, data transformations needed to connect producer to consumer are performed. We call this dataflow a “link.”

Page 8: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Common Redistribution Patterns

Different ways to split/merge a data model on M producer ranks to N consumer ranks• Bounding Box

• Round robin• Contiguous• Block Bounding box redistribution of 3

producer ranks to 2 consumer ranksBlock redistribution of 4 producer ranks to 2 consumer ranks

Contiguous redistribution of 3 producer ranks to 2 consumer ranks

Round robin redistribution 3 producer ranks to 2 consumer ranks 8

Page 9: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Data Rates Can Vary

9

Consumer

Producer

for each time step

RAM

Consumer

Producer

for each time step

Data copy

Space Division Coupling Space Division Couplingwith Flow Control

NVM

PFS

Space division coupling has to accommodate varying data rates of producer and consumer

Multiple levels of memory/storage can act as burst buffers to allow a fast producer to couple to slow consumer

Page 10: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Python Workflow Definition

• Define in Python• Add nodes and edges• Add attributes to nodes

and edges• Convert to JSON

• Read JSON in application

node_a (4 procs)

node_b (1 proc)

node_c (1 proc)

node_d (1 proc)10

Page 11: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Decaf: Decoupled Dataflows

11

Tom Peterka,Franck Cappello, ANLJay Lofstead, SNLbitbucket.org/tpeterka1/decaf

Decaf generates dataflows for workflows.• Decoupled workflow links with configurable dataflow• Data redistribution patterns• Flow control• Resilience

Decaf Dataflow Definition

Transport Layer

Workflow Definition

Swift

Flowcontrol

Nessie Mercury MPI

Python

Datamodel

Datadistribution

Resilience

Decaf Runtime

XML Pegasus

• If Decaf is the only workflow software, then it needs to do manage the workflow.• Input workflow graph definition

(Python)

• Instantiate the graph (Decaf constructor)

• Launch the tasks (run the nodes)• Communicate (run the links)• Terminate cleanly (when one of the

tasks does)

• But Decaf doesn’t have to be the top level workflow manager: e.g., Swift or Damaris or FlowVR or ADIOS or PyCOMPSs• In such cases, Decaf just runs the links

Page 12: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Three Highlights

12

Page 13: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Data Redistribution in Molecular Dynamics

13

We applied the Decaf redistribution library to the Gromacs molecular dynamics code in order to visualize isosurfacesfrom molecular density. Code complexity was reduced dramatically, while maintaining performance improved.

Courtesy Matthieu Dreher

Dreher and Peterka, Bredala: Semantic Redistribution for In Situ Applications . Cluster 2016.

Three different redistributions are performed while computing an isosurface from an MD simulation of 54,000 lipids(2.1M particles). [Dreher et al. 2014]

Page 14: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

020

040

060

080

0

Gromacs Timings with Steering

Number of Processes

Tim

e (m

s)

30 60 120 240 480

GromacsGetPutSteering

Computational Steering in Molecular Dynamics

14

Strong scaling of the steering pipeline without visualization. The measured time

is the average over100 iterations.

Courtesy Matthieu Dreher

Steering workflow with Decaf, Damaris, and FlowVR. Decaf and FlowVR tasks are in space-division mode while Damaris is in time-division mode.

Dreher and Peterka, Decaf: Decoupled Dataflows for In Situ Workflows. ANL Technical Report 2017.

The FepA protein is a channel on the surface of a

cell through which iron can

pass.FlowVR visualization of the steering progress.

VisItvisualization of the molecular

density.

Page 15: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Density Estimation in Cosmology

15

Strong scaling of the end-to-end workflow shows good efficiency. The analysis time effectively overlaps the simulation time.

Output of in situ cosmology analysis workflow at four

time steps

Dreher and Peterka, Decaf: DecoupledDataflows for In Situ Workflows. ANL Technical Report 2017.

5010

015

020

0Strong Scaling

Number of Processes

Tim

e (s

)

40 80 160 320 640 1280

Total timeSimulationTessellationDensity estimationPerfect strong scaling

Density estimation: Tessellations as intermediate representations enable accurate regular grid density estimators.

Peterka et al., Self-Adaptive Density Estimation, SIAM SISC 2016.

Page 16: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Nested Task Parallel Workflows

16

Page 17: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Nested Task Parallelism: A Coherent Model

17

• Existing• Various incompatible L2 workflow tools• L2 dataflow (Decaf)• L1 and L3 task parallel tools

• Missing• L2 task parallel workflow

• Challenges and gaps• Usability• Dynamicity• Scalability• Interoperability A nested task-parallel abstraction for scientific

computing from a federation of distributed facilities down to a single compute core (example: cosmology)

Page 18: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Usable Workflows

18

• Problem: Workflows are hard to construct and error-prone• Solution: Workflow task typing, data model typing, workflow graph templates

Page 19: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Workflow Task Typing

19

• Dedicated task types• Fork• Join• Buffer• Compute

• Benefits• Usability: less user code• Security: more type checking• Performance: minimum data exchanged

Top: A thin layer of workflow code surrounds majority of user code. Bottom: Task typing requires less user code because typed tasks provide the common functions.

Page 20: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Workflow Graph Templates

20

• Add templates the same as individual tasks• Dynamically

• Predefined templates• Pipeline• Fork• Join• Cycle

• User-defined templates

• Star entities• Recursive templates

• Uses• (Re)usability• Benchmarking• Training

Workflows can be built from pipeline, fork, join, cycle, and user-defined building blocks.

“Star” nodes can be a generic compute task, any of the above building blocks, or a virtual task in the nested hierarchy.

Page 21: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Dynamic Workflows

21

• Problem: Time-evolving phenomena require dynamically changing workflows• Solution: Resource changes, global graph changes, local graph changes

Page 22: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Resource and Graph Changes

22

• Resource changes• Number of compute nodes• Types of compute nodes• Time and space division

• Graph changes• Global changes: stop and restart• Local changes: continue execution

Consumer

Producer

for each time step

Consumer

Producer

for each time step

Data copy

ProducerE.g., simulation

ConsumerE.g., analysis

P C

Workflow Graph Time Division Coupling Space Division Coupling

Different coupling options for a producer and consumer task in the same workflow graph.

Page 23: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Scalable Workflows

23

• Problem: Workflows need to perform well on a variety of h/w and s/w systems• Solution: Exascale hardware, Post-Moore hardware, DOE system software

Page 24: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Hardware and System Software Support

24

• Pre-exascale machines• Cori, Theta, Aurora, Summit

• Exascale machines• ALCF and OLCF 2021

• Post-Moore architectures• Quantum• Neuromorphic• FPGA, SOC

• System software• ASCR research projects• ECP software projects• NNSA ASC projects• Decaf abstraction layer

L2 workflow software will utilize existing software funded by other research projects through an abstraction layer that will be added to Decaf.

Page 25: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Nested Workflows

25

• Problem: Workflows are single-level and do not cooperate across levels• Solution: Virtual tasks, cross-level integration, nested usability, dynamism,

scalability

Page 26: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Virtual Tasks

26

• Virtual task: Child level that appears as a single task in the parent level

• Protocol for communicating between parent and child

• Science data• Control data

• Usability across levels• Implicit vs. explicit task parallelism

• Dynamics across levels• Decision making

• Scalability across levels• Virtual tasks extend scalability

Communication across the parent-child virtual task when the virtual task is a gray box includes bidirectional science and control data.

Page 27: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Early Results and Applications

27

Interoperability examples and application engagement

Page 28: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Early Examples of L3-L2 Nesting

28

• PyCOMPSs• PyCOMPSs extended so that a Decaf dataflow

can become a task of a PyCOMPSs workflow

• Pegasus• Pegasus can define a Decaf dataflow in its .DAX

XML configuration file

• Swift• Swift can communicate over a Decaf dataflow

• All of these examples are static, and “hard-coded”

@constraint(computingUnits="4")@decaf(dfScript= 'decaf/linear_2nodes.py', wfExecutor='linear2.sh', computingNodes=2)@task(arrayfile=FILE_INOUT)def array_increment_pipeline(fileprefix, arrayFile): pass

Producers Distributors Analysis“Decorator” for Decaf dataflow definition and execution in PyCOMPSs configuration file. (Courtesy R. Badia and J. Ejarque, BSC)

Decaf dataflow definition and execution in

Pegasus configuration file.

(Courtesy E. Deelman and K.

Vahi, ISI)

Decaf dataflow launched by

Swift (Courtesy J. Wozniak,

ANL)

Page 29: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Early Examples of L2-L1 Nesting

29

Decaf L2 dataflow

L1 programming models• HACC: MPI• TESS: DIY + MPI• Dense: DIY + MPI +

OpenMP

DIY DIY

Dark matterparticles

Voronoitesselleation

Densityestimation

L2 dataflow nested with various L1 programming models to estimate dark matter density in cosmology simulations

Page 30: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Application Engagement

• Superconductivity• TDGL code, feature detection and tracking

• Cosmology• HACC code, compare simulations and sky surveys

• Photon science• LAMMPS code, compare APS experiments with simulations 30

Gold nanocrystal high-energy X-ray images

TDGL simulation of superconductors

HACC cosmology simulation

Page 31: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Nested Task Parallelism: Summary

31

Nested task parallelism is a coherent abstraction for L2 workflows.

• Improved usability• Workflow task typing, data model typing,

templates

• Workflow dynamism• Run-time workflow definition and

modification• Local and global resource and graph changes

• Performance and scalability• Task types and templates for exascale and

Post-Moore• Dataflow abstraction layer for DOE software

• Nested interoperability• Parent-child communication• Usability, dynamism, scalability across levels

“A task-parallel in situ workflow system for L2 that will expose a task-parallel user interface, backed by a dynamically scheduled runtime, and will feature a nested task-parallel interface to L1 and L3.”

Page 32: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

References

32

Page 33: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

• Wozniak, J., Peterka, T., Armstrong, T., Dinan, J., Lusk, E., Wilde, M., Foster, I.: Dataflow Coordination of Data-Parallel Tasks via MPI 3.0. EuroMPI, 2013.

• Dorier, M., Dreher, M., Peterka, T., Wozniak, J., Antoniu, G., Raffin, B.: Lessons Learned from Building In Situ Coupling Frameworks. ISAV 2015.

• Peterka, T., Croubois, H., Li, N., Rangel, E., Cappello, F.: Self-Adaptive Density Estimation of Particle Data. SIAM SISC 2016.

• Dreher, M., Peterka, T.: Bredala: Semantic Data Redistribution for In Situ Applications. IEEE Cluster 2016.

• Dorier, M., Antoniu, G., Cappello, F., Snir, M., Sisneros, R., Yildiz, O. Ibrahim, S., Peterka, T., Orf, L.: Damaris: Addressing Performance Variability in Data Management for Post-Petascale Simulations. ACM ToPC journal, 2016.

• Dreher, M., Peterka, T.: Decaf: Decoupled Dataflows for In Situ Workflows. ANL Technical Report 2017.• Dreher, M., Sasikumar, K., Sankaranarayanan, S., Peterka, T: Manala: A Flexible Flow Control Library for

Asynchronous Task Communication. IEEE Cluster 2017.• Mommessin, C., Dreher, M., Peterka, T., Raffin, B: Automatic Data Filtering for In Situ Workflows, IEEE

Cluster 2017.• Deelman, E., Peterka, T., et al.: The Future of Scientific Workflows. IJHPCA journal 2017.

Further Reading

33

Page 34: Nested Task Parallel Workflows for Scientific Applicationstpeterka/talks/2017/peterka-panelreview1… · ASCR Research SDMAV Portfolio Review July 26, 2017 Nested Task Parallel Workflows

Tom [email protected]

Mathematics and Computer Science Division

Acknowledgments

FacilitiesArgonne Leadership Computing Facility (ALCF)

Oak Ridge National Center for Computational Sciences (NCCS)National Energy Research Scientific Computing Center (NERSC)

FundingDOE SDMAV Exascale Initiative

PeopleFranck Cappello (ANL), Matthieu Dreher (ANL), Jay Lofstead (SNL),

Patrick Widener (SNL)

ASCR Research SDMAV Portfolio ReviewJuly 26, 2017