Skip to content
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

[Codegen][GPU] Add pass to expand multi_mma op shapes to intrinsic layout #18139

Merged
merged 4 commits into from
Aug 7, 2024

Conversation

Max191
Copy link
Contributor

@Max191 Max191 commented Aug 7, 2024

This PR adds a new pass to explicitly materialize the dimensions of intrinsic layouts for iree_gpu.multi_mma ops. This means adding an expand_shape on each of the inputs to go from the OpaqueMmaLayout shape to the ConcreteMmaLayout shape. This makes it easy to extract the correct data from the tensors when it is time to distribute the multi_mma op to lanes, since the shape will match the number of offsets and sizes needed for the slice.

…yout

Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
@Max191 Max191 requested a review from qedawkins August 7, 2024 16:46
Copy link
Contributor

@qedawkins qedawkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, a couple quick comments

let dependentDialects = [
"::mlir::tensor::TensorDialect",
"::mlir::iree_compiler::IREE::GPU::IREEGPUDialect",
"::mlir::iree_compiler::IREE::VectorExt::IREEVectorExtDialect",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need a VectorExt dep here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getConcreteMFMALayout generates some PerDimLayoutAttr which are unused, but I didn't want to refactor the whole function, so I just added the dependent dialect.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gah, that's a pain. Can you add a TODO somewhere to drop that dependency?

Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
@Max191 Max191 requested a review from qedawkins August 7, 2024 20:17
Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
@Max191 Max191 enabled auto-merge (squash) August 7, 2024 20:28
@Max191 Max191 merged commit 235e110 into iree-org:main Aug 7, 2024
43 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants