dask / dask/dask-image

Make rotate function compatible with cupy

Open
#414 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
226
Forks
56
PR merge metrics
No merged PRs in 30d

Description

The `dask_image.ndinterp.rotate` function currently supports numpy backed dask arrays, but not cupy GPU arrays. It would be nice to extend the functionality to add GPU support.

**Suggested approach:**
One way to approach this could be to:
1. Try and split out the sub-section of the `rotate` function that makes the rotation matrix, and put this into a separate helper function (i.e. group all the numpy specific lines of code together, while keeping the function as small as possible to reduce code duplication later).
2. Make a second version of the helper function using cupy/cupyx functions replacing all the lines that call numpy directly.
3. Then we could use the same dispatch mechanism as we do with the other modules (see the dask_image/dispatch folder) to register our new numpy and cupy versions.
4. Add a test for the new functionality
5. Update the `coverage.rst` table, adding a tick mark to indicate this function now has GPU support

Contributor guide

Open the contributing guide

Research direction

Start with dask_image.ndinterp.rotate and inspect the existing dispatch implementations under dask_image/dispatch. Separate the rotation-matrix logic, provide NumPy and CuPy-backed paths through the established dispatch mechanism, and add a test demonstrating GPU-array support. Update coverage.rst so the rotate function is marked as GPU-supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.