Repository navigation
feat: add ldmatrix warp-level shared memory matrix loads - #311
Merged
Merged
Conversation
49 tasks done
honeyspoon
force-pushed
the
add-ldmatrix-v2
branch
4 times, most recently
from
June 30, 2026 04:14
5929c5d to
d9a0ebc
Compare
nihalpasham
force-pushed
the
add-ldmatrix-v2
branch
from
July 1, 2026 08:57
d9a0ebc to
86e9a01
Compare
nihalpasham
force-pushed
the
add-ldmatrix-v2
branch
from
July 1, 2026 10:15
86e9a01 to
77b7b1e
Compare
Signed-off-by: nihalp <[email protected]>
Signed-off-by: nihalp <[email protected]>
Signed-off-by: nihalp <[email protected]>
Collaborator
|
Thanks for the PR. LGTM. I confirmed that all six A couple of points:
Reviewer note: This work partially addresses #274, which remains open. Runtime fragment values and performance were not tested on a GPU. |
nihalpasham
force-pushed
the
add-ldmatrix-v2
branch
from
July 1, 2026 10:39
77b7b1e to
0da4bfe
Compare
meefs
pushed a commit
to meefs/cuda-oxide
that referenced
this pull request
Sep 30, 2026
) Type inference rewrites a free-function call to a trait-dispatch wrapper (`load_tile_like(x, out)`) into the method call `x.load_tile_like(out)` before the inline compiler runs. The rewritten expression mixed tokens from two source texts (the user's receiver and arguments, the wrapper body's method name and parentheses) and a defaulted dot token, so `Spanned::span()` degraded to `Span::call_site()`, which the span base resolves to the module's first line. Every op of the inlined dispatch body was attributed to `mod ... {` instead of the call: no line-table rows for the call line, so a cuda-gdb breakpoint there slid to the next statement with code. The synthesized tokens now carry the user's call span, and the node-id marker attribute (the expression's first token) is anchored at the replaced call's span instead of the mixed expression's span. Unit test on the lowering and an end-to-end test on the compiled module's `load_view_tko` location (fails on main with `[module line]`). Found via Dmitry's debug_kernels report; the remaining misattributed lines in his trace (67-74 on the assert failure path) come from the assembler's assert lowering, not from our debug section; see the internal note. Signed-off-by: Melih Elibol <[email protected]>
7 tasks done
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.
Summary
Add all 6
ldmatrixvariants across all four compiler layers(cuda-device, dialect-nvvm, mir-importer, mir-lower):
ldmatrix_x1/ldmatrix_x1_trans: load 1 tile, returnsu32ldmatrix_x2/ldmatrix_x2_trans: load 2 tiles, returns[u32; 2]ldmatrix_x4/ldmatrix_x4_trans: load 4 tiles, returns[u32; 4]These are the warp-cooperative building blocks for loading matrix
fragments from shared memory in the layout expected by
mma.synctensor core instructions.
Design notes:
stmatrix): theimporter passes the destination slot pointer as an operand, and the
lowered inline PTX writes results directly to the slot via
st.b32cvta.to.sharedpointer conversion (shared memory 32-bit addressing)
Ref #274 (Phase 2: Matrix operations)
Test plan
cargo clippy -- -D warningsclean across all 4 cratescargo fmt --checkclean