Skip to content

test: add Dask chunk grid benchmark scaffold#2465

Draft
ehsanestaji wants to merge 2 commits into
scverse:mainfrom
ehsanestaji:explore/anndata-2036-dask-chunk-defaults
Draft

test: add Dask chunk grid benchmark scaffold#2465
ehsanestaji wants to merge 2 commits into
scverse:mainfrom
ehsanestaji:explore/anndata-2036-dask-chunk-defaults

Conversation

@ehsanestaji
Copy link
Copy Markdown

Summary

This adds an exploratory benchmark scaffold for #2036 so we can compare virtual Dask chunk choices against HDF5/Zarr on-disk chunk layouts before changing AnnData defaults.

The benchmark runner:

  • creates dense X arrays with controlled HDF5/Zarr chunks and optional Zarr v3 shards
  • reads X lazily through anndata.experimental.read_elem_lazy
  • varies virtual Dask chunks, worker counts, and thread/process settings
  • records runtime/package metadata, store size, task count, elapsed time, result shape/size, and coarse process/worker RSS readings
  • includes array-level workloads and a Scanpy-style scanpy_normalize_log1p workload

This also adds a small notebook for summarizing the generated CSV and README instructions for smoke/larger-grid runs. Generated benchmark outputs are ignored under benchmarks/results.

Local signal

A modest local grid (3000x800, HDF5/Zarr, on-disk chunks 250x800 and 1000x800, default vs 1000x-1, 1/2 workers, sum_axis0 and scanpy_normalize_log1p) produced 32 rows. For small on-disk chunks (250x800), 1000x-1 reduced task counts and improved timings in the 1-worker Scanpy-style case by about 1.16x for HDF5 and 1.26x for Zarr.

These numbers are only an initial local smoke signal; the intent is to make the benchmark/review path available before proposing default behavior changes.

Checks

  • ruff check benchmarks/scripts/dask_chunk_grid.py tests/test_dask_chunk_grid_script.py
  • .venv/bin/python -m pytest tests/test_dask_chunk_grid_script.py -q
  • python3 -m json.tool benchmarks/notebooks/dask_chunk_grid_analysis.ipynb
  • git diff --check
  • tiny end-to-end benchmark smoke run wrote 8 CSV result rows

@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.60%. Comparing base (829abb6) to head (95bf7a1).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2465   +/-   ##
=======================================
  Coverage   85.60%   85.60%           
=======================================
  Files          49       49           
  Lines        7671     7671           
=======================================
  Hits         6567     6567           
  Misses       1104     1104           

@ehsanestaji ehsanestaji changed the title Benchmarks for Dask chunk default tradeoffs test: add Dask chunk grid benchmark scaffold May 21, 2026
@ehsanestaji
Copy link
Copy Markdown
Author

I updated the title to a semantic PR title. I don’t seem to have permission to add labels on this repo, but the current validation failures look like triage metadata rather than code failures. Could a maintainer please add the appropriate labels, likely no milestone and skip-gpu-ci? benchmark, type: dask array, and performance 🐌 may also fit this benchmark-only PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants