Fixes #906: fill remaining dask+cupy gaps (terrain, perlin, crosstab)#913
Merged
brendancol merged 4 commits intomasterfrom Feb 27, 2026
Merged
Fixes #906: fill remaining dask+cupy gaps (terrain, perlin, crosstab)#913brendancol merged 4 commits intomasterfrom
brendancol merged 4 commits intomasterfrom
Conversation
Add missing dask+cupy backends for perlin() and generate_terrain() using per-chunk GPU kernel launches via da.map_blocks with block_info coordinate mapping. Add cupy and dask+cupy backends for crosstab() by converting to numpy/dask+numpy and delegating. Fix _find_cats() to handle pure cupy arrays without wrapping in @delayed.
- Terrain Generation, Perlin Noise: mark dask+cupy as ✅ (native) - Zonal Cross Tabulate: mark cupy and dask+cupy as 🔄 (CPU fallback) - Zonal Statistics: mark cupy as ✅ (native), dask+cupy as 🔄 (fallback) - Apply: mark cupy and dask+cupy as 🔄 (CPU fallback)
Both functions only need numpy for the boundary scan; the output is a slice of the original DataArray, so the backend is preserved. Convert to numpy for the scan, then slice the original raster. Update README feature matrix for trim and crop.
JIT-compile the user's scalar function as a CUDA device function and run it inside a CUDA kernel, avoiding the GPU→CPU→GPU round-trip. Non-compilable functions (e.g. using dict, str) automatically fall back to the existing CPU path via exception handling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
perlin()— launches_perlin_gpukernel per chunk with coordinate ranges computed fromblock_infogenerate_terrain()— same per-chunk GPU kernel approach across 16 noise layerscrosstab()— converts to numpy/dask+numpy and delegates (output is a DataFrame, no GPU advantage in aggregation)_find_cats()to handle pure cupy arrays without wrapping in@delayedCloses #906
Test plan
test_dask_cupy_gaps.py: perlin dask+cupy, terrain dask+cupy, crosstab cupy, crosstab dask+cupy