Repository navigation
feat(intrinsics): add TMA tensor reduction intrinsics - #770
Merged
nihalpasham merged 2 commits intoAug 10, 2026
Merged
Conversation
Collaborator
|
Gist: full delivery of #660, all 64 reduce variants at the same 1:1 wrapper layer as It has to wait for #721: this diff carries #721's entire commit, and the ABI ledger anchor at i0923 assumes #721 lands byte-identical. Labeled
Related to #604, which this makes more urgent: another positionally derived ID block just landed at |
Signed-off-by: Raul Estrada <[email protected]>
Rebuild resolve.rs, render.rs, and model.rs from origin/main's copies plus only the semantic hunks of the PR delta (git diff -w guided), so formatting matches main wherever the PR merely re-indented lines. git diff -w against the previous head is empty for all three files, proving no semantic change. resolve.rs shrinks from 806 to 674 changed lines vs main (the residual 66-line indent shift is rustfmt-forced by the new shard closure wrapping an existing struct literal); render.rs from 644 to 98; model.rs stays at its 61-line semantic floor.
nihalpasham
force-pushed
the
feat/intrinsics-tma-reduce-stacked
branch
from
August 10, 2026 07:35
81f5af7 to
da08ef7
Compare
nihalpasham
approved these changes
Aug 10, 2026
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.
Depends on #721.
Closes #660.
Summary
Add ABI-stable support for the 64
cp.reduce.async.bulk.tensorreduction variants across tile and im2col addressing modes.This PR is stacked on #721 (
cf96d6c2ae2e3869b6b95f863049cd6a4658fc88). Until #721 is merged, the GitHub diff againstmainalso includes its changes; the #660-specific delta is the single commit on top of that revision.Changes
Add 64 TMA tensor-reduction intrinsics covering:
add,and,dec,inc,max,min,or, andxor;Extend compact TMA admission with reduction-specific metadata and fail-closed validation.
Preserve schema 61 compatibility for existing TMA admissions while requiring schema 62 for TMA reductions.
Add ABI entries
i0923throughi0986.Add generated
cuda-deviceAPIs and dialect operations.Extend MIR importer and lowering support for TMA reductions.
Lower through:
Map Rust/LLVM
im2colforms to the PTXim2col_no_offsspelling.Add target gating for PTX 8.0 / SM90+.
Add 64 generated intrinsic probes.
Evidence
TMA reductions use dedicated evidence profiles rather than modifying the existing #721 TMA evidence:
rust-llvm-22.1.2-1cb4e383-tma-reducecuda-13.3-libnvvm-13.3.73-tma-reduceBoth selected backend routes were independently validated across all 64 variants.
LLVM TypedNvvm validation:
ptxas.libNVVM validation:
Hardware runtime execution was not performed; runtime validation remains
unexecuted.Generated artifacts
This change adds:
The catalog schema changes from 45 to 46. As a result, deterministic regeneration updates the catalog schema/hash header across existing generated files.
Of the 1019 modified tracked files:
These generated hash-only changes are intentionally retained so that the checked-in outputs exactly match
cuda-intrinsics-gen.Validation
cargo fmt --all -- --checkcargo run -p cuda-intrinsics-gen -- checkcargo run -p cuda-intrinsics-gen -- check-abi-history --base-ref cf96d6c2ae2e3869b6b95f863049cd6a4658fc88cargo test -p cuda-intrinsics-gencargo check -p cuda-intrinsics -p dialect-nvvm -p mir-importer -p mir-lower -p cuda-oxide-codegencargo test -p cuda-intrinsics -p dialect-nvvm -p mir-importer -p mir-lower -p cuda-oxide-codegencargo test --manifest-path crates/rustc-codegen-cuda/Cargo.tomlcargo clippy -p cuda-intrinsics-gen -p cuda-intrinsics -p dialect-nvvm -p mir-importer -p mir-lower -p cuda-oxide-codegen --all-targets -- -D warningsgit diff --checkAll commits signed off
Review note
Because this PR is stacked on #721, the intended #660 review range is:
cf96d6c2ae2e3869b6b95f863049cd6a4658fc88..81f5af7d28adb7d86e798d5623b2bc14f2969458