This tutorial was last given at SciPy 2017 in Austin Texas. A video is available online.
Dask provides multi-core execution on larger-than-memory datasets.
We can think of dask at a high and a low level
- High level collections: Dask provides high-level Array, Bag, and DataFrame collections that mimic NumPy, lists, and Pandas but can operate in parallel on datasets that don't fit into main memory. Dask's high-level collections are alternatives to NumPy and Pandas for large datasets.
- Low Level schedulers: Dask provides dynamic task schedulers that
execute task graphs in parallel. These execution engines power the
high-level collections mentioned above but can also power custom,
user-defined workloads. These schedulers are low-latency (around 1ms) and
work hard to run computations in a small memory footprint. Dask's
schedulers are an alternative to direct use of
threading
ormultiprocessing
libraries in complex cases or other task scheduling systems likeLuigi
orIPython parallel
.
Different users operate at different levels but it is useful to understand
both. This tutorial will interleave between high-level use of dask.array
and
dask.dataframe
(even sections) and low-level use of dask graphs and
schedulers (odd sections.)
You should clone this repository
git clone http://github.com/dask/dask-tutorial
and then install necessary packages.
You will need the following core libraries
conda install numpy pandas h5py Pillow matplotlib scipy toolz pytables snakeviz dask distributed
You may find the following libraries helpful for some exercises
pip install graphviz cachey
In the repo directory
conda env create -f environment.yml
and then on osx/linux
source activate dask-tutorial
on windows
activate dask-tutorial
You can build a docker image out of the provided Dockerfile.
Windows users can install graphviz as follows
- Install Graphviz from http://www.graphviz.org/Download_windows.php
- Add C:\Program Files (x86)\Graphviz2.38\bin to the PATH
Alternatively one can use the following conda commands (one installs graphviz and one installs python-bindings for graphviz):
- conda install -c conda-forge graphviz
- conda install -c conda-forge python-graphviz
From the repo directory
python prep.py
From the repo directory
jupyter notebook
- Reference
- Ask for help
dask
tag on Stack Overflow- github issues for bug reports and feature requests
- blaze-dev mailing list for community discussion
- Please ask questions during a live tutorial
-
Overview - dask's place in the universe
-
Foundations - low-level Dask and how it does what it does
-
Bag - the first high-level collection: a generalized iterator for use with a functional programming style and o clean messy data.
-
Distributed - Dask's scheduler for clusters, with details of how to view the UI.
-
Array - blocked numpy-like functionality with a collection of numpy arrays spread across your cluster.
-
Advanced Distributed - further details on distributed computing, including how to debug.
-
Dataframe - parallelized operations on many pandas dataframes spread across your cluster.
-
Dataframe Storage - efficient ways to read and write dataframes to disc.