← Back to Pull requests

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

Merged
TomAugspurger merged 1 files (2 lines) on Nov 16, 2026 13:50 UTC
View on GitHub
TomAugspurger TomAugspurger commented on Nov 12, 2026 15:57 UTC
Author

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
https://github.com/NVIDIA/numba-cuda-mlir/issues/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)

Diff: 2 lines (+2 / -0) across 1 files Reviewer: leofang Review duration: 5632m
All Vouch review confidence checks passed
Residual risk 0.02 = Change Risk (0.10) × (1 − Review Confidence (0.77)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.10 · 2 lines diff across 1 files
0.10
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.55 · 5 substantive comment(s)
0.55
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
76%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.066
Real PR Conversation Timeline
19 items
copy-pr-bot[bot] copy-pr-bot[bot] commented on Nov 12, 2026 15:57 UTC
Bot

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[bot] coderabbitai[bot] commented on Nov 12, 2026 16:00 UTC
Bot

<!-- coderabbit-ai-generated:v1 -->

<!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- review_stack_entry_start -->

<a href="https://app.coderabbit.ai/change-stack/NVIDIA/numba-cuda-mlir/pull/457?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg" alt="Explain Change →" height="32"></picture></a>

<!-- review_stack_entry_end -->
<!-- recent_review_status_start -->

No actionable comments were generated in the recent review.

<!-- recent_review_status_end -->
<!-- walkthrough_start -->

<details>
<summary><strong>Walkthrough</strong></summary>
<dl>
<dd>
<br>

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 <br> 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

    </dd>
    </dl>
    </details>

    <!-- walkthrough_end -->
    <!-- change_assessment_start -->
    <!-- change_assessment_commit:"8db66fe05630d7961cd53a3f62fb7f3c0b54b7cb" -->
    <!-- change_assessment_priority:{"version":1,"urgency":"p2","manual":false} -->
    Change: Bug fix
    <!-- change_assessment_end -->
    <details>
    <summary><strong>Merge Risk:</strong> <strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/risk-unassessed-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minimal</strong> · up to <code>8db66</code></summary>
    <dl>
    <dd>
    <br>

    <!-- final_review_risk_start -->
    <!-- final_review_risk_label
    Merge Risk: ⚪ Minimal · up to 8db66
    -->
    <!-- final_review_risk_coverage:{"sourceCommitId":"8db66fe05630d7961cd53a3f62fb7f3c0b54b7cb","coveredCommitId":"8db66fe05630d7961cd53a3f62fb7f3c0b54b7cb","kind":"reviewed"} -->

    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.
    <!-- final_review_risk_end -->

    </dd>
    </dl>
    </details>

    <details>
    <summary><strong>Architecture risk:</strong> <strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/risk-low-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Low</strong> · up to <code>8db66</code></summary>
    <dl>
    <dd>
    <br>

    <!-- architecture_review_start -->
    <!-- architecture_review_label

    Architecture Summary

    Architecture risk: 🔵 Low · up to 8db66
    -->

    The change affects 1 system.

    Changed systems: pyproject.toml

    Architecture concerns
    No architecture-level concerns identified.

    <details>
    <summary><strong>Review details</strong></summary>
    <dl>
    <dd>
    <br>

    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.
  • </dd>
    </dl>
    </details>
    <!-- architecture_review_end -->

    </dd>
    </dl>
    </details>
    <!-- autopilot:start -->

  • <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autofix</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

  • <!-- autopilot:end -->
    <!-- recent_review_start -->

    <h6>
    <details>
    <summary><strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="12" height="12" align="absmiddle" alt=""></picture> Recent review info</strong></summary>
    <dl>
    <dd>
    <br>

    <!-- review_info_content -->
    <details>
    <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</strong></summary>
    <dl>
    <dd>
    <br>

  • Source mode: Auto

  • Repository: [NVIDIA/numba-cuda-mlir](<https://github.com/NVIDIA/numba-cuda-mlir>)

  • Branch: [main](<https://github.com/NVIDIA/numba-cuda-mlir/tree/main>)

  • File: [.coderabbit.yaml](<https://github.com/NVIDIA/numba-cuda-mlir/blob/d1862d34d7afc54d42b6900c04889c06bd9a78d2/.coderabbit.yaml>)

  • Commit: [d1862d3](<https://github.com/NVIDIA/numba-cuda-mlir/commit/d1862d34d7afc54d42b6900c04889c06bd9a78d2>)

  • Layers: Repository YAML

  • Review profile: CHILL

  • Plan: Enterprise

  • Run ID: d980f832-6068-470d-a621-606eebf4f6ee
  • </dd>
    </dl>
    </details>

    <details>
    <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</strong></summary>
    <dl>
    <dd>
    <br>

    Reviewing files that changed from the base of the PR and between d1862d34d7afc54d42b6900c04889c06bd9a78d2 and 8db66fe05630d7961cd53a3f62fb7f3c0b54b7cb.

    </dd>
    </dl>
    </details>

    <details>
    <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 1</strong></summary>
    <dl>
    <dd>
    <br>

  • pyproject.toml
  • </dd>
    </dl>
    </details>

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

    </dd>
    </dl>
    </details>
    </h6>

    <!-- recent_review_end -->

    brandon-b-miller brandon-b-miller commented on Nov 12, 2026 16:06 UTC
    Contributor

    /ok to test

    github-actions[bot] github-actions[bot] commented on Nov 12, 2026 16:15 UTC
    Bot

    Doc Preview CI
    :---:
    | <p></p> :rocket: View preview at <br> https://nvidia.github.io/numba-cuda-mlir/pr-preview/pr-457/ <br><br>
    | <h6><br> Preview will be ready when the GitHub Pages deployment is complete. <br><br></h6>
    <!-- Sticky Pull Request Commentpr-preview -->

    leofang leofang commented on code on Nov 12, 2026 16:27 UTC
    Code Review
    pyproject.toml:1
    @@ -31,6 +31,7 @@ dependencies = [
     [project.optional-dependencies]
     cu12 = [
         "cuda-bindings>=12.9.1,<13.0.0",
    +    "cuda-core[cu12]>=0.5.1,<2.0.0",

    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.

    leofang leofang requested changes on Nov 12, 2026 16:27 UTC
    Changes Requested Reviewer

    Requested changes.

    TomAugspurger TomAugspurger commented on code on Nov 12, 2026 16:28 UTC
    Code Review
    pyproject.toml:1
    @@ -31,6 +31,7 @@ dependencies = [
     [project.optional-dependencies]
     cu12 = [
         "cuda-bindings>=12.9.1,<13.0.0",
    +    "cuda-core[cu12]>=0.5.1,<2.0.0",

    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?

    TomAugspurger TomAugspurger commented on code on Nov 12, 2026 16:30 UTC
    Code Review
    pyproject.toml:1
    @@ -31,6 +31,7 @@ dependencies = [
     [project.optional-dependencies]
     cu12 = [
         "cuda-bindings>=12.9.1,<13.0.0",
    +    "cuda-core[cu12]>=0.5.1,<2.0.0",

    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 commented on code on Nov 12, 2026 16:31 UTC
    Code Review
    pyproject.toml:1
    @@ -31,6 +31,7 @@ dependencies = [
     [project.optional-dependencies]
     cu12 = [
         "cuda-bindings>=12.9.1,<13.0.0",
    +    "cuda-core[cu12]>=0.5.1,<2.0.0",

    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).

    leofang leofang commented on code on Nov 12, 2026 16:35 UTC
    Code Review
    pyproject.toml:1
    @@ -31,6 +31,7 @@ dependencies = [
     [project.optional-dependencies]
     cu12 = [
         "cuda-bindings>=12.9.1,<13.0.0",
    +    "cuda-core[cu12]>=0.5.1,<2.0.0",

    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: https://github.com/NVIDIA/cuda-python/issues/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

    TomAugspurger TomAugspurger commented on code on Nov 12, 2026 16:52 UTC
    Code Review
    pyproject.toml:1
    @@ -31,6 +31,7 @@ dependencies = [
     [project.optional-dependencies]
     cu12 = [
         "cuda-bindings>=12.9.1,<13.0.0",
    +    "cuda-core[cu12]>=0.5.1,<2.0.0",

    This is coming from cudf: https://github.com/NVIDIA/cudf/issues/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.

    brandon-b-miller brandon-b-miller commented on code on Nov 12, 2026 16:56 UTC
    Code Review
    pyproject.toml:1
    @@ -31,6 +31,7 @@ dependencies = [
     [project.optional-dependencies]
     cu12 = [
         "cuda-bindings>=12.9.1,<13.0.0",
    +    "cuda-core[cu12]>=0.5.1,<2.0.0",

    @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 commented on code on Nov 12, 2026 17:56 UTC
    Code Review
    pyproject.toml:1
    @@ -31,6 +31,7 @@ dependencies = [
     [project.optional-dependencies]
     cu12 = [
         "cuda-bindings>=12.9.1,<13.0.0",
    +    "cuda-core[cu12]>=0.5.1,<2.0.0",

    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 commented on code on Nov 12, 2026 20:03 UTC
    Code Review
    pyproject.toml:1
    @@ -31,6 +31,7 @@ dependencies = [
     [project.optional-dependencies]
     cu12 = [
         "cuda-bindings>=12.9.1,<13.0.0",
    +    "cuda-core[cu12]>=0.5.1,<2.0.0",

    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?

    leofang leofang approved these changes on Nov 13, 2026 17:53 UTC
    Approved Reviewer

    Approved these changes.

    brandon-b-miller brandon-b-miller commented on code on Nov 16, 2026 13:49 UTC
    Code Review
    pyproject.toml:1
    @@ -31,6 +31,7 @@ dependencies = [
     [project.optional-dependencies]
     cu12 = [
         "cuda-bindings>=12.9.1,<13.0.0",
    +    "cuda-core[cu12]>=0.5.1,<2.0.0",

    Closing the loop here. We connected offline and are comfortable with this change. Thanks for the PR.

    github-actions[bot] github-actions[bot] commented on Nov 16, 2026 14:00 UTC
    Bot

    Doc Preview CI
    :---:
    Preview removed because the pull request was closed or merged.
    <!-- Sticky Pull Request Commentpr-preview -->

    leofang leofang commented on code on Nov 16, 2026 14:36 UTC
    Code Review
    pyproject.toml:1
    @@ -31,6 +31,7 @@ dependencies = [
     [project.optional-dependencies]
     cu12 = [
         "cuda-bindings>=12.9.1,<13.0.0",
    +    "cuda-core[cu12]>=0.5.1,<2.0.0",

    We'll circle back after https://github.com/NVIDIA/cuda-python/pull/3460 was merged and released.

    Reviewers
    Assignees
    TomAugspurger TomAugspurger
    Labels
    risk: low confidence: 76.6% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 9.6% (LOW) · Higher = larger blast radius
    9.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 76.6% · Lower = rushed or shallow review
    76.6%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 2.2% · Safe to merge
    2.2%