Repository navigation
docs(wgmma): finalize value-threaded pipeline integration - #689
Merged
nihalpasham merged 8 commits intoAug 8, 2026
Merged
Conversation
Signed-off-by: Raul Estrada <[email protected]>
Signed-off-by: Raul Estrada <[email protected]>
Signed-off-by: Raul Estrada <[email protected]>
Signed-off-by: Raul Estrada <[email protected]>
Signed-off-by: Raul Estrada <[email protected]>
Signed-off-by: Raul Estrada <[email protected]>
… pipeline pass Same shapes fixed on the 686/687/688 branches: two question-mark rewrites, one redundant into_iter, and the house-style too_many_arguments allow on apply_value_plan; keeps this head's clippy CI green until the stack rebase collapses the shared file.
Collaborator
|
Gist: Step 6 closes the series: the public WGMMA docs now describe what the compiler actually does after steps 2 through 5, and a new compile-only kernel drives the partial-wait path through the entire Rust-to-PTX pipeline. #605's plan is delivered end to end. Verified after the stack rebase:
Closes #605 (and the docs half of #399's ask). Merging last. |
nihalpasham
approved these changes
Aug 8, 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.
Fixes #605
This PR is the sixth and final PR in the planned series for #605 and builds on
the partial-wait pipeline support introduced by #688.
Summary
Finalize the public integration, end-to-end coverage, and documentation for the
value-threaded BF16 WGMMA lowering path.
The compiler-side implementation from the preceding PRs now supports three
conservative shapes:
wait_group<0>;in flight.
This PR updates the public WGMMA contract and examples to match those
capabilities and adds a source-level compile-only example that exercises
wait_group<1>through the complete Rust-to-PTX pipeline.No new WGMMA lowering representation or selection algorithm is introduced
here.
Motivation
The previous PRs established the value-threaded implementation incrementally:
After those changes, the public documentation and compile-only BF16 example
still described the original deferred implementation:
and still stated that partial waits, multiple accumulators, and loop-spanning
lifetimes were unsupported.
This PR brings those surfaces in sync with the implemented compiler behavior.
Public lowering contract
The
cuda_device::wgmmadocumentation now describes the three supported BF16m64n64k16.f32.bf16.bf16lowering shapes.Linear full drain
A canonical
[[f32; 8]; 4]accumulator is adapted to 32 SSAf32values,processed inside one convergent WGMMA lifetime, and stored only after the final
wait_group<0>.Unsupported full-drain pointer shapes retain the existing deferred pointer-form
fallback when that sequence can still be proven safe.
Canonical counted K-loop
A restricted compile-time counted loop with one MMA per iteration and affine
u64descriptor recurrences is fused into one convergent inline-PTX region.The accumulator therefore crosses the complete K-loop as register-carried
values instead of paying an accumulator load/store round trip on every
iteration.
Static partial-wait pipeline
A static:
with
1 <= N <= 7uses:independent canonical accumulator slots.
Committed groups may remain in flight, accumulator slots are reused only after
the corresponding partial wait makes reuse safe, and every accepted pipeline
ends with a mandatory:
before accumulator values escape.
Unsupported or unprovable shapes remain fail-closed.
End-to-end example
Extend the existing
wgmma_mma_bf16compile-only example with a second kernelthat exercises two independent accumulator slots:
This exercises the public API through:
The example intentionally uses zero-valued descriptors and remains compile-only;
it must not be launched.
The longer round-robin accumulator reuse schedule remains covered by the
mir-lowerintegration tests added in #688.Documentation
Update:
cuda_device::wgmmamodule documentation and safety/lowering contract;wgmma_mma_bf16example and README;The documentation now explicitly describes value-threaded full drains,
register-resident counted loops, static partial waits, the deferred fallback,
and fail-closed behavior.
Validation
The compiler regression gate remains green:
Both backend carrier probes remain green:
The WGMMA smoketest also passes both selected examples:
The updated public-API example reports:
git diff --checkis clean.Scope
This PR intentionally does not add another WGMMA compiler transformation.
In particular, it does not:
wait_groupvalues;Those remain separate extensions beyond the scope of #605.