You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes#6403
This project publishes a conda package, `cuml-cpu`, which does what it sounds like... allows the use of cuML on systems without a GPU.
This proposes some updates to packaging for `cuml-cpu`:
* fixes importing in CPU-only environment (broken in 25.04, see #6403)
* enables import tests during conda builds, to reduce the risk of such issues going undetected in the future
## Notes for Reviewers
### Why all these changes in Python code?
See some of the challenges I faced documented in #6400 (comment).
In short, `import cuml` when it was installed via `cuml-cpu` will break at import time whenever modules imported with `cuml.internals.safe_imports.gpu_only_import()` are used in any of the following ways:
* type hints
* decorators
* any other module-level direct use
Like this:
```text
cuml.internals.safe_imports.UnavailableError: cudf is not installed in non GPU-enabled installations
```
### How long has this been broken? What's the root cause?
It seems like something changed within 25.04... earlier versions of cuML are not affected by these issues: #6403 (comment)
I don't know what the root cause is. Maybe some changes to `cuml`'s top-level imports in 25.04 is now pulling in the modules with these problems at runtime, when previously it wasn't? I'm really not sure.
### Benefits of these Changes
This adds a bit of test coverage in CI, minimally verifying that `cuml-cpu` is installable and that `import cuml` works in an environment without a GPU.
Inspired by:
* similar changes in `cuvs`: rapidsai/cuvs#750
* this conversation I recently had with @betatim : rapidsai/cuvs#743 (comment)
### How I tested this
Saw stuff like this in `conda-python-build` jobs, confirming that the import tests were running and passing:
```text
BUILD START: ['cuml-cpu-25.04.00a137-py310_250312_g153b21870_137.conda']
...
import: 'cuml'
...
Resource usage statistics from testing cuml-cpu:
...
Time elapsed: 0:00:10.0
...
TEST END: /tmp/conda-bld-output/linux-64/cuml-cpu-25.04.00a137-py310_250312_g153b21870_137.conda
```
Authors:
- James Lamb (https://github.com/jameslamb)
Approvers:
- Gil Forsyth (https://github.com/gforsyth)
- Simon Adorf (https://github.com/csadorf)
- Tim Head (https://github.com/betatim)
URL: #6400
0 commit comments