Cover the dask+cupy combined read backend (#1543)#1545
Open
brendancol wants to merge 1 commit intomainfrom
Open
Cover the dask+cupy combined read backend (#1543)#1545brendancol wants to merge 1 commit intomainfrom
brendancol wants to merge 1 commit intomainfrom
Conversation
`open_geotiff(gpu=True, chunks=N)` and `read_geotiff_gpu(chunks=N)` had no tests despite both docstrings advertising them as the "out-of-core GPU" path. The chunk-wrap step that produces a Dask array with a CuPy `_meta` was unverified, so a refactor that swapped the meta to NumPy or dropped the chunk call would not have failed any existing test. Five tests cover: - single-band int chunks - read_geotiff_gpu with tuple chunks - 3-band tiled raster - partial last chunk (image not divisible by chunks) - CRS / transform / coord preservation Tests skip cleanly when CuPy or CUDA are unavailable.
There was a problem hiding this comment.
Pull request overview
Adds test coverage for the “Dask+CuPy combined” GeoTIFF read path (open_geotiff(..., gpu=True, chunks=...) / read_geotiff_gpu(..., chunks=...)) to prevent silent regressions in the lazy-on-GPU contract described in the docstrings.
Changes:
- Introduces a new GPU-only pytest module with round-trip tests validating Dask wrapping, CuPy
_meta, chunk shapes, device-backed compute results, and pixel/geo-attr parity vs eager CPU reads. - Updates the internal
.claudesweep tracking CSV to record inspection status for the geotiff test-coverage gap.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
xrspatial/geotiff/tests/test_dask_cupy_combined.py |
New GPU-only test module covering the combined Dask+CuPy read backend behavior and invariants. |
.claude/sweep-test-coverage-state.csv |
Updates coverage sweep tracking state to reflect addressing issue #1543. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+24
to
+25
| import os | ||
| import tempfile |
Comment on lines
+77
to
+82
| # After compute the result is still a cupy array, not numpy. | ||
| computed = da_arr.compute() | ||
| assert isinstance(computed.data, cupy.ndarray), ( | ||
| f"compute() returned {type(computed.data).__name__} " | ||
| "(should stay on device)" | ||
| ) |
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.
Closes #1543.
Summary
open_geotiff(gpu=True, chunks=N)andread_geotiff_gpu(chunks=N)advertise an "out-of-core GPU" path in their docstrings but had zero testsxrspatial/geotiff/tests/test_dask_cupy_combined.pywith five round-trip tests that pin the contract (Dask wrapper, CuPy_meta, requested chunk shape, post-compute device memory, pixel equality with eager numpy read, geo-attr preservation)Test plan
python -m pytest xrspatial/geotiff/tests/test_dask_cupy_combined.py -v-- 5 passedpython -m pytest xrspatial/geotiff/tests/ -q(excluding pre-existing unrelatedTestPalettematplotlib/Python 3.14 deepcopy failures) -- 941 passed