Repository navigation
fix(examples): gate arch-dependent examples on compute capability - #658
Merged
Merged
Conversation
Eleven examples in the `standard` smoketest category assume the device can run instructions above its architecture. On a Turing GPU (sm_75) that produced three distinct wrong verdicts. Two reported a full `PASS` having executed nothing: `cp_async_small` and `cp_async_zfill` print a capitalised `Skipping:` that the case-sensitive check at scripts/smoketest.sh:333 does not match, and then satisfy the success check at :337 through the substring `PASS` inside their own message. Two reported `FAIL` while behaving correctly: `tma_copy` and `tma_multicast` handle an unsupported device and exit 0, but printed no recognised marker. `tma_multicast` already carried the `skipping:` marker in its driver-error arm, under a comment explaining why it is there; the capability arm that actually runs on pre-Blackwell hardware omitted it. Seven failed outright with DriverError(218, "a PTX JIT compilation failed"): `barrier`, `future_apis`, `cvt_f16x2`, `generated_intrinsics`, `mcast_barrier_test` and `coop_groups_demo` had no capability guard, and `clc` had one that only warned before continuing into the same panic. Each now takes the shape the thirteen already-correct examples use: check `compute_capability()`, print the documented lowercase `skipping:` marker, and return. Verified on a Tesla T4 (sm_75, driver 595.71.05, CUDA 13.2). The eleven go from nine failures and two false passes to `PASS (skipped)`, with `vecadd` and `cluster` unchanged as controls, and `cargo oxide fmt --check` passing. Refs NVIDIA#656 Signed-off-by: Vyncint Ng <[email protected]>
Collaborator
|
Validated the half that needed newer hardware:
Merging. Partially addresses #656 (the examples half; the harness-side tightening stays open). |
nihalpasham
approved these changes
Aug 5, 2026
This was referenced Aug 5, 2026
nihalpasham
added a commit
that referenced
this pull request
Aug 6, 2026
* fix(examples): future_apis needs sm_100, not sm_80 The guard added in #658 gates future_apis at sm_80 on the strength of its mbarrier calls. Those would indeed run on Ampere, but the kernels also construct `ManagedBarrier<_, TmaBarrier>`, and the backend detects that as a TMA feature. Building for anything lower is refused outright: error: [rustc_codegen_cuda] Device codegen failed: PTX generation failed: CUDA target sm_86 cannot lower detected feature Tma + Sm80; cuda-oxide requires a target compatible with sm_100 for this module Under an auto-detected target the build instead succeeds at .target sm_100 and the module then fails to load, so the too-low floor surfaced as DriverError(218, "a PTX JIT compilation failed") on every pre-Blackwell device -- Ampere and Hopper alike, not just the pre-Ampere hardware the original guard was aimed at. Both behaviours are the designed ones; only the floor was wrong. Raised to sm_100, matching clc and tma_multicast. Verified on an NVIDIA A10G (sm_86): future_apis now reports "skipping: TMA-typed barriers require sm_100+ (device is sm_86)" and the smoketest passes 2/2 with vecadd as an executing control. Before this change the same example failed with DriverError(218) on that device, including after a forced full backend rebuild. Refs #656 Signed-off-by: Vyncint Ng <[email protected]> * review: the floor is sm_90 (fence.proxy.async), not sm_100 The requirement comes from fence.proxy.async, an sm_90 instruction that ManagedBarrier::init_by emits for every barrier kind; the TmaBarrier typestate parameter is inert PhantomData and detects nothing. On real hardware the device hint resolves the target, so a Hopper box builds and runs this example at sm_90; skipping below sm_100 would silently drop coverage on exactly the generation these mbarrier/proxy-fence APIs were built for. Guard at major < 9 and let the comment and skip message carry the correct derivation. Verified on an RTX 5090 (sm_120): all five tests execute and pass. --------- Signed-off-by: Vyncint Ng <[email protected]> Co-authored-by: nihalpasham <[email protected]>
nihalpasham
pushed a commit
that referenced
this pull request
Aug 6, 2026
…s a full PASS (#665) verdict_standard decides a bare `PASS` from `grep -qE 'SUCCESS|PASS|Complete'` over the whole log. Skip declarations routinely contain those words, so a skip the function fails to recognise is not merely missing its "(skipped)" annotation: it is promoted to a full execution PASS, indistinguishable in the summary from an example that launched kernels and verified results. Three cases all reported a clean `PASS`: * wgmma_mma_bf16's `main` only prints. Its module doc says "compilation and PTX generation only. Do not launch this kernel." It belongs in `standard` because the build and the host binary must both succeed, but that category's contract is that execution succeeds, so every GPU run counted it as an execution pass. Name it in NO_LAUNCH_EXAMPLES and report `PASS (compiled, no launch)`. * generated_ldmatrix prints `PASS (skipped): ...` below sm_75. The skip check matched only a leading lowercase `skipping:`, so that line fell through to the success grep, which then matched its own `PASS`. * A capitalised `Skipping:` did the same thing. #658 reworded the two examples that hit it, so nothing triggers this today; matching case-insensitively keeps the next one from reaching the success grep. Compile-only runs collapse every category into verdict_compile, so the GPU-less examples-compile lane is unaffected. This changes real-GPU runs. Fixes #656 Signed-off-by: Vyncint Ng <[email protected]>
nihalpasham
pushed a commit
that referenced
this pull request
Aug 6, 2026
The example claimed, in both its module header and its runtime message, that TMA multicast is "NOT supported on consumer Blackwell (sm_120)". Reviewing #658, @nihalpasham measured the opposite: the sm_100a tma_multicast PTX JIT-loads and the test passes on an RTX 5090. Corrected to state the floor (sm_100a or later) without the false exclusion, and to keep the accurate half -- Hopper and earlier really cannot run it. I have no Blackwell hardware, so the positive claim is attributed rather than re-measured: the header says sm_120 is reported to load and run, and the runtime message names the floor instead of enumerating what does not work. Refs #658 Signed-off-by: Vyncint Ng <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes the reporting half of #656.
Eleven examples in the
standardsmoketest category assume the device can run instructions above its architecture. On a Turing GPU (sm_75) that produced three distinct wrong verdicts, none of them reachable from CI, which compiles examples without executing them.What was wrong
Two reported a full
PASShaving executed nothing.cp_async_smallandcp_async_zfillprint a capitalisedSkipping:, which the case-sensitive check atsmoketest.sh:333does not match; they then satisfy the success check at:337through the substringPASSinside their own message:Verdict:
PASS, notPASS (skipped)— indistinguishable in the summary from an example that ran and validated results.Two reported
FAILwhile behaving correctly.tma_copyandtma_multicasthandle an unsupported device and exit 0, but printed no recognised marker.tma_multicastalready carried theskipping:marker in its driver-error arm (main.rs:181), directly under a comment explaining it is there so "smoketest's failure-marker scan doesn't flag this as a regression" — but the capability arm at:154, which is the one that actually runs on pre-Blackwell hardware, omitted it.Seven failed outright with
DriverError(218, "a PTX JIT compilation failed"):barrier,future_apis,cvt_f16x2,generated_intrinsics,mcast_barrier_testandcoop_groups_demohad no capability guard, andclchad one that only warned before continuing into the same panic.What changed
Each example now takes the shape the thirteen already-correct examples use — check
compute_capability(), print the documented lowercaseskipping:marker, return. No harness changes;smoketest.shis untouched.Floors used: sm_80 for mbarrier (
barrier,future_apis), packed f16 conversion (cvt_f16x2, matching the floorcvt_packedalready gates on) and bf16 (generated_intrinsics); sm_90 for clusters (coop_groups_demo,mcast_barrier_test); sm_100 for CLC (clc).Verification
Tesla T4 (sm_75), driver 595.71.05, CUDA 13.2,
cargo oxide fmt --checkclean:vecadd(executes) andcluster(already guarded) are unchanged controls. Before this change, the same selection on the same hardware gave nine failures and the two false passes.The before-state came from a full 178-example run on sm_75: 11 failures, listed in #656.
Deliberately not included
Two items from #656 are left out rather than guessed at:
wgmma_mma_bf16— it is compile-only but categorisedstandard. Moving it intoWGMMA_EXAMPLESwould not fix it: its output matches none of the non-Hopper markers atsmoketest.sh:475, so it would fall through to:488and reportPASS (wgmma, executed), which is equally untrue. That needs a decision about whether a compile-only wgmma bucket should exist.cutile_inter_kernel— fails on sm_75 inside the third-party toolchain (tileiras: Cannot find option named 'sm_75'). I do not know cuTile's actual floor, and an invented one is worse than none.Also unaddressed here: the
standardsuccess check acceptsSUCCESS|PASS|Completeanywhere in the output, which is what let the two false passes through in the first place. Tightening it is a harness change with blast radius across every example, so I would rather do it separately if you want it.