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
{{ message }}
Repository navigation
samples: fix unsatisfiable dependency pins and depend on cuda-core[cu13] - #3601
Each pin had a documented reason (in the sample's requirements.txt or README), so each fix addresses that reason rather than just deleting the pin:
Sample
Before
After
Why
processCheckpoint
cuda-python>=13.0.0,<13.3.0
cuda-core[cu13]>=1.3.0
Only cuda-bindings 13.3.0 lacked CUcheckpointRestoreArgs, and 13.3.1 restored it (#2144). cuda-core 1.3.0's cu13 extra requires cuda-bindings >=13.5.0, which excludes 13.3.0.
tmaTensorMap
nvidia-cuda-cccl-cu12
nvidia-cuda-cccl>=13.0.0
The sample is CUDA 13 (cupy-cuda13x), and the CUDA 13 CCCL wheel has no -cu12 suffix. cuda.pathfinder finds its headers in nvidia/cu13/include/cccl.
pageRank
cuda-core<1.0.0
cuda-core[cu13]>=1.0.0
The cap came from cudf-cu13 requiring numba-cuda<0.29.0. cudf-cu13 26.10.2 allows numba-cuda 0.30.4, which allows cuda-core<2.0.0. The README's known-issue note is removed.
processCheckpoint now runs in the regular core CI job on Linux CUDA 13 rows, so it is removed from the "not currently run in any CI job" marker in test_samples.py. tmaTensorMap still needs the CCCL wheel and CuPy installed, and pageRank still needs RAPIDS. #3578 tracks both.
2. cuda-core[cu13] instead of cuda-python
Samples that depend on cuda-core no longer list cuda-python. Plain cuda-core installs no cuda-bindings; they come only through its cu12/cu13 extras. So these samples now require cuda-core[cu13].
43 PEP 723 headers, 43 requirements.txt files, and 34 READMEs.
glInteropFluid, glInteropMipmapLod and textureSample require >=1.1.0, because cuda.core.texture first shipped in cuda-core 1.1.0. The two GL headers had listed cuda_bindings plus cuda_core>0.6.0; they now match their requirements.txt.
3. Sample runner: check what an extra requires
cuda-python>=13.0.0 was what made these samples skip on CUDA 12 rows. The runner used to check only that a distribution declares a requested extra, so cuda-core[cu13] alone would have passed there too.
missing_dependencies(sample)
for each requirement:
version satisfies specifier?
requested extras declared?
+ for each requested extra:+ for each requirement that extra adds (recursively, e.g. cu13 -> minimal-sysctk13):+ installed? -> its version must satisfy the requirement+ not installed -> accepted (conda / a local CTK provide it without pip metadata)
So cuda-core[cu13] is unmet when cuda-bindings 12.x is installed:
cuda-core[cu13]>=1.0.0 (cuda-core 1.3.1: extra cu13 requires cuda-core[minimal-sysctk13]
(cuda-core 1.3.1: extra minimal-sysctk13 requires cuda-bindings<14,>=13.5.0
(cuda-bindings 12.9.6: version 12.9.6 does not satisfy <14,>=13.5.0)))
4. One copy of the sample test logic
cuda_core/tests/example_tests/test_samples.py and cuda_bindings_13/tests/example_tests/test_samples.py each repeated the code that runs one sample and turns its result into a pass, skip, or fail. That code is now SampleSuite in cuda_python_test_helpers/sample_runner.py:
The "unmet package requirement(s):" prefix is one constant (UNMET_DEPENDENCIES).
Wrapper re-exports in both run_samples.py files that nothing uses anymore are removed.
sample_runner.py now imports pytest.
The CUDA 12 bindings root has no sample tests, so it has no counterpart change.
Evidence
Gating against real package metadata. Each sample's skip decision, before and after, in three environments:
Environment
Samples whose skip status changes
CUDA 12 metadata (cuda-core 1.3.1, cuda-bindings 12.9.6)
none: every cuda-core[cu13] sample still skips, now through the extras check
PyPI CUDA 13 (cuda-core 1.3.1, cuda-bindings 13.5.0, CuPy, nvidia-cuda-cccl)
processCheckpoint and tmaTensorMap: skip → run
Local CUDA 13 dev build
none
Samples:
processCheckpoint PASSED on an RTX 5070 and an RTX A400.
tmaTensorMap PASSED through the sample runner in the PyPI CUDA 13 environment, with CUDA_HOME/CUDA_PATH unset, using only the nvidia-cuda-cccl wheel's headers.
pageRank: uv pip compile resolves cuda-core>=1.0.0 together with cugraph-cu13, cudf-cu13 26.10.2, and dask-cuda (to cuda-core 1.2.2 and numba-cuda 0.30.4).
Confirming it runs in CI: in this PR's CI run, the Linux CUDA 13 core jobs should report test_sample[cuda_core/processCheckpoint] PASSED, where main reports it SKIPPED. The CUDA 12 jobs should still skip the cuda-core[cu13] samples, now with the extra cu13 requires … reason. For example:
gh run view <CI run id> --repo NVIDIA/cuda-python --log | grep -F "test_sample[cuda_core/processCheckpoint]"
Merge Danger
Door: two-way. Sample metadata and test harness only.
Blast Radius: sample tests in cuda.core and cuda.bindings, and anyone installing a sample's requirements.
processCheckpoint now runs on Linux CUDA 13 CI rows. It checkpoints and restores its own process, so a driver or container restriction on a runner would show up as a failure there.
Installing a cuda.core sample's requirements now installs cuda-core[cu13] (cuda-bindings 13.x plus cuda-toolkit 13 wheels) instead of cuda-python.
The extras check accepts a missing distribution, so it cannot newly skip samples in conda or local-toolkit environments. An installed distribution with a conflicting version now causes a skip.
Three cuda.core samples declared PEP 723 requirements that no CI
environment can satisfy, so they skipped everywhere:
- processCheckpoint capped cuda-python <13.3.0 because cuda-bindings
13.3.0 lacked CUcheckpointRestoreArgs (13.3.1 restored it). Require
cuda-core[cu13]>=1.3.0 instead: its cu13 extra needs cuda-bindings
>=13.5.0, which excludes 13.3.0.
- tmaTensorMap required the CUDA 12 nvidia-cuda-cccl-cu12 package. Use
the CUDA 13 nvidia-cuda-cccl>=13.0.0.
- pageRank pinned cuda-core<1.0.0 because cudf-cu13 used to require
numba-cuda<0.29.0. Current cudf-cu13 allows numba-cuda 0.30.4, which
allows cuda-core<2.0.0, so use a lower bound and drop the README note.
Samples that depend on cuda-core no longer list cuda-python. They
require cuda-core[cu13] instead, which installs the matching
cuda-bindings, in the PEP 723 headers, requirements.txt files, and
READMEs. Samples that use cuda.core.texture require cuda-core>=1.1.0.
The sample runner now checks the installed distributions that a
requested extra requires, so cuda-core[cu13] is unmet when cuda-bindings
12.x is installed and these samples keep skipping on CUDA 12 rows.
Distributions an extra requires but that are not installed are accepted,
because conda and a local CUDA Toolkit provide them without pip metadata.
Move the code that runs one sample and maps its result to a pytest
outcome, duplicated in the cuda.core and cuda.bindings test_samples.py,
into SampleSuite in sample_runner.py, and drop wrapper re-exports that
are no longer used.
processCheckpoint now runs in CI, so remove it from the "not currently
run in any CI job" marker scope.
ClosesNVIDIA#3567.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
Documentation
Updated CUDA Core sample requirements and installation instructions to use the CUDA 13 extra instead of listing separate CUDA package requirements.
Updated minimum CUDA Core versions and dependency constraints where needed.
Bug Fixes
Improved sample dependency checks to validate requested extras and their conditional requirements, including version constraints and cycles.
Standardized sample test handling for missing dependencies and sample outcomes.
CUDA Core samples now declare CUDA 13 dependencies through cuda-core[cu13]. The runner validates requirements activated by requested extras and provides a shared SampleSuite interface for sample tests. The processCheckpoint test key is no longer included in the documented exclusion list.
Changes: CUDA 13 sample dependency and test updates
The runner recursively checks installed providers against requirements from requested extras. Tests cover transitive version constraints, absent distributions, and cyclic requirements.
CUDA Core sample dependency declarations samples/cuda_core/*/{README.md,*.py,requirements.txt}
Sample declarations select cuda-core[cu13]. processCheckpoint updates its minimum version and requirements comment; pageRank removes its upper-bound pin; tmaTensorMap uses the CUDA 13 CCCL package. Other CUDA Core samples also update their dependency declarations.
Shared sample test execution cuda_bindings_13/tests/example_tests/*, cuda_core/tests/example_tests/*, cuda_python_test_helpers/cuda_python_test_helpers/sample_runner.py
SampleSuite collects samples and handles test outcomes. The CUDA 13 and CUDA Core tests delegate checks to it. The runner modules remove selected helper re-exports.
Assessment against linked issues
Objective
Addressed
Explanation
[3567] Make the processCheckpoint, tmaTensorMap, and pageRank dependency declarations satisfiable in CI.
✅
Out-of-scope changes
Code Change
Explanation
Update dependency declarations and README requirements for other CUDA Core samples, for example binarySearch (samples/cuda_core/binarySearch/requirements.txt:2)
Issue 3567 identifies only processCheckpoint, tmaTensorMap, and pageRank; it does not state requirements for these other samples.
Possibly related issues
NVIDIA/cuda-python#2961: Recursive checks for requirements declared by requested extras address the described dependency-validation gap.
NVIDIA/cuda-python#3578: The changes update dependency declarations and sample test handling, but do not add the optional packages tracked by this issue.
NVIDIA/cuda-python#2077: The documented sample-key list no longer includes cuda_core/processCheckpoint; it continues to omit tmaTensorMap and pageRank.
Change: Bug fix · Severity of issue fixed: Medium
Merge Risk: Low · up to 55103
The dependency changes and the shared sample-test suite look sound. One open edge case in the extra-requirement check could cause a sample to be skipped when a compatible fallback package is installed. It is a small, bounded follow-up.
Security architecture risk: Minimal · up to 55103
The change updates sample installation and consolidates test execution. It preserves the existing distinction between skipped and failed tests and does not introduce a production endpoint or grant new privileges.
Security review details
Security Blast Radius
observed — The checkpoint sample that becomes eligible under the revised requirements targets its own PID inside the sample subprocess. The change does not add a path for callers to select another process as the checkpoint target.
Trust Boundaries and Controls
observed — Pytest still takes its sample keys from repository discovery and checks file existence before executing a sample. Execution still occurs with the test runner's inherited environment; moving the call into SampleSuite does not create a sandbox or change subprocess privileges.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between 223178c and 5510365.
Files selected for processing: 1
cuda_core/tests/example_tests/test_samples.py
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 7 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Both standalone sample CLIs fail to import without undeclared pytest, even for --help, and the recursive extras gate lacks unit coverage for dependency traversal and compatibility checks.
This PR corrects sample dependency metadata for #3567 and supports the broader effort in #2077 to reduce samples that never run in CI.
Changes:
Replaces separate cuda-python and cuda-core requirements with cuda-core[cu13], aligning script headers, requirements, and documentation.
Fixes the checkpoint, CCCL, and PageRank constraints, and raises texture samples’ minimum cuda-core version to 1.1.
Adds recursive extra-dependency checks and shares pytest sample execution through SampleSuite.
No CUDA 12 counterparts were found for cuda_bindings_13/tests/example_tests/run_samples.py or cuda_bindings_13/tests/example_tests/test_samples.py; no matching changes are needed there. The supplied diffs do not modify marked synchronized blocks.
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 5 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
important: Check fallback providers before rejecting an extra requirement.
If an extra requires cupy-cuda13x>=14, installed metadata for cupy-cuda13x==13.0 causes this loop to stop even when the fallback cupy==14.0 satisfies the requirement. The top-level provider loop accepts that fallback, but the recursive loop incorrectly waives the sample.
Collect mismatches until all providers fail. Break only when a provider satisfies the requirement.
Import pytest inside SampleSuite.check so the standalone run_samples.py
CLIs work without pytest installed. Add unit tests covering transitive
extra checks (compatible/incompatible versions, accepted missing
distribution, and dependency cycles).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
Architecture findings (1)
Advisory architecture findings (1)
Trivial — The new extra traversal parses installed Requires-Dist entries before filtering by marker. A malformed entry can raise an exception that bypasses the runner’s per-sample metadata error handler. A serial batch then stops before running later samples; in either serial or parallel mode, the batch can exit without its normal summary.
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.
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
cuda.bindingsEverything related to the cuda.bindings modulecuda.coreEverything related to the cuda.core moduletestImprovements or additions to tests
2 participants
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 #3567. Part of #2077.
Summary
1. Three unsatisfiable sample pins
Each pin had a documented reason (in the sample's
requirements.txtor README), so each fix addresses that reason rather than just deleting the pin:processCheckpointcuda-python>=13.0.0,<13.3.0cuda-core[cu13]>=1.3.0CUcheckpointRestoreArgs, and 13.3.1 restored it (#2144). cuda-core 1.3.0'scu13extra requires cuda-bindings >=13.5.0, which excludes 13.3.0.tmaTensorMapnvidia-cuda-cccl-cu12nvidia-cuda-cccl>=13.0.0cupy-cuda13x), and the CUDA 13 CCCL wheel has no-cu12suffix.cuda.pathfinderfinds its headers innvidia/cu13/include/cccl.pageRankcuda-core<1.0.0cuda-core[cu13]>=1.0.0cudf-cu13requiringnumba-cuda<0.29.0.cudf-cu1326.10.2 allowsnumba-cuda0.30.4, which allowscuda-core<2.0.0. The README's known-issue note is removed.processCheckpointnow runs in the regularcoreCI job on Linux CUDA 13 rows, so it is removed from the "not currently run in any CI job" marker intest_samples.py.tmaTensorMapstill needs the CCCL wheel and CuPy installed, andpageRankstill needs RAPIDS. #3578 tracks both.2.
cuda-core[cu13]instead ofcuda-pythonSamples that depend on cuda-core no longer list
cuda-python. Plaincuda-coreinstalls no cuda-bindings; they come only through itscu12/cu13extras. So these samples now requirecuda-core[cu13].requirements.txtfiles, and 34 READMEs.glInteropFluid,glInteropMipmapLodandtextureSamplerequire>=1.1.0, becausecuda.core.texturefirst shipped in cuda-core 1.1.0. The two GL headers had listedcuda_bindingspluscuda_core>0.6.0; they now match theirrequirements.txt.3. Sample runner: check what an extra requires
cuda-python>=13.0.0was what made these samples skip on CUDA 12 rows. The runner used to check only that a distribution declares a requested extra, socuda-core[cu13]alone would have passed there too.missing_dependencies(sample) for each requirement: version satisfies specifier? requested extras declared? + for each requested extra: + for each requirement that extra adds (recursively, e.g. cu13 -> minimal-sysctk13): + installed? -> its version must satisfy the requirement + not installed -> accepted (conda / a local CTK provide it without pip metadata)So
cuda-core[cu13]is unmet when cuda-bindings 12.x is installed:4. One copy of the sample test logic
cuda_core/tests/example_tests/test_samples.pyandcuda_bindings_13/tests/example_tests/test_samples.pyeach repeated the code that runs one sample and turns its result into a pass, skip, or fail. That code is nowSampleSuiteincuda_python_test_helpers/sample_runner.py:UNMET_DEPENDENCIES).run_samples.pyfiles that nothing uses anymore are removed.sample_runner.pynow imports pytest.Evidence
Gating against real package metadata. Each sample's skip decision, before and after, in three environments:
cuda-core[cu13]sample still skips, now through the extras checknvidia-cuda-cccl)processCheckpointandtmaTensorMap: skip → runSamples:
processCheckpointPASSED on an RTX 5070 and an RTX A400.tmaTensorMapPASSED through the sample runner in the PyPI CUDA 13 environment, withCUDA_HOME/CUDA_PATHunset, using only thenvidia-cuda-ccclwheel's headers.pageRank:uv pip compileresolvescuda-core>=1.0.0together withcugraph-cu13,cudf-cu1326.10.2, anddask-cuda(to cuda-core 1.2.2 and numba-cuda 0.30.4).cuda_core/tests/example_tests: 121 passed, 39 skipped.cuda_bindings_13/tests/example_tests: 24 passed, 1 skipped (sample-reported waiver).Confirming it runs in CI: in this PR's CI run, the Linux CUDA 13
corejobs should reporttest_sample[cuda_core/processCheckpoint] PASSED, wheremainreports it SKIPPED. The CUDA 12 jobs should still skip thecuda-core[cu13]samples, now with theextra cu13 requires …reason. For example:Merge Danger
Door: two-way. Sample metadata and test harness only.
Blast Radius: sample tests in cuda.core and cuda.bindings, and anyone installing a sample's requirements.
processCheckpointnow runs on Linux CUDA 13 CI rows. It checkpoints and restores its own process, so a driver or container restriction on a runner would show up as a failure there.cuda-core[cu13](cuda-bindings 13.x pluscuda-toolkit13 wheels) instead ofcuda-python.test_samples.pymarker list, so whichever merges second needs a small rebase.Reviewers: please feel free to push commits directly to this PR to improve it.
🤖 Generated with Claude Code