Repository navigation
Ask for the NPP runtime by the name that has wheels on CUDA 13 - #10587
Conversation
nvidia-npp-cu13 is not the CUDA 13 NPP runtime. It is a stub NVIDIA published
when the math libraries dropped the -cuNN suffix, and its own summary says so:
"DEPRECATED: Use nvidia-npp instead". The 13.x runtime is plain nvidia-npp.
Neither way of resolving the stub is any good. Normally pip prefers the stable
0.0.1 over the prerelease, gets an sdist with no wheels, and a clean machine
builds NPP from source, which is what the clean-machine gate caught:
::error::built from source: nvidia-npp-cu13 -- these must resolve to wheels
Under --only-binary it is worse and silent: pip takes 0.0.0a0, a 1.1 kB "Zero
version placeholder" wheel whose single module is an empty __init__.py. That
installs cleanly, ships no NPP at all, and leaves torchcodec unable to dlopen
libnppicc with nothing anywhere saying why.
The suffix boundary is a named constant, not a bare 13, because the rename is
per package rather than a rule about CUDA 13: nvidia-nccl-cu13 is a real wheel
and keeps its suffix. The unsuffixed side is bounded to the major so a cu14
host cannot silently take a 13 runtime.
Verified against PyPI: nvidia-npp 13.1.2.81 publishes manylinux_2_27_aarch64,
manylinux_2_27_x86_64 and win_amd64, so the aarch64 leg this failed on now
resolves to a wheel.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Both callers derive the major from a \d+ match, so this cannot fire today. It is here because the spelling it replaced was an f-string that could not raise, and an installer that dies while resolving an optional audio dependency would be a worse bug than the one being fixed.
|
Confirmed on the leg this was failing on. The clean-machine gate then passes, where before it stopped with: That is the same aarch64 wheel the local resolve predicted, on a real ARM64 runner rather than a platform-override download. |
An index audit turned up two things worth writing down next to the rule. Widening this into "CUDA 13 means no suffix" would be worse than the bug it fixes. cuDNN and NCCL kept their suffix, and for those two the UNSUFFIXED name is the trap: nvidia-cudnn and nvidia-nccl both resolve to 0.0.1.dev5, summary "A fake package to warn the user they are not installing the correct package". And nvidia-npp carries the same junk the stub is made of at the bottom of its own version list: 0.0.0a0 is a 1030 byte pure-Python wheel, 0.0.1.dev4/dev5 are sdists. An unbounded request under --only-binary, behind an exclude-newer cutoff or a partial mirror, can select 0.0.0a0 and land the empty-payload case. The bound was already there; this says why it cannot be dropped.
|
Audited the rest of the installer against the live index to check whether this was one instance or a class. Summary: it is one instance, but two of the findings change how this fix should be read. The silent path was reachable by users, not only by CIThe NPP install is not a pinned-index command, so That installs, Widening this rule would be worse than the bugThe audit priced the generalisation I deliberately avoided. Of the So "CUDA 13 means drop the suffix" would install fake packages for cuDNN and NCCL. The split is CUDA Toolkit math and runtime libraries on one side, separately versioned NVIDIA products on the other. Recorded next to the constant, with a test, so the rule can only ever be widened one name at a time against the index. The version bound is load bearing
A bare The rest is cleanAll 166 pinned requirements resolve at their exact pinned version, no stub summaries, no missing names. The only sdists are the three already allowlisted pure-Python ones ( Two things noted but not touched here, since neither belongs in this PR:
|
|
Independent confirmation from the #10280 side, where this leg is the only red check. The same
both ending One detail that sharpens the "no wheels" half. On PyPI
Your half -- why aarch64 reaches it at all, torchcodec having no aarch64 wheel on the pytorch index so the fallback pulls the CUDA-13-linked generic wheel -- is the part I did not have. Together the two halves are the whole story. Not opening a competing PR; this belongs here. |
|
I opened #10589 for the same break before seeing this one. Closing mine in favour of this, which is older and goes further in two places mine did not: the Carrying over the evidence I did gather, since it is not on either PR yet. The arm job that is red on Staged on a throwaway repo and ran For contrast, the same job on One caveat on provenance: that run was against #10589's head The replacement does not merely resolve, it ships the libraries torchcodec actually needs. Verified on an aarch64 GB10 host. and installing it lays down, under Side by side on aarch64: which is the evidence for keeping the suffix at 12 rather than moving everything. Worth noting for the release notes that this is not only a CI problem: aarch64 is DGX Spark, and the same path runs on a real install there. x86_64 never reaches the NPP step because the pinned torchcodec resolves from the pytorch index, which is why only the ARM leg went red. |
|
@codex security review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The digit check was `str.isdigit()`, which is a wider set than `int()` accepts, so the guard let through exactly the input it exists to stop. Two leaks, failing in opposite directions. The superscripts are `isdigit()` but not `int()`-able, so the guard passed and `int(cuda_major)` raised ValueError on the next line, out of a helper resolving an OPTIONAL audio dependency. The non-ASCII decimal digits are both, so they went straight through to `nvidia-npp>=١٣,<14`, which pip cannot parse as a requirement at all. The second one is reachable rather than hypothetical: `_cuda_major_for_npp` matches with a str pattern, and `\d` in a str pattern is every Unicode decimal digit, not `[0-9]`. Nothing produces one today, since both majors arrive as a `[:2]` or `[-2:]` slice of an ASCII match, but the point of the check is the input nobody predicted, and its docstring already promised that an unrecognised major keeps the previous spelling rather than taking the install down. `re.fullmatch(r"[0-9]+", ...)` rather than a new idiom: `_hsa_override_gfx_arch` rejects "١١.0.0" for this reason already, with the hazard named in a comment. Same reasoning, same file, so this now reads the same way. Test asserts both classes degrade instead of raising, that every requirement emitted for majors 0-99 parses as PEP 440, and pins the ASCII match itself. Confirmed it bites by reverting the guard to `isdigit()`, which fails it.
|
Simulated this end to end rather than reasoning about it, across the platform and accelerator product. Summary: the fix is correct and nothing at or below CUDA 12 moves by a byte. Three things worth recording, one of which is a correction to my own description, plus one real defect I have pushed a fix for in b5b9e64. Backwards compatibilityDrove the real Only 12 reach the NPP step at all. Every cell whose major is 11 or 12 emits the byte-identical string it emits on main, every non-CUDA cell asks for nothing, and no cell anywhere can now name the stub. Over majors 0 through 99 the only strings that differ from The two platforms with no unsuffixed 13.x wheel, macOS arm64 and win_arm64, turn out to be unreachable rather than merely untested. The library directory changes, and every consumer already handles itThis is the one I would not have predicted from the diff. The suffixed wheels and the unsuffixed one do not agree on where NPP goes: Resolving a wheel is worth nothing if nothing can find the libraries afterwards, so I checked every consumer against both layouts:
One thing to note for later rather than for this PR: the Dockerfile's prune step, which drops the NPP libraries torchcodec does not dlopen, is guarded on Also confirmed no NPP wheel declares any Correction to my own description: the silent path is pip only, not uvI wrote that under uv holds prereleases back, so it refuses rather than installing the empty payload. The silent half therefore needs the pip fallback, which narrows its blast radius from what I claimed. The loud half is unchanged and is what CI hits. Worth fixing the wording before merge, since as written it overstates the user-facing reach. Upgrade paths from old installsFour pre-existing states, real installs into throwaway venvs, then applying the fix:
Nothing needs uninstalling first, and no old install is damaged. The
|
Comment-reduction pass over what this branch adds. The reasoning was three times the length of the five lines it explains, and most of it was material that belongs in the PR description rather than the file: measured wheel sizes, the CI error string, which resolution path is loud and which is silent. Kept the facts the code does not state and a reader would otherwise have to rediscover: that the suffixed cu13 name is a wheel-less stub, that widening this into "13 drops the suffix" installs fake packages for cuDNN and NCCL, that the version bound exists to exclude 0.0.0a0 and pin the major, and why the digit match is [0-9]+ rather than isdigit(). 31 comment lines down to 10, and the branch's own diff from 169 added lines to 100. Comments and docstrings only: verified by comparing the AST of both files with docstrings stripped, which is identical either side of this commit.
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
What this is
nvidia-npp-cu13is not the CUDA 13 NPP runtime. NVIDIA dropped the-cuNNsuffix from the math libraries at 13, so the 13.x runtime is plainnvidia-npp, and the suffixed name is a stub. Its own summary on PyPI says so:studio/install_python_stack.pybuilds the name asf"nvidia-npp-cu{_npp_major}", so every CUDA 13 host asks for the stub.Why it is worth fixing rather than leaving
Neither way of resolving that name gives you NPP.
Normally pip prefers the stable
0.0.1over the prerelease and gets an sdist with no wheels, so a clean machine builds NPP from source. That is the loud failure, and the only reason it is visible at all is the build-from-source gate:That is the current
linux ubuntu2404-arm-rootfailure, and it reproduces on every open PR because it comes from the shared installer path rather than from any one branch.Under
--only-binaryit is worse, because it is silent. pip takes0.0.0a0instead:That installs cleanly, reports success, ships no NPP whatsoever, and leaves torchcodec failing to
dlopenlibnppiccwith nothing anywhere naming the cause. This is exactly the import failure the NPP install was added to prevent, so the current code can produce the very symptom it exists to avoid.The fix
A
_npp_requirementhelper that spells the requirement the way its publisher does:nvidia-npp-cu11nvidia-npp-cu12nvidia-npp>=13,<14nvidia-npp>=14,<15Two deliberate choices.
The boundary is a named constant, not a bare
13. The rename is per package, not a rule about CUDA 13.nvidia-nccl-cu13is a real wheel and keeps its suffix, whilenvidia-cublas-cu13is another deprecated stub. Only names that actually moved may drop the suffix, so the counterexample is recorded next to the constant rather than left to memory.The unsuffixed side is bounded to the major. That name keeps moving: it is 13.x today, and a cu14 host must not silently take a 13 runtime or the reverse.
Verification
Against PyPI, today:
The aarch64 wheel is the one the failing leg needs. Resolved it end to end for that platform rather than reading the index:
tests/python/test_torchcodec_torch_compat.pyis 91/91. Two new tests cover the mapping and the per-package reasoning; confirmed they bite by flipping the boundary constant from 12 to 13, which fails both.Scope
nvidia-npp-cu11andnvidia-npp-cu12are real packages and are untouched, so CUDA 11 and 12 hosts resolve exactly what they resolve today.docker/Dockerfilepins cu12 by hand and is unaffected. The only behaviour that changes is CUDA 13 and later, which today cannot get a working NPP by either resolution path.What this unblocks
linux ubuntu2404-arm-rootis red onmainitself and on every branch that inherits it. This PR is what turns it green.main: run 34255272305 at5177a5b1d, sole failing job, no PR involved.Verified green rather than argued: staged on a throwaway repo and ran
Clean machine install.linux ubuntu2404-arm-rootcompleted success with zero##[error]lines, and the NPP step resolved to a wheel instead of a source build:That run was against the equivalent change on a since-closed duplicate branch (#10589), not this head; both emit the byte-identical
nvidia-npp>=13,<14for major 13 at the same call site, so the command the job ran is the command this PR produces. Worth a re-stage pinned to this branch before merging if you want the run tied to it.Worth noting this is not only a CI problem: aarch64 is DGX Spark, so the same path runs on a real install there. x86_64 never reaches the NPP step, because the pinned torchcodec resolves from the pytorch index, which is why only the ARM leg went red.