Skip to content

docs(tma_multicast): gate on the ISA floor, not on this build target - #1242

Merged
nihalpasham merged 2 commits into
NVIDIA:mainfrom
vyncint:fix/tma-multicast-hopper-gate
Sep 6, 2026
Merged

nihalpasham merged 2 commits into
NVIDIA:mainfrom
vyncint:fix/tma-multicast-hopper-gate

Conversation

@vyncint

@vyncint vyncint commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Addresses the Hopper half of #966, which stays open for the hardware run.

The example refused to run below compute capability 10 and said, in ten places, that TMA multicast "requires sm_100a". Multicast is sm_90+ in the PTX ISA — sm_90a is advised there for performance, not required for legality, which is what the sm_90+ catalog row already records. What actually keeps an H100 out is this example's own build target, not the instruction.

Separating the two facts

before after
host gate major < 10 major < 9
skip text "TMA multicast requires sm_100a" names the declined build target, points at --arch=sm_90a
README Hopper section "Not supported" "Legal per the ISA, hardware run pending"
tma_copy cross-reference "sm_100a only" "sm_90+ per the ISA; that example ships as sm_100a"

Moving the gate does not make the default build run on Hopper — it ships .target sm_100a, the driver declines it, and the existing load-failure arm reports that as its own clean skip, so the smoketest contract is unchanged on every GPU that has one. What the gate change does is stop turning Hopper away before the loader has an opinion, so an --arch=sm_90a build can JIT there.

Verified on an A10G (sm_86, driver 595.71.05)

build --arch=sm_90a    ->  .target sm_90a, 1 multicast instruction
ptxas -arch=sm_90a     ->  ACCEPTED            (ptxas 13.2)
build --arch=sm_100a   ->  .target sm_100a
ptxas -arch=sm_100a    ->  ACCEPTED
run on sm_86           ->  "skipping: TMA multicast requires sm_90 or newer"
                           "   Your GPU is sm_86. Use: cargo oxide run tma_copy"

The last line is the new gate firing on real hardware, not a claim about it.

Negative control, so the ptxas results are not vacuous — the same sm_90a PTX offered as -arch=sm_80:

ptxas fatal : SM version specified by .target is higher than default SM version assumed

What this does not do

It does not run the example on Hopper. There is no H100 here and the sm_90a build has never executed. #966 stays open for exactly that run, the README says so in those words, and the Hopper transcript is explicitly labelled as the shape of the message the host emits rather than a capture — I would rather label it than invent one. Its lines were checked against the println!s they mirror.

Deliberately deferred: the --arch=sm_90a smoketest entry

Your third item is not in this PR, and I raised the reason on the issue before starting rather than guessing. tma_multicast is in none of the category arrays, so it is standard today: the smoketest builds and runs it, with the example's own gate making that a clean skip. There is no existing hook for "also compile this one at a second architecture" — SM100_COMPILE_EXAMPLES and BLACKWELL_COMPILE_EXAMPLES make an example compile-only, which here would trade away runtime coverage it currently has.

So it needs either a new per-example "extra compile arch" mechanism in smoketest.sh, or a decision to leave the sm_90a build outside CI. Inventing the mechanism unasked seemed the wrong call; say which you want and I will follow up.

Test plan

  • cargo fmt --check in the example and across the workspace — clean.
  • check-spdx-headers.sh, check-error-example-status.sh, check-example-license-policy.sh, check-reserved-prefixes.sh, check-book-api-names.sh — pass.
  • Both architectures build and assemble on hardware, with the negative control above.
  • The new gate exercised on a real sm_86 GPU.
  • README transcript lines checked line-for-line against the println! calls they show.

The example refused to run below compute capability 10 and said, in ten
places, that TMA multicast "requires sm_100a". Multicast is sm_90+ in the PTX
ISA -- `sm_90a` is advised there for performance, not required for legality,
which is what the sm_90+ catalog row already records. What actually keeps an
H100 out is this example's own build target, not the instruction.

Separating those two facts is the whole change:

  * the host gate moves from `major < 10` to `major < 9`, so a Hopper GPU is
    no longer turned away before the loader has an opinion. An
    `--arch=sm_90a` build can then JIT there; the default sm_100a build
    cannot, and the existing load-failure arm reports that as its own clean
    skip, so the smoketest contract is unchanged on every GPU that has one.
  * the claim text stops asserting a hardware requirement the ISA does not
    have. The skip messages now name the build target that was declined and
    point at `--arch=sm_90a`, and the README's Hopper section reads "legal
    per the ISA, hardware run pending" instead of "not supported".

`tma_copy`'s cross-reference called this example "sm_100a only" and moves
with it.

Verified on an A10G (sm_86, driver 595.71.05):

    build --arch=sm_90a   -> .target sm_90a, 1 multicast instruction
    ptxas -arch=sm_90a    -> accepted        (ptxas 13.2)
    build --arch=sm_100a  -> .target sm_100a
    ptxas -arch=sm_100a   -> accepted
    run on sm_86          -> "skipping: TMA multicast requires sm_90 or newer"

The last line is the new gate firing on real hardware. The ptxas checks carry
a negative control: the same sm_90a PTX offered as `-arch=sm_80` is refused
with "SM version specified by .target is higher than default SM version".

What this does not do is run the example on Hopper -- no H100 here, and the
sm_90a build has never executed. NVIDIA#966 stays open for that run, the README says
so, and the transcript in the Hopper section is labelled as the shape of the
message rather than a capture.

Signed-off-by: Vyncint Ng <[email protected]>
@nihalpasham nihalpasham added documentation Improvements or additions to documentation examples Example kernels and host harnesses under crates/rustc-codegen-cuda/examples cuda-feature A CUDA hardware/toolkit feature (TMA, tcgen05, WGMMA) labels Sep 6, 2026
The example has no fixed .target. cargo oxide run forwards the detected
GPU as a hint and rustc-codegen-cuda builds for it whenever the kernel's
features run there: an RTX 5090 gets sm_120a, an H100 gets sm_90a. The
sm_100a target is only the fallback when no compatible GPU is detected
(cargo oxide build, or run on a pre-Hopper GPU). The host binary never
knows which target it embeds, so it must not name one.

Changes:
- Banner drops the arch: "=== TMA Multicast Example ===".
- Load-failure arm names no target. It prints the driver error, the
  sm_90 floor, and a note that a module built elsewhere or with --arch
  may not JIT here. Every early-return path keeps its skipping: line.
- Module header, README Hopper section, Hardware Requirements, the
  "Which GPUs Run This?" diagram, and the Multicast-vs-Unicast table
  row now describe the hint -> target -> load model, with a three-row
  table for 5090 / H100 / no-GPU fallback. The uncaptured Hopper skip
  transcript is replaced by a note that the sm_90a run is pending (NVIDIA#966).
- Both README transcripts show the new banner; the sm_120 one is a
  fresh capture from an RTX 5090 (PTX built here reads .target sm_120a).
- Swept the sites the earlier revision missed: Cargo.toml comment,
  tma_copy module header and README cross-reference, README table row,
  and the two sm_120 JIT sentences.

Counts: 5 files, 10 added lines that asserted sm_100a removed plus 6
pre-existing sites reworded; 4 sm_100a mentions remain, all describing
the B200 target or the no-GPU fallback.

Validated on an RTX 5090 (sm_120): cargo oxide run tma_multicast loads
and passes; smoketest tma_multicast + tma_copy both PASS; cargo fmt
--check clean for both examples; host-api-paths, example-smoketest
contract, book-api-names, and sync-example-locks guards all OK.

Signed-off-by: nihalpasham <[email protected]>
@nihalpasham
nihalpasham merged commit 26754ae into NVIDIA:main Sep 6, 2026
53 checks passed
@nihalpasham

Copy link
Copy Markdown
Collaborator

Gate change is right and kept. The text around it said the example ships as .target sm_100a, and it does not: cargo oxide run forwards the detected GPU as a hint and rustc-codegen-cuda builds for it whenever the kernel's features run there.

run on a 5090    hint sm_120a -> .target sm_120a -> loads, runs   (transcript re-captured)
run on an H100   hint sm_90a  -> .target sm_90a  -> expected to run, not yet captured (#966)
no usable GPU    -> sm_100a fallback

What we stacked on your branch (your commit untouched underneath)

  • banner and load-failure arm name no target; the arm prints the CUDA driver's error instead
  • README Hopper section, hardware table, "Which GPUs Run This?" rewritten on that model; "rebuild with --arch=sm_90a" dropped
  • swept the sites the diff missed: Cargo.toml comment, tma_copy main.rs and README, the architecture table row

Validation: cargo oxide run tma_multicast on the 5090, smoketest for tma_multicast and tma_copy, fmt, host-api-paths and lock guards. Merged; #966 stays open for the H100 run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda-feature A CUDA hardware/toolkit feature (TMA, tcgen05, WGMMA) documentation Improvements or additions to documentation examples Example kernels and host harnesses under crates/rustc-codegen-cuda/examples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants