Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dask chunking tutorial outline #157

Open
dcherian opened this issue Jan 31, 2023 · 3 comments
Open

dask chunking tutorial outline #157

dcherian opened this issue Jan 31, 2023 · 3 comments

Comments

@dcherian
Copy link
Contributor

dcherian commented Jan 31, 2023

from the pangeo working meeting discussion with @mgrover1 @jmunroe @norlandrhagen

Here's an outline for an intermediate tutorial talking about dask chunking specifically for Xarray users


Motivation: why care about chunk size?

Keeping track

  • monitoring chunk sizes and num tasks throughout the pipeline using the repr
    • use some images
  • while output blocks may be small (say after a big reduction), intermediate blocks need not be.
  • So keep monitoring chunksizes (and tasks) throughout the pipeline.

Why is it important to choose appropriate chunks early in the pipeline?

  • Demonstrate that rechunking is not cheap in most cases

Specify chunks when reading data

  1. Avoid chunks="auto".
  2. Specifying chunks during data read
    • open_dataset
    • open_mfdataset
  3. Analysis vs storage chunks:
    • Dask chunks should be a multiple of chunks on disk
    • talk about aligning chunks with files stored on disk
    • @djhoese example
@scottyhq
Copy link
Contributor

Agreed this would be great to document thoroughly. See also this relevant issue + discussion in rioxarray corteva/rioxarray#253

@djhoese
Copy link

djhoese commented Feb 1, 2023

demonstrate relation between chunk size and computation time / number of tasks with a simple example?

  • maybe even memory usage

This would be huge! This comes up often in Satpy where users want to process satellite images on their local machine but they only have 8GB or 16GB of memory. If someone can make a good diagram showing chunks being processed by a worker thread/process and how changing the size of all chunks or number of workers contributes to the overall memory usage that would be such a help when explaining this to users.

@dcherian
Copy link
Contributor Author

dcherian commented Feb 2, 2023

forgot to cc @rybchuk!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants