Skip to content

Have cu12/cu13 extras depend on cuda-core extra - #457

Open
TomAugspurger wants to merge 1 commit into
NVIDIA:mainfrom
TomAugspurger:tom/deps
Open

TomAugspurger wants to merge 1 commit into
NVIDIA:mainfrom
TomAugspurger:tom/deps

Conversation

@TomAugspurger

@TomAugspurger TomAugspurger commented Nov 12, 2026 •

Copy link
Copy Markdown

This updates our cu12 / cu13 extras in pyproject.toml to depend on cuda-core[cu-version]. This will ensure that the environment solves correctly, avoiding the runtime error from
#456.

With this change, we solve for an older version of cuda-core that's compatible with the user-supplied cuda-bindings:

❯ uv pip install --python .venv/bin/python --dry-run '.[cu12]' 'cuda-bindings==12.9.3'
Resolved 11 packages in 993ms
Would download 1 package
Would uninstall 2 packages
Would install 8 packages
 - cuda-core==1.3.0
 + cuda-core==1.2.2
 + cuda-toolkit==12.9.2.0
 - numba-cuda-mlir==0.6.0
 + numba-cuda-mlir @ file:///raid/toaugspurger/gh/rapidsai/numba-cuda-mlir
 + nvidia-cuda-nvcc-cu12==12.9.86
 + nvidia-cuda-nvrtc-cu12==12.9.86
 + nvidia-cuda-runtime-cu12==12.9.79
 + nvidia-cufile-cu12==1.14.1.1
 + nvidia-nvjitlink-cu12==12.9.86

(this env already had some stuff in it, so the removed packages can be ignored. The main thing is that it correctly solves for cuda-core==1.2.2 given the cuda-bindings==12.9.3 constraint)

This updates our cu12 / cu13 extras in pyproject.toml to depend on
`cuda-core[cu-version]`. This will ensure that the environment solves
correctly, avoiding the runtime error from
NVIDIA#456.
@copy-pr-bot

copy-pr-bot Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

important: The cu12 and cu13 optional dependency groups now include matching cuda-core extras, each constrained to >=0.5.1,<2.0.0.

Changes: CUDA optional dependencies

Layer / File(s) Summary
Add CUDA-specific cuda-core extras
pyproject.toml
The cu12 and cu13 groups add cuda-core[cu12] and cuda-core[cu13], respectively. Both use the version constraint >=0.5.1,<2.0.0.

Possibly related issues

  • NVIDIA/numba-cuda-mlir#456: The issue reports an invalid cuda-core/cuda-bindings pair from the cu12 extra. This change adds a matching CUDA extra to cuda-core; the provided summary reports a successful dependency-resolution dry run but no runtime check.

Suggested reviewers: atmnp, brandon-b-miller

Change: Bug fix

Merge Risk: Minimal · up to 8db66

Installing the CUDA 12 or CUDA 13 extra now also selects the matching cuda-core variant, which lets the resolver pick a version compatible with the user's cuda-bindings. No actionable merge risk remains.

Architecture risk: Low · up to 8db66

The change affects 1 system.

Changed systems: pyproject.toml

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — pyproject.toml (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in pyproject.toml: The cu12 extra adds cuda-core[cu12]>=0.5.1,<2.0.0.
  • observed — Modified behavior in pyproject.toml: The cu13 extra adds cuda-core[cu13]>=0.5.1,<2.0.0.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between d1862d3 and 8db66fe.

Files selected for processing: 1

  • pyproject.toml

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.

@brandon-b-miller

Copy link
Copy Markdown
Collaborator

/ok to test

@github-actions

Copy link
Copy Markdown
Doc Preview CI

🚀 View preview at
https://nvidia.github.io/numba-cuda-mlir/pr-preview/pr-457/


Preview will be ready when the GitHub Pages deployment is complete.

Comment thread pyproject.toml
[project.optional-dependencies]
cu12 = [
"cuda-bindings>=12.9.1,<13.0.0",
"cuda-core[cu12]>=0.5.1,<2.0.0",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why we must add cu12 (and same for cu13) extra? We did not design to require this and the same cuda-core should work in both cases.

Also, this brings in a lot of dependencies that do not concern with numba-cuda-mlir users.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this brings in a lot of dependencies that do not concern with numba-cuda-mlir users

There's already a dependency on cuda-core at
https://github.com/NVIDIA/numba-cuda-mlir/pull/457/changes#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711R27, it's just un-suffixed. Do the cu12/cu13 extras bring in additional dependencies?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why we must add cu12 (and same for cu13) extra?

https://github.com/NVIDIA/cuda-python/blob/303fbdace238303d9f3e0b43d246dde161e6b577/cuda_core/pyproject.toml#L63-L64

That's where cuda-core expresses it's lower bound on cuda-bindings. Without this, the solver allows cuda-bindings==12.9.3, which isn't allowed for the latest cuda-core so you get the error at runtime.

@TomAugspurger TomAugspurger Nov 12, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the cu12/cu13 extras bring in additional dependencies?

Oh maybe through the [all]? Hmm... That's unfortunate (for downstream users like cudf. Makes sense for cuda-core).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Many of them are not required by numba-cuda-mlir, e.g. cuFile and nvFatBin. I am not sure what is breaking here since as you noted we do already include cuda-core as a required dependency.

FWIW, starting cuda-core v1.3.0 we set a floor policy for cuda-bindings: NVIDIA/cuda-python#2783. Is this what's bothering RAPIDS? The suggestion is to not pin cuda-bindings version and let cuda-core decide https://nvidia.github.io/cuda-python/cuda-core/latest/support.html#cuda-bindings-version-requirements

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is coming from cudf: NVIDIA/cudf#25224

I think that "let cuda-core figure it out" won't work for us since we don't depend on cuda-core, just cuda-bindings (https://github.com/NVIDIA/cudf/blob/61680dbc9df47f517a63529c95e1537eaebb57f2/dependencies.yaml). We only get cuda-core transitively through packages like numba-cuda-mlir.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leofang is this expected behavior?

$ pip install "cuda-core==1.3.0" "cuda-bindings==12.9.3"
# exit 0
>>> import cuda.core
# ImportError: cuda.core 1.3.0 requires cuda-bindings >= 12.9.8 for CUDA 12,
# but cuda-bindings 12.9.3 is installed.

@TomAugspurger TomAugspurger Nov 12, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that has to be the behavior with how things are set up today (a single package using extras for the cu12/cu13 split). This makes pip install cuda-core (unsuffixed) somewhat dangerous for cuda12. But if you "correctly" express a dependency on cuda-core[cu12] you get the right error:

❯ uv pip install "cuda-core[cu12]==1.3.0" "cuda-bindings==12.9.3" --dry-run
error: No solution found when resolving dependencies
  cause: Because cuda-core[cu12]>=1.3.0 depends on cuda-bindings[all]>=12.9.8,<13 and you require cuda-core[cu12]==1.3.0, we can conclude that you require cuda-bindings>=12.9.8,<13.
         And because you require cuda-bindings==12.9.3, we can conclude that your requirements are unsatisfiable.

So in general, I think numba-cuda-mlir should only have cu12/cu13 dependencies in its cu12/cu13 dependencies.

It does seem like we'd need some other extra (cuda-core[cu12-core] 😆) to avoid the extra packages brought in by cuda-core[cu12] bringing in cuda-bindings[all].

@csadorf csadorf Nov 12, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why we must add cu12 (and same for cu13) extra? We did not design to require this and the same cuda-core should work in both cases.

@leofang Then why do the cuda-core docs explicitly advise this approach?

@TomAugspurger TomAugspurger mentioned this pull request Nov 12, 2026
3 tasks done
rapids-bot Bot pushed a commit to NVIDIA/cudf that referenced this pull request Nov 12, 2026
This fixes two packaging / dependency issues currently affecting cudf's CI

1. the cudf.pandas (and pylibcudf?) oldest-dependency jobs pin `cuda-bindings==12.9.3`. A dependency on `numba-cuda-mlir` brings in a dependency on `cuda-core`, which currently resolves to `cuda-core==1.3.0` which is incompatible with `cuda-bindings<12.9.8`. NVIDIA/numba-cuda-mlir#457 attempts to fix this upstream, but that requires more work. For now, I've updated our commands that install `cuda-bindings` to *also* install `cuda-core[cu12]`. This will ensure that its `cuda-bindings` pin is honored: https://github.com/NVIDIA/cuda-python/blob/e119c3143a8cab7a2af9c600098d9c7192271d95/cuda_core/pyproject.toml#L63.
2. Similar issue for the upstream polars test environments, but this time from `torch`. Our current method of making the upstream polars test environment has some issues. 282554a has the start of a proper fix, but still needs work  to fit with how cudf-polars/polars/torch declare their dependencies.


For now, I'm comfortable with skipping the torch tests from polars' test suite. We have the `conda-python-cudf-polars-tests-integration-optional` that should still give us some coverage for that cudf-polars/torch interop.

Closes #25224.

Authors:
  - Tom Augspurger (https://github.com/TomAugspurger)
  - James Lamb (https://github.com/jameslamb)

Approvers:
  - James Lamb (https://github.com/jameslamb)

URL: #25227
TomAugspurger added a commit to TomAugspurger/pygdf that referenced this pull request Nov 12, 2026
This updates our package metadata to express our dependency on
cuda-core.

1. cudf and pylibucdf don't directly use cuda-core, but they do
   need a cuda-core that's compatible with the installed cuda-bindings
   thanks to a transitive cuda-core dependency via numba-cuda-mlir.
   NVIDIA/numba-cuda-mlir#457 should fix
   things upstream. In the meantime, we've added that to the `test`
   dependency
2. cudf-polars imports cuda-core, and so should express a dependency
   on it in the package metadata.
rapids-bot Bot pushed a commit to NVIDIA/cudf that referenced this pull request Nov 13, 2026
This updates our package metadata to express our dependency on cuda-core and cuda-bindings.

### cudf/pylibucdf

cudf and pylibcudf don't directly use cuda-core, but they do need a cuda-core that's compatible with the installed cuda-bindings thanks to a transitive cuda-core dependency via numba-cuda-mlir. Currently, installing numba-cuda-mlir and our pinned `cuda-bindings==12.8.3` results in an environment that breaks at runtime.

#25227 added workarounds at our install sites. @jameslamb expressed a preference to keep things centrally located in dependencies.yml. As a compromise, we've added `cuda-core[cu{12,13}]` to our `test` dependency.

NVIDIA/numba-cuda-mlir#457 (or something like it) should fix things upstream, at which point we can remove this (test) dependency.

### cudf-polars

cudf-polars imports cuda-core, and so should express a dependency on it in the package metadata.

Authors:
  - Tom Augspurger (https://github.com/TomAugspurger)
  - James Lamb (https://github.com/jameslamb)

Approvers:
  - James Lamb (https://github.com/jameslamb)
  - Bradley Dice (https://github.com/bdice)

URL: #25240

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants