Repository navigation
Description
Part of #2077.
Summary
cuda_core/tests/example_tests/test_samples.py skips a sample when a requirement in its PEP 723 dependencies header is missing. The nightly-pytorch job is the nightly environment that runs the samples: it runs tests/test_utils.py tests/example_tests/ after installing PyTorch plus the test-cu13 dependency group, which includes cupy-cuda13x. Three samples already pass there.
The never-run samples below skip in that job only because a few more packages aren't installed. All of them are on PyPI. Installing them in the same job's environment (the nightly-pytorch branch of ci/tools/run-tests) would let these samples run nightly.
What each sample is missing on the nightly-pytorch CUDA 13 rows
| Sample | Missing in nightly-pytorch (CTK 13.0.2 / 13.2.2) | PyPI wheels |
|---|---|---|
binarySearch, cudaComputeLambdas |
cuda-cccl[cu13] |
Linux x86_64/aarch64, Windows |
parallelReduction, prefixSum, reductionMultiBlockCG |
cuda-cccl |
same |
matrixMulSharedMem |
nvmath-python[cu13] |
Linux x86_64/aarch64, Windows |
simplePrint |
numba-cuda>=0.29, and on CTK 13.0.2 rows also nvidia-nvjitlink>=13.2 |
Linux x86_64/aarch64, Windows |
customTensorFlowKernel |
tensorflow |
2.21.0: Linux x86_64/aarch64, Windows, macOS; Python 3.10–3.13 |
glInteropFluidNumbaCudaMlir |
numba-cuda-mlir, plus a GL context (#3576) |
Linux x86_64/aarch64, Windows |
multiGPUGradientAverage |
mpi4py and Open MPI's mpirun; it also needs 2 GPUs (#3584) |
mpi4py: all platforms; openmpi: Linux, macOS |
pageRank |
RAPIDS (cudf-cu13, cugraph-cu13, dask-cuda). #3601 replaces its cuda-core<1.0.0 pin. |
Linux x86_64/aarch64 only |
tmaTensorMap |
nvidia-cuda-cccl>=13.0.0, the CUDA 13 CCCL headers (#3601 corrects the CUDA 12 package name it declared). It has CuPy already, and waives below compute capability 9.0. |
Linux x86_64/aarch64, Windows |
Proposal
Add these packages to the nightly-pytorch install in ci/tools/run-tests for the CUDA 13 rows, in the same single pip install call so pip resolves them together with torch:
cuda-cccl[cu13]andnvmath-python[cu13].- The
ccclextra on the existingcuda-toolkit[cudart]==${TEST_CUDA_MAJOR_MINOR}.*requirement, which installsnvidia-cuda-ccclmatching the row's toolkit, fortmaTensorMap. Thenightly-numba-cuda-mlirbranch already installscuda-toolkit[...,cccl]this way. numba-cuda[cu13], with the samenumba<0.67/numpy<2.5pins thenightly-numba-cudabranch uses.simplePrintwill then run on the CTK 13.2.2 rows; leave the CTK 13.0.2 rows' nvJitLink alone rather than upgrading it past the toolkit.numba-cuda-mlir[cu13], after checking that it installs and imports alongsidenumba-cuda. If it doesn't, install it on only one of the rows. The sample also needs the headless GL work in samples: run the cuda.core GL interop samples headless (EGL) instead of waiving without DISPLAY #3576.tensorflow: the plain PyPI wheel, nottensorflow[and-cuda], which pulls CUDA 12 libraries (nvidia-*-cu12, cuDNN 9). The sample moves data numpy → CuPy and launches its kernel through cuda.core, so TensorFlow only needs to runtf.py_functionand the reference ops. The CPU build is enough for that, so it doesn't drag a second CUDA major into a CUDA 13 environment.nightly-pytorchuses Python 3.12, which TensorFlow 2.21 supports.mpi4pyandopenmpi(Linux): the harness launchesmultiGPUGradientAveragewithmpirun --allow-run-as-root -np 2(cuda_core/tests/example_tests/test_args.json), which is Open MPI syntax. The sample runs once a nightly-pytorch row has 2 GPUs (CI: hardware needed for tests that never run (3+ GPUs, NVLink, Tegra/DLA, vGPU) #3584).cudf-cu13,cugraph-cu13, anddask-cuda(RAPIDS, Linux rows only; there are no Windows wheels). samples: fix unsatisfiable dependency pins and depend on cuda-core[cu13] #3601 replacespageRank'scuda-core<1.0.0pin; current RAPIDS resolves with cuda-core 1.x.
TensorFlow: PyPI, not conda-forge
The existing note in cuda_core/pixi.toml says conda-forge's TensorFlow build needs an executable stack and fails on hardened hosts. That applies to the conda-forge package only; the same note recommends pip install tensorflow instead. CI installs from PyPI inside ubuntu:24.04 containers (glibc 2.39), so that problem doesn't apply. Confirm on the first nightly run.
Not in scope
glInteropFluid,glInteropMipmapLod,glInteropPlasma: they need a GL context, not packages (samples: run the cuda.core GL interop samples headless (EGL) instead of waiving without DISPLAY #3576).processCheckpoint: it needs no extra packages. samples: fix unsatisfiable dependency pins and depend on cuda-core[cu13] #3601 fixes its version cap, so it runs in the regularcorejob.greenContext: waived on driver 13.1+ until [BUG]: SMResource.split() dry_run=True fails with cuDevSmResourceSplit when smCount is non-zero #2765 is fixed.cuda_core/tests/example_tests/test_sample_environment.py::test_samples_environment_uses_one_local_cuda_distribution: it checks the provenance of the Pixisamplesenvironment, and runs only whenPIXI_ENVIRONMENT_NAME == "samples". It is a developer-environment check that never runs in CI by design, so its marker is accurate and stays.
Done when
The packages above are installed in the nightly-pytorch job, the samples pass there (multiGPUGradientAverage once a 2-GPU row exists, see #3584), and their keys are removed from the test_samples.py marker.
Guidance for PRs that address this issue
- When making a fix that allows a test to run in CI, remove the comment about the test not running in CI from the code.
- When making a test run only in nightly CI, we need to concretely confirm that in nightly CI. Include instructions in the PR about how to kick off a nightly run for the specific PR in order to test that (see below).
- For every PR note that the reviewer should feel free to push commits directly to the PR to improve things. @mdboom does not have the bandwidth to shepard each of them through.
- Every PR should include a way to confirm automatically that the tests are now running in at least one CI configuration.
Running the nightly test suites for a PR
The nightly workflow can test a PR's own wheels and tests, but it has to be started by hand. Starting it needs write access to NVIDIA/cuda-python, so ask a maintainer if you don't have it.
-
Wait for the PR's CI workflow run to finish successfully, and note its run ID, the number in its URL (
.../actions/runs/<run-id>). -
Start CI: Nightly optional-deps on the PR's mirror branch, with that run ID. Either:
-
In the GitHub UI: Actions → CI: Nightly optional-deps → Run workflow. Set Use workflow from to
pull-request/<PR number>, enter the run ID in the run-ID field, and leave the link-checker-only box unchecked. -
From the command line:
gh workflow run ci-nightly.yml --repo NVIDIA/cuda-python --ref pull-request/<PR number> -f run-id=<run-id>
Supply the run ID. Without it, the nightly run tests
main's latest wheels and tests, not the PR's. -
-
Link the nightly run in the PR. Then confirm that the affected tests ran and passed, rather than skipped, in the relevant nightly jobs.
The nightly run tests the commit of that CI run. Repeat these steps after pushing changes that affect the nightly-only tests.
Activity