-
Notifications
You must be signed in to change notification settings - Fork 631
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
[VectorDistribution] Configure contraction layouts at linalg level #18152
Conversation
compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUConfigureTensorLayouts.cpp
Outdated
Show resolved
Hide resolved
3e9a393
to
1c682aa
Compare
1c682aa
to
9e447e0
Compare
7ca27d2
to
94e2d15
Compare
a0a590e
to
cee09be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This overall approach looks fine to me w/ a few comments. I would also make sure the right guard rails are in place so that compilation fails if a vector.contraction
op fails to end up with a layout (i.e. vector_ext.to_layout
gets disconnected from the vector.contract
somehow).
compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUConfigureTensorLayouts.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUConfigureTensorLayouts.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUConfigureTensorLayouts.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUConfigureTensorLayouts.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/LLVMGPU/test/configure_tensor_layout.mlir
Show resolved
Hide resolved
I'm not sure what kind of guard rails you are looking for. I could make the distribution patterns for vector.contract check if it's getting the right layout for the contraction. What do you think? |
Paging this pipeline back into memory, if a |
compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUConfigureTensorLayouts.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUConfigureTensorLayouts.cpp
Outdated
Show resolved
Hide resolved
For documentation purposes: (so I don't need to regain context if I am reading this PR again in the future)
LMK if anything here is missing. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks great! Just some last Qs.
[No action needed here]: I think I'd have preferred two constructors over |
Looks like vmfb is not being generated for the MI300 SDXL test as seen on here, maybe we need to remove attention pipeline from the TD tuning script, since we are introducing new way to anchor the layouts. CC: @saienduri |
That's an issue with the cache, unrelated to this pr. See: https://discord.com/channels/689900678990135345/1166024193599615006/1276556104515584032 |
#18336 for the cache issue |
Good to know! thanks guys :) |
4530be0
to
fea5dd4
Compare
It didn't before, but I just added a check that does this check. So that should be enough for ensuring the layout matches thee intrinsic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks!
This patch moves layout anchoring for contractions to linalg level. This is primarily motivated by allowing us to decide layouts based on lowering_config.
Future patches will also move the transfer_read anchoring to linalg level.