| 1 |
FAQ |
| 2 |
=== |
| 3 |
|
| 4 |
**Question**: *Is Dask appropriate for adoption within a larger institutional context?* |
| 5 |
|
| 6 |
**Answer**: *Yes.* Dask is used within the world's largest banks, national labs, |
| 7 |
retailers, technology companies, and government agencies. It is used in highly |
| 8 |
secure environments. It is used in conservative institutions as well as fast |
| 9 |
moving ones. |
| 10 |
|
| 11 |
This page contains Frequently Asked Questions and concerns from institutions and users |
| 12 |
when they first investigate Dask. |
| 13 |
|
| 14 |
.. contents:: :local: |
| 15 |
|
| 16 |
For Management |
| 17 |
-------------- |
| 18 |
|
| 19 |
Briefly, what problem does Dask solve for us? |
| 20 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 21 |
|
| 22 |
Dask is a general purpose parallel programming solution. |
| 23 |
As such it is used in *many* different ways. |
| 24 |
|
| 25 |
However, the most common problem that Dask solves is connecting Python analysts |
| 26 |
to distributed hardware, particularly for data science and machine learning |
| 27 |
workloads. The institutions for whom Dask has the greatest |
| 28 |
impact are those who have a large body of Python users who are accustomed to |
| 29 |
libraries like NumPy, Pandas, Jupyter, Scikit-Learn and others, but want to |
| 30 |
scale those workloads across a cluster. Often they also have distributed |
| 31 |
computing resources that are going underused. |
| 32 |
|
| 33 |
Dask removes both technological and cultural barriers to connect Python users |
| 34 |
to computing resources in a way that is native to both the users and IT. |
| 35 |
|
| 36 |
"*Help me scale my notebook onto the cluster*" is a common pain point for |
| 37 |
institutions today, and it is a common entry point for Dask usage. |
| 38 |
|
| 39 |
|
| 40 |
Is Dask mature? Why should we trust it? |
| 41 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 42 |
|
| 43 |
Yes. While Dask itself is relatively new (it began in 2015) it is built by the |
| 44 |
NumPy, Pandas, Jupyter, Scikit-Learn developer community, which is well trusted. |
| 45 |
Dask is a relatively thin wrapper on top of these libraries and, |
| 46 |
as a result, the project can be relatively small and simple. |
| 47 |
It doesn't reinvent a whole new system. |
| 48 |
|
| 49 |
Additionally, this tight integration with the broader technology stack |
| 50 |
gives substantial benefits long term. For example: |
| 51 |
|
| 52 |
- Because Pandas maintainers also maintain Dask, |
| 53 |
when Pandas issues a new releases Dask issues a release at the same time to |
| 54 |
ensure continuity and compatibility. |
| 55 |
|
| 56 |
- Because Scikit-Learn maintainers maintain and use Dask when they train on large clusters, |
| 57 |
you can be assured that Dask-ML focuses on pragmatic and important |
| 58 |
solutions like XGBoost integration, and hyper-parameter selection, |
| 59 |
and that the integration between the two feels natural for novice and |
| 60 |
expert users alike. |
| 61 |
|
| 62 |
- Because Jupyter maintainers also maintain Dask, |
| 63 |
powerful Jupyter technologies like JupyterHub and JupyterLab are designed |
| 64 |
with Dask's needs in mind, and new features are pushed quickly to provide a |
| 65 |
first class and modern user experience. |
| 66 |
|
| 67 |
Additionally, Dask is maintained both by a broad community of maintainers, |
| 68 |
as well as substantial institutional support (several full-time employees each) |
| 69 |
by both Anaconda, the company behind the leading data science distribution, and |
| 70 |
NVIDIA, the leading hardware manufacturer of GPUs. Despite large corporate |
| 71 |
support, Dask remains a community governed project, and is fiscally sponsored by |
| 72 |
NumFOCUS, the same 501c3 that fiscally sponsors NumPy, Pandas, Jupyter, and many others. |
| 73 |
|
| 74 |
|
| 75 |
Who else uses Dask? |
| 76 |
~~~~~~~~~~~~~~~~~~~ |
| 77 |
|
| 78 |
Dask is used by individual researchers in practically every field today. It |
| 79 |
has millions of downloads per month, and is integrated into many PyData |
| 80 |
software packages today. |
| 81 |
|
| 82 |
On an *institutional* level Dask is used by analytics and research groups in a |
| 83 |
similarly broad set of domains across both energetic startups as well as large |
| 84 |
conservative household names. A web search shows articles by Capital One, |
| 85 |
Barclays, Walmart, NASA, Los Alamos National Laboratories, and hundreds of |
| 86 |
other similar institutions. |
| 87 |
|
| 88 |
|
| 89 |
How does Dask compare with Apache Spark? |
| 90 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 91 |
|
| 92 |
*This question has longer and more technical coverage* :doc:`here <spark>` |
| 93 |
|
| 94 |
Dask and Apache Spark are similar in that they both ... |
| 95 |
|
| 96 |
- Promise easy parallelism for data science Python users |
| 97 |
- Provide Dataframe and ML APIs for ETL, data science, and machine learning |
| 98 |
- Scale out to similar scales, around 1-1000 machines |
| 99 |
|
| 100 |
Dask differs from Apache Spark in a few ways: |
| 101 |
|
| 102 |
- Dask is more Python native, Spark is Scala/JVM native with Python bindings. |
| 103 |
|
| 104 |
Python users may find Dask more comfortable, |
| 105 |
but Dask is only useful for Python users, |
| 106 |
while Spark can also be used from JVM languages. |
| 107 |
|
| 108 |
- Dask is one component in the broader Python ecosystem alongside libraries |
| 109 |
like Numpy, Pandas, and Scikit-Learn, |
| 110 |
while Spark is an all-in-one system that re-invents much of the Python world |
| 111 |
in a single package. |
| 112 |
|
| 113 |
This means that it's often easier to compose Dask with new problem domains, |
| 114 |
but also that you need to install multiple things (like Dask and Pandas or |
| 115 |
Dask and Numpy) rather than just having everything in an all-in-one solution. |
| 116 |
|
| 117 |
- Apache Spark focuses strongly on traditional business intelligence workloads, |
| 118 |
like ETL, SQL queries, and then some lightweight machine learning, |
| 119 |
while Dask is more general purpose. |
| 120 |
|
| 121 |
This means that Dask is much more flexible and can handle other problem |
| 122 |
domains like multi-dimensional arrays, GIS, advanced machine learning, and |
| 123 |
custom systems, but that it is less focused and less tuned on typical SQL |
| 124 |
style computations. |
| 125 |
|
| 126 |
If you mostly want to focus on SQL queries then Spark is probably a better |
| 127 |
bet. If you want to support a wide variety of custom workloads then Dask |
| 128 |
might be more natural. |
| 129 |
|
| 130 |
See the section :doc:`spark`. |
| 131 |
|
| 132 |
|
| 133 |
Are there companies that we can get support from? |
| 134 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 135 |
|
| 136 |
There are several companies that offer support for dask in different capacities. See |
| 137 |
`Paid support <https://docs.dask.org/en/latest/support.html#paid-support>`_ for a full list. |
| 138 |
|
| 139 |
|
| 140 |
For IT |
| 141 |
------ |
| 142 |
|
| 143 |
|
| 144 |
How would I set up Dask on institutional hardware? |
| 145 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 146 |
|
| 147 |
You already have cluster resources. |
| 148 |
Dask can run on them today without significant change. |
| 149 |
|
| 150 |
Most institutional clusters today have a resource manager. |
| 151 |
This is typically managed by IT, with some mild permissions given to users to |
| 152 |
launch jobs. Dask works with all major resource managers today, including |
| 153 |
those on Hadoop, HPC, Kubernetes, and Cloud clusters. |
| 154 |
|
| 155 |
1. **Hadoop/Spark**: If you have a Hadoop/Spark cluster, such as one purchased |
| 156 |
through Cloudera/Hortonworks/MapR then you will likely want to deploy Dask |
| 157 |
with YARN, the resource manager that deploys services like Hadoop, Spark, |
| 158 |
Hive, and others. |
| 159 |
|
| 160 |
To help with this, you'll likely want to use `Dask-Yarn <https://yarn.dask.org>`_. |
| 161 |
|
| 162 |
2. **HPC**: If you have an HPC machine that runs resource managers like SGE, |
| 163 |
SLURM, PBS, LSF, Torque, Condor, or other job batch queuing systems, then |
| 164 |
users can launch Dask on these systems today using either: |
| 165 |
|
| 166 |
- `Dask Jobqueue <https://jobqueue.dask.org>`_ , which uses typical |
| 167 |
``qsub``, ``sbatch``, ``bsub`` or other submission tools in interactive |
| 168 |
settings. |
| 169 |
- `Dask MPI <https://mpi.dask.org>`_ which uses MPI for deployment in |
| 170 |
batch settings |
| 171 |
|
| 172 |
For more information see :doc:`deploying-hpc` |
| 173 |
|
| 174 |
3. **Kubernetes/Cloud**: Newer clusters may employ Kubernetes for deployment. |
| 175 |
This is particularly commonly used today on major cloud providers, |
| 176 |
all of which provide hosted Kubernetes as a service. People today use Dask |
| 177 |
on Kubernetes using either of the following: |
| 178 |
|
| 179 |
- **Helm**: an easy way to stand up a long-running Dask cluster and |
| 180 |
Jupyter notebook |
| 181 |
|
| 182 |
- **Dask-Kubernetes**: for native Kubernetes integration for fast moving |
| 183 |
or ephemeral deployments. |
| 184 |
|
| 185 |
For more information see :doc:`deploying-kubernetes` |
| 186 |
|
| 187 |
4. **Commercial Dask deployment:** |
| 188 |
|
| 189 |
- You can use `Coiled <https://coiled.io?utm_source=dask-docs&utm_medium=faq>`_ to handle the creation and management of Dask clusters on cloud computing environments (AWS and GCP). |
| 190 |
- `Domino Data Lab <https://www.dominodatalab.com/>`_ Lets users create Dask clusters in a hosted platform. |
| 191 |
- `Saturn Cloud <https://saturncloud.io/>`_ Lets users create Dask clusters in a hosted platform or within their own AWS accounts. |
| 192 |
|
| 193 |
|
| 194 |
Is Dask secure? |
| 195 |
~~~~~~~~~~~~~~~ |
| 196 |
|
| 197 |
Dask is deployed today within highly secure institutions, |
| 198 |
including major financial, healthcare, and government agencies. |
| 199 |
|
| 200 |
That being said it's worth noting that, by its very nature, Dask enables the |
| 201 |
execution of arbitrary user code on a large set of machines. Care should be |
| 202 |
taken to isolate, authenticate, and govern access to these machines. Fortunately, |
| 203 |
your institution likely already does this and uses standard technologies like |
| 204 |
SSL/TLS, Kerberos, and other systems with which Dask can integrate. |
| 205 |
|
| 206 |
|
| 207 |
Do I need to purchase a new cluster? |
| 208 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 209 |
|
| 210 |
No. It is easy to run Dask today on most clusters. |
| 211 |
If you have a pre-existing HPC or Spark/Hadoop cluster then that will be fine |
| 212 |
to start running Dask. |
| 213 |
|
| 214 |
You can start using Dask without any capital expenditure. |
| 215 |
|
| 216 |
|
| 217 |
How do I manage users? |
| 218 |
~~~~~~~~~~~~~~~~~~~~~~ |
| 219 |
|
| 220 |
Dask doesn't manage users, you likely have existing systems that do this well. |
| 221 |
In a large institutional setting we assume that you already have a resource |
| 222 |
manager like Yarn (Hadoop), Kubernetes, or PBS/SLURM/SGE/LSF/..., each of which |
| 223 |
have excellent user management capabilities, which are likely preferred by your |
| 224 |
IT department anyway. |
| 225 |
|
| 226 |
Dask is designed to operate with user-level permissions, which means that |
| 227 |
your data science users should be able to ask those systems mentioned above for |
| 228 |
resources, and have their processes tracked accordingly. |
| 229 |
|
| 230 |
However, there are institutions where analyst-level users aren't given direct access to |
| 231 |
the cluster. This is particularly common in Cloudera/Hortonworks Hadoop/Spark deployments. |
| 232 |
In these cases some level of explicit indirection may be required. For this, we |
| 233 |
recommend the `Dask Gateway project <https://gateway.dask.org>`_, which uses IT-level |
| 234 |
permissions to properly route authenticated users into secure resources. |
| 235 |
|
| 236 |
You may also want to consider a managed cluster solution (see :ref:`managed-cluster-solutions`). |
| 237 |
|
| 238 |
|
| 239 |
How do I manage software environments? |
| 240 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 241 |
|
| 242 |
This depends on your cluster resource manager: |
| 243 |
|
| 244 |
- Most HPC users use their network file system |
| 245 |
- Hadoop/Spark/Yarn users package their environment into a tarball and ship it |
| 246 |
around with HDFS (Dask-Yarn integrates with `Conda Pack |
| 247 |
<https://conda.github.io/conda-pack/>`_ for this capability) |
| 248 |
- Kubernetes or Cloud users use Docker images |
| 249 |
|
| 250 |
In each case Dask integrates with existing processes and technologies |
| 251 |
that are well understood and familiar to the institution. |
| 252 |
|
| 253 |
|
| 254 |
How does Dask communicate data between machines? |
| 255 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 256 |
|
| 257 |
Dask usually communicates over TCP, using msgpack for small administrative |
| 258 |
messages, and its own protocol for efficiently passing around large data. |
| 259 |
The scheduler and each worker host their own TCP server, making Dask a |
| 260 |
distributed peer-to-peer network that uses point-to-point communication. |
| 261 |
We do not use Spark-style shuffle systems. We do not use MPI-style |
| 262 |
collectives. Everything is direct point-to-point. |
| 263 |
|
| 264 |
For high performance networks you can use either TCP-over-Infiniband for about |
| 265 |
1 GB/s bandwidth, or UCX (experimental) for full speed communication. |
| 266 |
|
| 267 |
|
| 268 |
Are deployments long running, or ephemeral? |
| 269 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 270 |
|
| 271 |
We see both, but ephemeral deployments are more common. |
| 272 |
|
| 273 |
Most Dask use today is about enabling data science or data engineering users to |
| 274 |
scale their interactive workloads across the cluster. |
| 275 |
These are typically either interactive sessions with Jupyter, or batch scripts |
| 276 |
that run at a pre-defined time. In both cases, the user asks the resource |
| 277 |
manager for a bunch of machines, does some work, and then gives up those |
| 278 |
machines. |
| 279 |
|
| 280 |
Some institutions also use Dask in an always-on fashion, either handling |
| 281 |
real-time traffic in a scalable way, or responding to a broad set of |
| 282 |
interactive users with large datasets that it keeps resident in memory. |
| 283 |
|
| 284 |
|
| 285 |
For Users |
| 286 |
--------- |
| 287 |
|
| 288 |
Will Dask "just work" on our existing code? |
| 289 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 290 |
|
| 291 |
No, you will need to make modifications, |
| 292 |
but these modifications are usually small. |
| 293 |
|
| 294 |
The vast majority of lines of business logic within your institution |
| 295 |
will not have to change, assuming that they are in Python and use tooling like |
| 296 |
Numpy, Pandas and Scikit-Learn. |
| 297 |
|
| 298 |
How well does Dask scale? What are Dask's limitations? |
| 299 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 300 |
|
| 301 |
The largest Dask deployments that we see today are on around 1000 multi-core |
| 302 |
machines, perhaps 20,000 cores in total, but these are rare. |
| 303 |
Most institutional-level problems (1-100 TB) are well solved by deployments of 10-50 nodes. |
| 304 |
|
| 305 |
Technically, the back-of-the-envelope number to keep in mind is that each task |
| 306 |
(an individual Python function call) in Dask has an overhead of around *200 |
| 307 |
microseconds*. So if these tasks take 1 second each, then Dask can saturate |
| 308 |
around 5000 cores before scheduling overhead dominates costs. As workloads |
| 309 |
reach this limit they are encouraged to use larger chunk sizes to compensate. |
| 310 |
The *vast majority* of institutional users though do not reach this limit. |
| 311 |
For more information you may want to peruse our :doc:`best practices |
| 312 |
<best-practices>` |
| 313 |
|
| 314 |
Is Dask resilient? What happens when a machine goes down? |
| 315 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 316 |
|
| 317 |
Yes, Dask is resilient to the failure of worker nodes. It knows how it came to |
| 318 |
any result, and can replay the necessary work on other machines if one goes |
| 319 |
down. |
| 320 |
|
| 321 |
If Dask's centralized scheduler goes down then you would need to resubmit the |
| 322 |
computation. This is a fairly standard level of resiliency today, shared with |
| 323 |
other tooling like Apache Spark, Flink, and others. |
| 324 |
|
| 325 |
The resource managers that host Dask, like Yarn or Kubernetes, typically |
| 326 |
provide long-term 24/7 resilience for always-on operation. |
| 327 |
|
| 328 |
Is the API exactly the same as NumPy/Pandas/Scikit-Learn? |
| 329 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 330 |
|
| 331 |
No, but it's very close. That being said your data scientists will still |
| 332 |
have to learn some things. |
| 333 |
|
| 334 |
What we find is that the Numpy/Pandas/Scikit-Learn APIs aren't the challenge |
| 335 |
when institutions adopt Dask. When API inconsistencies do exist, even |
| 336 |
modestly skilled programmers are able to understand why and work around them |
| 337 |
without much pain. |
| 338 |
|
| 339 |
Instead, the challenge is building intuition around parallel performance. |
| 340 |
We've all built up a mental model for what is fast and slow on a single |
| 341 |
machine. This model changes when we factor in network communication and |
| 342 |
parallel algorithms, and the performance that we get for familiar operations |
| 343 |
can be surprising. |
| 344 |
|
| 345 |
Our main solution to build this intuition, other than |
| 346 |
accumulated experience, is Dask's :doc:`Diagnostic Dashboard |
| 347 |
<dashboard>`. |
| 348 |
The dashboard delivers a ton of visual feedback to users as they are running |
| 349 |
their computation to help them understand what is going on. This both helps |
| 350 |
them to identify and resolve immediate bottlenecks, and also builds up that |
| 351 |
parallel performance intuition surprisingly quickly. |
| 352 |
|
| 353 |
|
| 354 |
How much performance tuning does Dask require? |
| 355 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 356 |
|
| 357 |
*Some other systems are notoriously hard to tune for optimal performance. |
| 358 |
What is Dask's story here? How many knobs are there that we need to be aware |
| 359 |
of?* |
| 360 |
|
| 361 |
Like the rest of the Python software tools, Dask puts a lot of effort into |
| 362 |
having sane defaults. Dask workers automatically detect available memory and |
| 363 |
cores, and choose sensible defaults that are decent in most situations. Dask |
| 364 |
algorithms similarly provide decent choices by default, and informative warnings |
| 365 |
when tricky situations arise, so that, in common cases, things should be fine. |
| 366 |
|
| 367 |
The most common knobs to tune include the following: |
| 368 |
|
| 369 |
- The thread/process mixture to deal with GIL-holding computations (which are |
| 370 |
rare in Numpy/Pandas/Scikit-Learn workflows) |
| 371 |
- Partition size, like if should you have 100 MB chunks or 1 GB chunks |
| 372 |
|
| 373 |
That being said, almost no institution's needs are met entirely by the common |
| 374 |
case, and given the variety of problems that people throw at Dask, |
| 375 |
exceptional problems are commonplace. |
| 376 |
In these cases we recommend watching the dashboard during execution to see what |
| 377 |
is going on. It can commonly inform you what's going wrong, so that you can |
| 378 |
make changes to your system. |
| 379 |
|
| 380 |
|
| 381 |
What Data formats does Dask support? |
| 382 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 383 |
|
| 384 |
Because Dask builds on NumPy and Pandas, it supports most formats that they |
| 385 |
support, which is most formats. |
| 386 |
That being said, not all formats are well suited for |
| 387 |
parallel access. In general people using the following formats are usually |
| 388 |
pretty happy: |
| 389 |
|
| 390 |
- **Tabular:** Parquet, ORC, CSV, Line Delimited JSON, Avro, text |
| 391 |
- **Arrays:** HDF5, NetCDF, Zarr, GRIB |
| 392 |
|
| 393 |
More generally, if you have a Python function that turns a chunk of your stored |
| 394 |
data into a Pandas dataframe or Numpy array then Dask can probably call that |
| 395 |
function many times without much effort. |
| 396 |
|
| 397 |
For groups looking for advice on which formats to use, we recommend Parquet |
| 398 |
for tables and Zarr or HDF5 for arrays. |
| 399 |
|
| 400 |
|
| 401 |
Does Dask have a SQL interface? |
| 402 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 403 |
|
| 404 |
Dask supports various ways to communicate with SQL databases, some |
| 405 |
requiring extra packages to be installed; see the section |
| 406 |
:doc:`dataframe-sql`. |
| 407 |
|
| 408 |
|
| 409 |
Does Dask work on GPUs? |
| 410 |
~~~~~~~~~~~~~~~~~~~~~~~ |
| 411 |
|
| 412 |
Yes! Dask works with GPUs in a few ways. |
| 413 |
|
| 414 |
The `RAPIDS <https://rapids.ai>`_ libraries provide a GPU-accelerated |
| 415 |
Pandas-like library, |
| 416 |
`cuDF <https://github.com/rapidsai/cudf>`_, |
| 417 |
which interoperates well and is tested against Dask DataFrame. |
| 418 |
|
| 419 |
`Chainer's CuPy <https://cupy.chainer.org/>`_ library provides a GPU |
| 420 |
accelerated NumPy-like library that interoperates nicely with Dask Array. |
| 421 |
|
| 422 |
For custom workflows people use Dask alongside GPU-accelerated libraries like PyTorch and |
| 423 |
TensorFlow to manage workloads across several machines. They typically use |
| 424 |
Dask's custom APIs, notably :doc:`Delayed <delayed>` and :doc:`Futures |
| 425 |
<futures>`. |
| 426 |
|
| 427 |
See the section :doc:`gpu`. |
| 428 |
|
| 429 |
For Marketing |
| 430 |
------------- |
| 431 |
|
| 432 |
There is a special subsite dedicated to addressing marketing concerns. You can |
| 433 |
find it at `dask.org/brand-guide <https://dask.org/brand-guide>`_. |
| 434 |
|
| 435 |
Where can I find logos? |
| 436 |
~~~~~~~~~~~~~~~~~~~~~~~ |
| 437 |
|
| 438 |
Yes! You can find them at :doc:`logos`. |