-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[mlir][ROCDL] Add tensor load and store instructions to ROCDL #165016
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kuhar
merged 7 commits into
llvm:main
from
justinrosner:justinr-rocdl-tensor-load-store
Oct 28, 2025
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1bea035
[mlir][ROCDL] Add tensor load and store instructions to ROCDL
justinrosner 983aff0
Merge branch 'main' into justinr-rocdl-tensor-load-store
justinrosner 2fcb81e
Update Arg types
justinrosner c966631
Remove mem properties
justinrosner 04c5172
Update LIT tests and add description to ops
justinrosner 0bcaa1f
Attend to more review comments
justinrosner 2c70cf5
Add back unique types to assembly string
justinrosner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -663,6 +663,50 @@ def ROCDL_GlobalLoadLDSOp : | |
| }]; | ||
| } | ||
|
|
||
| //===---------------------------------------------------------------------===// | ||
| // Tensor load/store intrinsics (available in GFX1250) | ||
| //===---------------------------------------------------------------------===// | ||
|
|
||
| // Base class for tensor load/store operations with 4 descriptor groups | ||
| class ROCDL_TensorLDSIntrOp<string mnemonic> : | ||
| ROCDL_IntrOp<mnemonic, [], [], [], 0, 0, 1, 0, [4], ["cachePolicy"]> { | ||
| dag args = (ins LLVM_Type:$dgroup0, LLVM_Type:$dgroup1, LLVM_Type:$dgroup2, | ||
kuhar marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| LLVM_Type:$dgroup3, I32Attr:$cachePolicy); | ||
| let arguments = !con(args, baseArgs); | ||
| let assemblyFormat = [{ | ||
| $dgroup0 `,` $dgroup1 `,` $dgroup2 `,` $dgroup3 `,` $cachePolicy | ||
| attr-dict `:` type($dgroup0) `,` type($dgroup1) `,` type($dgroup2) `,` type($dgroup3) | ||
| }]; | ||
kuhar marked this conversation as resolved.
Show resolved
Hide resolved
ravil-mobile marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| let extraClassDefinition = [{ | ||
| ::llvm::SmallVector<::mlir::Value> $cppClass::getAccessedOperands() { | ||
kuhar marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| return {getDgroup0(), getDgroup1(), getDgroup2(), getDgroup3()}; | ||
| } | ||
| }]; | ||
| } | ||
|
|
||
| // Base class for tensor load/store operations with 2 descriptor groups | ||
| // (D2 variant) | ||
kuhar marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| class ROCDL_TensorLDSIntrD2Op<string mnemonic> : | ||
| ROCDL_IntrOp<mnemonic, [], [], [], 0, 0, 1, 0, [2], ["cachePolicy"]> { | ||
| dag args = (ins LLVM_Type:$dgroup0, LLVM_Type:$dgroup1, I32Attr:$cachePolicy); | ||
| let arguments = !con(args, baseArgs); | ||
| let assemblyFormat = [{ | ||
| $dgroup0 `,` $dgroup1 `,` $cachePolicy | ||
| attr-dict `:` type($dgroup0) `,` type($dgroup1) | ||
| }]; | ||
| let extraClassDefinition = [{ | ||
| ::llvm::SmallVector<::mlir::Value> $cppClass::getAccessedOperands() { | ||
|
||
| return {getDgroup0(), getDgroup1()}; | ||
| } | ||
| }]; | ||
| } | ||
|
|
||
| // Tensor load and store operations | ||
| def ROCDL_TensorLoadToLDSOp : ROCDL_TensorLDSIntrOp<"tensor.load.to.lds">; | ||
| def ROCDL_TensorStoreFromLDSOp : ROCDL_TensorLDSIntrOp<"tensor.store.from.lds">; | ||
| def ROCDL_TensorLoadToLDSD2Op : ROCDL_TensorLDSIntrD2Op<"tensor.load.to.lds.d2">; | ||
| def ROCDL_TensorStoreFromLDSD2Op : ROCDL_TensorLDSIntrD2Op<"tensor.store.from.lds.d2">; | ||
|
|
||
| //===---------------------------------------------------------------------===// | ||
| // Operations on raw buffer resources (stride of 0, bounds checks either off or in | ||
| // raw buffer mode). | ||
|
|
||
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.