Meetup

Scalable Python for Everyone, Everywhere

Matthew Rocklin, Coiled ComputingEpisode 38 · 57:07 · Oct 2020 · 319 viewsHosted by Demetrios Brinkmann
Thumbnail for Scalable Python for Everyone, Everywhere Watch on YouTube
TL;DR
  1. 1

    Dask extends familiar Python libraries such as NumPy and pandas to work across many cores, larger-than-memory datasets, and distributed clusters.

  2. 2

    Dask divides arrays and data frames into smaller blocks, builds a task graph, and executes the resulting tasks across local or cloud resources.

  3. 3

    Running distributed Python involves software versions, security, credentials, cost controls, deployment, and performance issues that are separate from the framework itself.

Summary

Matthew Rocklin presents Dask as a way to scale the existing Python data science ecosystem without replacing its familiar APIs. He demonstrates Dask Array on a larger-than-memory array, then uses Dask DataFrame to read data from Amazon S3 and run pandas-style computations across a cloud cluster. The dashboard shows workers, task dependencies, communication, memory, and CPU activity. Rocklin explains that Dask can run locally, on cloud resources, or through systems such as Kubernetes, Amazon EMR, and Amazon EKS. Coiled is his company's managed approach for deploying secure, monitored Dask clusters. He is direct about the limits: some pandas operations, such as exact medians and row-by-row mutation, do not translate well to distributed execution. He also contrasts Dask with Spark, describing Dask as a lower-level, more flexible task scheduler that other Python libraries can use. Deployment, cost management, and learning a distributed performance model remain substantial adoption hurdles.

Key ideas
01:40

Dask keeps the familiar Python interface while changing where the work runs

Rocklin says his work is focused on scaling the Python data science ecosystem across many cores, larger-than-memory datasets, and distributed clusters. Dask provides NumPy-like, pandas-like, and scikit-learn-related APIs, so users can keep working with tools they already know. He describes Dask as infrastructure that can also appear indirectly inside other libraries. Reading data from S3 with pandas or deploying work on a Hadoop cluster may involve code maintained by Dask contributors even when the user does not call Dask directly.

04:20

Dask Array splits one logical array into many NumPy blocks

Rocklin starts with a NumPy array representing many images and computes a mean across one axis. That works well while the data fits in memory, but NumPy cannot allocate an array larger than the machine's available memory. Dask Array keeps the same logical array interface while dividing the data into smaller blocks. Each block is a NumPy array, and Dask coordinates operations across those blocks. The user writes a high-level computation, while Dask turns it into smaller operations that can run in parallel.

07:50

The dashboard makes distributed execution visible

Rocklin starts a local cluster and embeds the Dask dashboard in JupyterLab. The dashboard shows the scheduler, workers, CPU and memory activity, task dependencies, and communication between workers. In the task graph, each small block corresponds to an operation, with lines showing dependencies. He points out periods where a core is computing, waiting, transferring data, or calculating a mean. The same workflow can move from a laptop to cloud machines while keeping the working interface.

18:10

Cloud deployment adds problems that the computation API does not solve

When Rocklin moves the example to cloud workers, he calls out mismatched Dask versions between the local client and the cloud scheduler. He also discusses TLS connections, AWS authentication, safely passing credentials, and tracking cloud spending. In his demonstration, Coiled reports the cluster's hourly cost and accumulated cost. He says distributed-computing talks often focus on dashboards and speedups while leaving out installation, image building, security, and account management. Those operational details can prevent a prototype from reaching real data and real teams.

23:50

Dask DataFrame does not support every pandas pattern efficiently

Rocklin says Dask DataFrame supports much of the pandas API when computations use pandas-style operations, but distributed execution changes what is practical. Exact median is a classic limitation because parallel medians are difficult to compute, although approximate quantiles are possible. Row-by-row iteration and changing individual elements are also poor fits for a billion-row distributed data frame. He warns that Dask is not always faster. Bulk operations may improve, while operations such as sorting can become slower because they are difficult to distribute.

27:15

Adaptive scaling matches bursty data science work

Dask can use adaptive deployments that choose how many workers to request within configured minimums and maximums. Rocklin says scaling down matters because data science and machine learning work is often bursty. A user may compute for a few minutes and then spend an hour examining a plot, so keeping every worker running would waste resources. The tradeoff is startup time. In his AWS setup, new machines take about a minute to arrive, which is acceptable for data engineering or non-interactive work and more noticeable during interactive analysis.

33:43

Dask and Spark fit different workloads

Rocklin says Dask does not remove the need for Spark or Databricks. Spark is strong for data engineering and SQL-like workloads, such as converting JSON to Parquet and running queries with lightweight machine learning. Dask is more flexible outside that database-shaped model because it supports NumPy, pandas, scikit-learn, and other Python libraries. He describes Dask as a dynamic distributed task scheduler rather than a proper database. Its lower-level task graph can run Python functions with dependencies, allowing library authors to build different higher-level applications on top of it.

44:00

The hardest adoption problem is building the right performance and deployment habits

Rocklin identifies two recurring learning barriers. Distributed computing changes the familiar performance model because network transfers, changing worker counts, GPUs, and multiple machines all affect runtime. He recommends keeping the dashboard visible while computing so users can build intuition about why work is fast or slow. Deployment becomes harder when a system must support teammates, secure data, and organizational controls. Coiled is designed to provide authentication, monitoring, and managed cloud deployment through a small Python setup, while Dask itself remains one part of a larger pipeline.

"You should not trust me on any of this, you know, Dask is arguably a replacement for Spark and so you know I'm biased towards Dask."Matthew Rocklin34:29
Who should watch
  • You use NumPy or pandas on datasets that no longer fit comfortably in one machine's memory.
  • Your team can run a Dask prototype locally but needs cloud workers, authentication, quotas, cost tracking, or worker scaling.
  • You are deciding whether a workload fits Dask or Spark and want to understand the tradeoffs beyond benchmark speedups.