SlideShare a Scribd company logo
Parsl:
Pervasive Parallel Programming in Python
18 October 2019
Daniel S. Katz
(d.katz@ieee.org, http://danielskatz.org, @danielskatz)
Assistant Director for Scientific
Software & Applications, NCSA
Research Associate Professor,
CS, ECE, iSchool
Parsl Team: Y. Babuji, A. Woodard,
Z. Li, D. S. Katz, B. Clifford, R. Kumar,
L. Lacinski, R. Chard, J. M. Wozniak,
I. Foster, M. Wilde, K. Chard
Supporting composition and parallelism in Python
Software is increasingly assembled rather than written
• High-level language (e.g., Python) to integrate and wrap components from
many sources
Parallel and distributed computing is no longer a niche area
• Increasing data sizes combined with plateauing sequential processing power
• Parallel hardware (e.g., accelerators) and distributed computing systems
Parsl allows for the natural expression of parallelism in such a way that
programs can express opportunities for parallelism that can then be
realized, at execution time, using different execution models on different
parallel platforms
Traditional workflow
• A set of tasks and dependencies between them
• Perhaps expressed as data structure, e.g. graph (DAG or cyclic)
• How is this different than a procedural computer program?
• At the level of a set of instructions:
• Dependencies are often explicit, perhaps like a compiled intermediate
representation
• Tasks are much longer (running time O(sec) – O(hr))
• At level of set of functions:
• Tasks as more well-defined (inputs, outputs)
• Tasks are often longer (running time O(sec) – O(hr))
https://danielskatzblog.wordpress.com/2018/01/08/expressing-workflows-as-code-vs-data/
https://danielskatzblog.wordpress.com/2019/02/05/using-workflows-expressed-as-code-and-workflows-expressed-as-data-together/
Traditional workflow expression
• Why express a workflow differently than a program?
• Program (script) is a natural way of expressing a workflow
• Easy to understand, easy to change
• Examples: shell scripts, programs in Parsl
• Parsl: functions used to identify components
• Expressing it as data corresponds to the compiled (assembly)
version of the workflow
• Maybe easier to execute?
• Perhaps easier to reproduce?
https://danielskatzblog.wordpress.com/2018/01/08/expressing-workflows-as-code-vs-data/
https://danielskatzblog.wordpress.com/2019/02/05/using-workflows-expressed-as-code-and-workflows-expressed-as-data-together/
Workflow as code vs workflow as data
• Goes back to workflow lifecycle concept
• Workflows follow a cycle:
• Experimentation/exploration phase (scientific hacking): workflow is extension of
thought processes of workflow maker
• Productization/ dissemination phase: developer (or someone else) prepares for
wider and repeated use by documentation and optimization then disseminates
• This use by others can simply be use, or it can be further development.
• Different types of users have different needs
• Experts want to be able to do as much as possible
• Other users trade away complex features for simpler user interface
C. Wroe, C. Goble, et al., “Recycling workflows and services through discovery and reuse,”
CCPE v19, pp. 181-194, 2007. doi:10.1002/cpe.1050
Representative Parsl Use Cases
Input
Output
DLHub SwiftSeq LSST-DESC
DESC image simulation
Catalog
Simulator
Image
Simulator
Atmosphere
, Telescope,
Camera...
LSST Data
Management
Stack
Fake
Observations!SCIENCE!
NASA/JPL-
Caltech/ESO
/R. Hurt
HSC Project /
NAOJ
LSST Project
Credit: Antonio Villarreal
ImSim workflow
Bundler
189 sensors
x ~10,000s
of instance
catalogs
Node-sized bundles
(64 tasks each)
JSON description
Catalog 1 189
tasks
x 4000 nodes
Parsl
Extreme
Scale
Executor
x 189 x ~10,000s
256K cores
for 3 days
Catalog 2
Catalog 3
128K cores
for 3.5 days
x 2000 nodes
Representative Parsl use cases
DLHub
Machine Learning
Inference
SwiftSeq
DNA Sequence
Analysis
LSST-DESC
Simulated Sky
Survey
O(Tasks) Thousands Thousands Millions
O(Nodes) Tens Hundreds Thousands
O(Duration) Milliseconds-Seconds Hours-Days Hours-Day
Pattern Bag-of-tasks Dataflow Dataflow
Requirements Low latency bounds High throughput Extreme scale
Parsl Basics
Parsl: Interactive parallel programming in Python
Apps define opportunities for parallelism
• Python apps call Python functions
• Bash apps call external applications
Apps return “futures”: a proxy for a result
that might not yet be available
Apps run concurrently respecting data
dependencies. Natural parallel
programming!
Parsl scripts are independent of where
they run. Write once run anywhere!
pip install parsl
Try parsl via binder at bottom left of http://parsl-project.org
Expressing a many task workflow in Parsl
1) Wrap the science applications as Parsl Apps:
@bash_app
def simulate(outputs=[]):
return './simulation_app.exe {outputs[0]}’
@bash_app
def merge(inputs=[], outputs=[]):
i = inputs; o = outputs
return './merge {1} {0}'.format(' '.join(i), o[0])
@python_app
def analyze(inputs=[]):
return analysis_package(inputs)
Expressing a many task workflow in Parsl
2) Execute the parallel workflow by calling Apps:
sims = []
for i in range (nsims):
sims.append(simulate(outputs=['sim-%s.txt' % i]))
all = merge(inputs=[i.outputs[0] for i in sims],
outputs=['all.txt'])
result = analyze(inputs=[all.outputs[0]])
simulate simulate simulate
…
merge
analyze
sim-1.txt sim-2.txt sim-N.txt
all.txt
Decomposing dynamic parallel execution into a task-dependency
graph
Parsl
Parsl scripts are execution provider independent
The same script can be run locally, on grids, clouds,
or supercomputers
Growing support for various schedulers and cloud
vendors
From Parsl docs
Separation of code and execution
Choose execution environment
at runtime. Parsl will direct
tasks to the configured
execution environment(s).
Authentication and authorization
Authn/z is hard…
• 2FA, X509, GSISSH, etc.
Integration with Globus Auth
to support native app
integration for accessing
Globus (and other) services
Using scoped access tokens,
refresh tokens, delegation
support
Transparent (wide area) data management
Implicit data movement to/from
repositories, laptops,
supercomputers
Globus for third-party, high
performance and reliable data
transfer
• Support for site-specific DTNs
HTTP/FTP direct data staging
parsl_file =
File(globus://EP/path/file)
www.globus.org
Parsl Performance
Different types of scientific workloads
High-throughput workloads
• Protein docking, image processing, materials reconstructions
• Requirements: 1000s of tasks, 100s of nodes, reliability, usability,
monitoring, elasticity, etc.
Extreme-scale workloads
• Cosmology simulations, imaging the arctic, genomics analysis
• Requirements: millions of tasks, 1000s of nodes (100,000s cores)
Interactive and real-time workloads
• Materials science, cosmic ray shower analysis, machine learning inference
• Requirements: 10s of nodes, rapid response, pipelining
Different types of execution
High-throughput executor (HTEX)
• Pilot job-based model with multi-threaded manager deployed on workers
• Designed for ease of use, fault-tolerance, etc.
• <2000 nodes (~60K workers), ms tasks, task duration/nodes > 0.01
Extreme-scale executor (EXEX)
• Distributed MPI job manages execution. Manager rank communicates
workload to other worker ranks directly
• Designed for extreme scale execution on supercomputers
• >1000 nodes (>30K workers), ms tasks, >1 m task duration
Low-latency Executor (LLEX)
• Direct socket communication to workers, fixed resource pool, limited features
• 10s nodes, <1M tasks, <1m tasks
Short tasks scale to thousands of workers
Strong scaling: 50,000 tasks submitted
with increasing number of workers
* Fireworks only 5,000 tasks
HTEX and EXEX outperform other
Python-based approaches when >256
workers
Other approaches are limited to fewer
than 128 nodes; HTEX and EXEX
continue to scale
0s tasks
1s tasks
Executors scale to 2M tasks/256K workers
0s tasks
1s tasks
Weak scaling: 10 tasks per worker
HTEX and EXEX again outperform
other Python-based approaches up
to ~2M tasks
HTEX and EXEX scale to 2K nodes
(~65k workers) and 8K nodes
(~262K workers), respectively, with
>1K tasks/s
Parsl executors can provide low latency
• LLEX achieves low
(3.47ms) and
consistent latency
• HTEX (6.87ms) and
EXEX (9.83) are less
consistent
Scalability summary
• EXEX scales to over 250,000 workers across 8,000 nodes
• Both EXEX and HTEX deliver ~1200 tasks/s
• LLEX achieves an average latency of 3.47 ms with tight bounds
Framework Max. number of
workers
Max. number of
nodes
Max tasks/sec
Parsl-IPP 2048 64 330
Parsl-HTEX 65 536 2048 1181
Parsl-EXEX 262 144 8192 1176
FireWorks 1024 32 4
Dask distributed 4096 128 2617
More Parsl Functionality
Interactive supercomputing in Jupyter notebooks
Monitoring
and
visualization
Workflow view Task view
DOE Distributed Computing & Data Ecosystem
(DCDE)
• A DOE group is identifying best practices and research challenges to create
and operate a DOE/SC wide federated Distributed Computing & Data
Ecosystem (DCDE)
• Future Lab Computing Working Group (FLC-WG)
• Initially working towards a pilot
• Using OAuth, working with Globus
• Test deployment at BNL
• Parsl is part of this effort, via initial work in linking ORNL and BNL
• We’ve added support for an OAuthSSHChannel
• Now being tested on test deployment
Multi-site execution
1.Loading Parsl
configuration triggers:
a) Creation of SSH
channels
b) Deployment of an
interchange process
onto login nodes
c) Submission of pilot jobs
that will connect to the
interchange
2.Parsl submits tasks
directly to interchange
3.Parsl uses Globus to
stage data
Interchange Interchange
Parsl
Multi-site execution
Too much small code
See demo instead
https://bit.ly/2Wsjlep
(code in https://github.com/Parsl/demo_multifacility)
Other functionality provided by Parsl
Globus. Delegated authentication
and wide area data management
Fault tolerance. Support for retries,
checkpointing, and memoization
Containers. Sandboxed execution
environments for workers and tasks
Data management. Automated
staging with HTTP, FTP, and Globus
Multi site. Combining
executors/providers for execution
across different resources
Elasticity. Automated resource
expansion/retraction based on
workload
Monitoring. Workflow and resource
monitoring and visualization
Reproducibility. Capture of workflow
provenance in the task graph
Jupyter integration. Seamless
description and management of
workflows
Resource abstraction. Block-based
model overlaying different providers
and resources
Summary
Parsl’s parallelism in Python
• Simple: minimal new constructs
• Safe: deterministic parallel programs through immutable
input/output objects, dependency task graph, etc.
• Scalable: efficient execution from laptops to the largest
supercomputers
• Flexible: programs composed from existing components and
then applied to different resources/workloads
Open source
https://github.com/Parsl/parsl
Questions?
http://parsl-project.org
U . S . D E P A R T M E N T O F
ENERGY

More Related Content

What's hot (20)

PDF
MAVRL Workshop 2014 - pymatgen-db & custodian
University of California, San Diego
 
PPTX
Smart Data Conference: DL4J and DataVec
Josh Patterson
 
PDF
Snorkel: Dark Data and Machine Learning with Christopher Ré
Jen Aman
 
PPTX
Grid'5000: Running a Large Instrument for Parallel and Distributed Computing ...
Frederic Desprez
 
PDF
Ray and Its Growing Ecosystem
Databricks
 
PPTX
Tom Peters, Software Engineer, Ufora at MLconf ATL 2016
MLconf
 
PDF
Neural Networks, Spark MLlib, Deep Learning
Asim Jalis
 
PDF
Mathias Brandewinder, Software Engineer & Data Scientist, Clear Lines Consult...
MLconf
 
PDF
Automating materials science workflows with pymatgen, FireWorks, and atomate
Anubhav Jain
 
PPTX
Weld Strata talk
Deepak Narayanan
 
PDF
Convolutional Neural Networks at scale in Spark MLlib
DataWorks Summit
 
PPTX
TensorFrames: Google Tensorflow on Apache Spark
Databricks
 
PPTX
AI Development with H2O.ai
Yalçın Yenigün
 
PDF
Parallel Programming in Python: Speeding up your analysis
Manojit Nandi
 
PDF
Flare: Scale Up Spark SQL with Native Compilation and Set Your Data on Fire! ...
Databricks
 
PDF
Large Scale Deep Learning with TensorFlow
Jen Aman
 
PPTX
SoDA v2 - Named Entity Recognition from streaming text
Sujit Pal
 
PDF
Software tools to facilitate materials science research
Anubhav Jain
 
PDF
Scalable Algorithm Design with MapReduce
Pietro Michiardi
 
PPTX
Big Data Science with H2O in R
Anqi Fu
 
MAVRL Workshop 2014 - pymatgen-db & custodian
University of California, San Diego
 
Smart Data Conference: DL4J and DataVec
Josh Patterson
 
Snorkel: Dark Data and Machine Learning with Christopher Ré
Jen Aman
 
Grid'5000: Running a Large Instrument for Parallel and Distributed Computing ...
Frederic Desprez
 
Ray and Its Growing Ecosystem
Databricks
 
Tom Peters, Software Engineer, Ufora at MLconf ATL 2016
MLconf
 
Neural Networks, Spark MLlib, Deep Learning
Asim Jalis
 
Mathias Brandewinder, Software Engineer & Data Scientist, Clear Lines Consult...
MLconf
 
Automating materials science workflows with pymatgen, FireWorks, and atomate
Anubhav Jain
 
Weld Strata talk
Deepak Narayanan
 
Convolutional Neural Networks at scale in Spark MLlib
DataWorks Summit
 
TensorFrames: Google Tensorflow on Apache Spark
Databricks
 
AI Development with H2O.ai
Yalçın Yenigün
 
Parallel Programming in Python: Speeding up your analysis
Manojit Nandi
 
Flare: Scale Up Spark SQL with Native Compilation and Set Your Data on Fire! ...
Databricks
 
Large Scale Deep Learning with TensorFlow
Jen Aman
 
SoDA v2 - Named Entity Recognition from streaming text
Sujit Pal
 
Software tools to facilitate materials science research
Anubhav Jain
 
Scalable Algorithm Design with MapReduce
Pietro Michiardi
 
Big Data Science with H2O in R
Anqi Fu
 

Similar to Parsl: Pervasive Parallel Programming in Python (20)

PDF
Scalable Parallel Programming in Python with Parsl
Globus
 
PDF
Expressing and sharing workflows
Daniel S. Katz
 
PDF
FireWorks workflow software
Anubhav Jain
 
PDF
Globus Labs: Forging the Next Frontier
Globus
 
PDF
Overview of Scientific Workflows - Why Use Them?
inside-BigData.com
 
PPTX
Advances in Scientific Workflow Environments
Carole Goble
 
PDF
FireWorks overview
Anubhav Jain
 
PPTX
PowerShell 3.0 workflows
Ravikanth Chaganti
 
PDF
Automating Environmental Computing Applications with Scientific Workflows
Rafael Ferreira da Silva
 
PDF
The Interplay of Workflow Execution and Resource Provisioning
Rafael Ferreira da Silva
 
PDF
Integrative Parallel Programming in HPC
Victor Eijkhout
 
PDF
Data Pipelines with Python - NWA TechFest 2017
Casey Kinsey
 
PDF
Online Workflow Management and Performance Analysis with Stampede
Dan Gunter
 
PPTX
WorkflowHub: Community Framework for Enabling Scientific Workflow Research a...
Rafael Ferreira da Silva
 
PDF
The Future of Computing is Distributed
Alluxio, Inc.
 
PPTX
Automating Real-time Seismic Analysis Through Streaming and High Throughput W...
Rafael Ferreira da Silva
 
PDF
2016-10-20 BioExcel: Advances in Scientific Workflow Environments
Stian Soiland-Reyes
 
PPTX
FAIR Computational Workflows
Carole Goble
 
PDF
Nephele pegasus
Somnath Mazumdar
 
ODP
An introduction to erlang
Mirko Bonadei
 
Scalable Parallel Programming in Python with Parsl
Globus
 
Expressing and sharing workflows
Daniel S. Katz
 
FireWorks workflow software
Anubhav Jain
 
Globus Labs: Forging the Next Frontier
Globus
 
Overview of Scientific Workflows - Why Use Them?
inside-BigData.com
 
Advances in Scientific Workflow Environments
Carole Goble
 
FireWorks overview
Anubhav Jain
 
PowerShell 3.0 workflows
Ravikanth Chaganti
 
Automating Environmental Computing Applications with Scientific Workflows
Rafael Ferreira da Silva
 
The Interplay of Workflow Execution and Resource Provisioning
Rafael Ferreira da Silva
 
Integrative Parallel Programming in HPC
Victor Eijkhout
 
Data Pipelines with Python - NWA TechFest 2017
Casey Kinsey
 
Online Workflow Management and Performance Analysis with Stampede
Dan Gunter
 
WorkflowHub: Community Framework for Enabling Scientific Workflow Research a...
Rafael Ferreira da Silva
 
The Future of Computing is Distributed
Alluxio, Inc.
 
Automating Real-time Seismic Analysis Through Streaming and High Throughput W...
Rafael Ferreira da Silva
 
2016-10-20 BioExcel: Advances in Scientific Workflow Environments
Stian Soiland-Reyes
 
FAIR Computational Workflows
Carole Goble
 
Nephele pegasus
Somnath Mazumdar
 
An introduction to erlang
Mirko Bonadei
 
Ad

More from Daniel S. Katz (20)

PDF
Research software susainability
Daniel S. Katz
 
PPTX
Software Professionals (RSEs) at NCSA
Daniel S. Katz
 
PPTX
Requiring Publicly-Funded Software, Algorithms, and Workflows to be Made Publ...
Daniel S. Katz
 
PPTX
What is eScience, and where does it go from here?
Daniel S. Katz
 
PDF
Citation and Research Objects: Toward Active Research Objects
Daniel S. Katz
 
PDF
FAIR is not Fair Enough, Particularly for Software Citation, Availability, or...
Daniel S. Katz
 
PPTX
Fundamentals of software sustainability
Daniel S. Katz
 
PPTX
Software Citation in Theory and Practice
Daniel S. Katz
 
PPTX
URSSI
Daniel S. Katz
 
PDF
Research Software Sustainability: WSSSPE & URSSI
Daniel S. Katz
 
PDF
Software citation
Daniel S. Katz
 
PDF
Citation and reproducibility in software
Daniel S. Katz
 
PPTX
Software Citation: Principles, Implementation, and Impact
Daniel S. Katz
 
PPTX
Summary of WSSSPE and its working groups
Daniel S. Katz
 
PPTX
Working towards Sustainable Software for Science: Practice and Experience (WS...
Daniel S. Katz
 
PPTX
20160607 citation4software panel
Daniel S. Katz
 
PPTX
20160607 citation4software opening
Daniel S. Katz
 
PPTX
Scientific Software Challenges and Community Responses
Daniel S. Katz
 
PPTX
What do we need beyond a DOI?
Daniel S. Katz
 
PPTX
Looking at Software Sustainability and Productivity Challenges from NSF
Daniel S. Katz
 
Research software susainability
Daniel S. Katz
 
Software Professionals (RSEs) at NCSA
Daniel S. Katz
 
Requiring Publicly-Funded Software, Algorithms, and Workflows to be Made Publ...
Daniel S. Katz
 
What is eScience, and where does it go from here?
Daniel S. Katz
 
Citation and Research Objects: Toward Active Research Objects
Daniel S. Katz
 
FAIR is not Fair Enough, Particularly for Software Citation, Availability, or...
Daniel S. Katz
 
Fundamentals of software sustainability
Daniel S. Katz
 
Software Citation in Theory and Practice
Daniel S. Katz
 
Research Software Sustainability: WSSSPE & URSSI
Daniel S. Katz
 
Software citation
Daniel S. Katz
 
Citation and reproducibility in software
Daniel S. Katz
 
Software Citation: Principles, Implementation, and Impact
Daniel S. Katz
 
Summary of WSSSPE and its working groups
Daniel S. Katz
 
Working towards Sustainable Software for Science: Practice and Experience (WS...
Daniel S. Katz
 
20160607 citation4software panel
Daniel S. Katz
 
20160607 citation4software opening
Daniel S. Katz
 
Scientific Software Challenges and Community Responses
Daniel S. Katz
 
What do we need beyond a DOI?
Daniel S. Katz
 
Looking at Software Sustainability and Productivity Challenges from NSF
Daniel S. Katz
 
Ad

Recently uploaded (20)

PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 

Parsl: Pervasive Parallel Programming in Python

  • 1. Parsl: Pervasive Parallel Programming in Python 18 October 2019 Daniel S. Katz ([email protected], http://danielskatz.org, @danielskatz) Assistant Director for Scientific Software & Applications, NCSA Research Associate Professor, CS, ECE, iSchool Parsl Team: Y. Babuji, A. Woodard, Z. Li, D. S. Katz, B. Clifford, R. Kumar, L. Lacinski, R. Chard, J. M. Wozniak, I. Foster, M. Wilde, K. Chard
  • 2. Supporting composition and parallelism in Python Software is increasingly assembled rather than written • High-level language (e.g., Python) to integrate and wrap components from many sources Parallel and distributed computing is no longer a niche area • Increasing data sizes combined with plateauing sequential processing power • Parallel hardware (e.g., accelerators) and distributed computing systems Parsl allows for the natural expression of parallelism in such a way that programs can express opportunities for parallelism that can then be realized, at execution time, using different execution models on different parallel platforms
  • 3. Traditional workflow • A set of tasks and dependencies between them • Perhaps expressed as data structure, e.g. graph (DAG or cyclic) • How is this different than a procedural computer program? • At the level of a set of instructions: • Dependencies are often explicit, perhaps like a compiled intermediate representation • Tasks are much longer (running time O(sec) – O(hr)) • At level of set of functions: • Tasks as more well-defined (inputs, outputs) • Tasks are often longer (running time O(sec) – O(hr)) https://danielskatzblog.wordpress.com/2018/01/08/expressing-workflows-as-code-vs-data/ https://danielskatzblog.wordpress.com/2019/02/05/using-workflows-expressed-as-code-and-workflows-expressed-as-data-together/
  • 4. Traditional workflow expression • Why express a workflow differently than a program? • Program (script) is a natural way of expressing a workflow • Easy to understand, easy to change • Examples: shell scripts, programs in Parsl • Parsl: functions used to identify components • Expressing it as data corresponds to the compiled (assembly) version of the workflow • Maybe easier to execute? • Perhaps easier to reproduce? https://danielskatzblog.wordpress.com/2018/01/08/expressing-workflows-as-code-vs-data/ https://danielskatzblog.wordpress.com/2019/02/05/using-workflows-expressed-as-code-and-workflows-expressed-as-data-together/
  • 5. Workflow as code vs workflow as data • Goes back to workflow lifecycle concept • Workflows follow a cycle: • Experimentation/exploration phase (scientific hacking): workflow is extension of thought processes of workflow maker • Productization/ dissemination phase: developer (or someone else) prepares for wider and repeated use by documentation and optimization then disseminates • This use by others can simply be use, or it can be further development. • Different types of users have different needs • Experts want to be able to do as much as possible • Other users trade away complex features for simpler user interface C. Wroe, C. Goble, et al., “Recycling workflows and services through discovery and reuse,” CCPE v19, pp. 181-194, 2007. doi:10.1002/cpe.1050
  • 6. Representative Parsl Use Cases Input Output DLHub SwiftSeq LSST-DESC
  • 7. DESC image simulation Catalog Simulator Image Simulator Atmosphere , Telescope, Camera... LSST Data Management Stack Fake Observations!SCIENCE! NASA/JPL- Caltech/ESO /R. Hurt HSC Project / NAOJ LSST Project Credit: Antonio Villarreal
  • 8. ImSim workflow Bundler 189 sensors x ~10,000s of instance catalogs Node-sized bundles (64 tasks each) JSON description Catalog 1 189 tasks x 4000 nodes Parsl Extreme Scale Executor x 189 x ~10,000s 256K cores for 3 days Catalog 2 Catalog 3 128K cores for 3.5 days x 2000 nodes
  • 9. Representative Parsl use cases DLHub Machine Learning Inference SwiftSeq DNA Sequence Analysis LSST-DESC Simulated Sky Survey O(Tasks) Thousands Thousands Millions O(Nodes) Tens Hundreds Thousands O(Duration) Milliseconds-Seconds Hours-Days Hours-Day Pattern Bag-of-tasks Dataflow Dataflow Requirements Low latency bounds High throughput Extreme scale
  • 11. Parsl: Interactive parallel programming in Python Apps define opportunities for parallelism • Python apps call Python functions • Bash apps call external applications Apps return “futures”: a proxy for a result that might not yet be available Apps run concurrently respecting data dependencies. Natural parallel programming! Parsl scripts are independent of where they run. Write once run anywhere! pip install parsl Try parsl via binder at bottom left of http://parsl-project.org
  • 12. Expressing a many task workflow in Parsl 1) Wrap the science applications as Parsl Apps: @bash_app def simulate(outputs=[]): return './simulation_app.exe {outputs[0]}’ @bash_app def merge(inputs=[], outputs=[]): i = inputs; o = outputs return './merge {1} {0}'.format(' '.join(i), o[0]) @python_app def analyze(inputs=[]): return analysis_package(inputs)
  • 13. Expressing a many task workflow in Parsl 2) Execute the parallel workflow by calling Apps: sims = [] for i in range (nsims): sims.append(simulate(outputs=['sim-%s.txt' % i])) all = merge(inputs=[i.outputs[0] for i in sims], outputs=['all.txt']) result = analyze(inputs=[all.outputs[0]]) simulate simulate simulate … merge analyze sim-1.txt sim-2.txt sim-N.txt all.txt
  • 14. Decomposing dynamic parallel execution into a task-dependency graph Parsl
  • 15. Parsl scripts are execution provider independent The same script can be run locally, on grids, clouds, or supercomputers Growing support for various schedulers and cloud vendors From Parsl docs
  • 16. Separation of code and execution Choose execution environment at runtime. Parsl will direct tasks to the configured execution environment(s).
  • 17. Authentication and authorization Authn/z is hard… • 2FA, X509, GSISSH, etc. Integration with Globus Auth to support native app integration for accessing Globus (and other) services Using scoped access tokens, refresh tokens, delegation support
  • 18. Transparent (wide area) data management Implicit data movement to/from repositories, laptops, supercomputers Globus for third-party, high performance and reliable data transfer • Support for site-specific DTNs HTTP/FTP direct data staging parsl_file = File(globus://EP/path/file) www.globus.org
  • 20. Different types of scientific workloads High-throughput workloads • Protein docking, image processing, materials reconstructions • Requirements: 1000s of tasks, 100s of nodes, reliability, usability, monitoring, elasticity, etc. Extreme-scale workloads • Cosmology simulations, imaging the arctic, genomics analysis • Requirements: millions of tasks, 1000s of nodes (100,000s cores) Interactive and real-time workloads • Materials science, cosmic ray shower analysis, machine learning inference • Requirements: 10s of nodes, rapid response, pipelining
  • 21. Different types of execution High-throughput executor (HTEX) • Pilot job-based model with multi-threaded manager deployed on workers • Designed for ease of use, fault-tolerance, etc. • <2000 nodes (~60K workers), ms tasks, task duration/nodes > 0.01 Extreme-scale executor (EXEX) • Distributed MPI job manages execution. Manager rank communicates workload to other worker ranks directly • Designed for extreme scale execution on supercomputers • >1000 nodes (>30K workers), ms tasks, >1 m task duration Low-latency Executor (LLEX) • Direct socket communication to workers, fixed resource pool, limited features • 10s nodes, <1M tasks, <1m tasks
  • 22. Short tasks scale to thousands of workers Strong scaling: 50,000 tasks submitted with increasing number of workers * Fireworks only 5,000 tasks HTEX and EXEX outperform other Python-based approaches when >256 workers Other approaches are limited to fewer than 128 nodes; HTEX and EXEX continue to scale 0s tasks 1s tasks
  • 23. Executors scale to 2M tasks/256K workers 0s tasks 1s tasks Weak scaling: 10 tasks per worker HTEX and EXEX again outperform other Python-based approaches up to ~2M tasks HTEX and EXEX scale to 2K nodes (~65k workers) and 8K nodes (~262K workers), respectively, with >1K tasks/s
  • 24. Parsl executors can provide low latency • LLEX achieves low (3.47ms) and consistent latency • HTEX (6.87ms) and EXEX (9.83) are less consistent
  • 25. Scalability summary • EXEX scales to over 250,000 workers across 8,000 nodes • Both EXEX and HTEX deliver ~1200 tasks/s • LLEX achieves an average latency of 3.47 ms with tight bounds Framework Max. number of workers Max. number of nodes Max tasks/sec Parsl-IPP 2048 64 330 Parsl-HTEX 65 536 2048 1181 Parsl-EXEX 262 144 8192 1176 FireWorks 1024 32 4 Dask distributed 4096 128 2617
  • 27. Interactive supercomputing in Jupyter notebooks
  • 29. DOE Distributed Computing & Data Ecosystem (DCDE) • A DOE group is identifying best practices and research challenges to create and operate a DOE/SC wide federated Distributed Computing & Data Ecosystem (DCDE) • Future Lab Computing Working Group (FLC-WG) • Initially working towards a pilot • Using OAuth, working with Globus • Test deployment at BNL • Parsl is part of this effort, via initial work in linking ORNL and BNL • We’ve added support for an OAuthSSHChannel • Now being tested on test deployment
  • 30. Multi-site execution 1.Loading Parsl configuration triggers: a) Creation of SSH channels b) Deployment of an interchange process onto login nodes c) Submission of pilot jobs that will connect to the interchange 2.Parsl submits tasks directly to interchange 3.Parsl uses Globus to stage data Interchange Interchange Parsl
  • 31. Multi-site execution Too much small code See demo instead https://bit.ly/2Wsjlep (code in https://github.com/Parsl/demo_multifacility)
  • 32. Other functionality provided by Parsl Globus. Delegated authentication and wide area data management Fault tolerance. Support for retries, checkpointing, and memoization Containers. Sandboxed execution environments for workers and tasks Data management. Automated staging with HTTP, FTP, and Globus Multi site. Combining executors/providers for execution across different resources Elasticity. Automated resource expansion/retraction based on workload Monitoring. Workflow and resource monitoring and visualization Reproducibility. Capture of workflow provenance in the task graph Jupyter integration. Seamless description and management of workflows Resource abstraction. Block-based model overlaying different providers and resources
  • 34. Parsl’s parallelism in Python • Simple: minimal new constructs • Safe: deterministic parallel programs through immutable input/output objects, dependency task graph, etc. • Scalable: efficient execution from laptops to the largest supercomputers • Flexible: programs composed from existing components and then applied to different resources/workloads