Skip to content

[mlir][xegpu] Patch dynamic descriptor creation #93580

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
merged 1 commit into from
Jun 5, 2024

Conversation

akroviakov
Copy link
Contributor

This brief PR fixes the bug in XeGPU's CreateNdDescOp tensor creation with dynamic offset and strides.

@llvmbot
Copy link
Member

llvmbot commented May 28, 2024

@llvm/pr-subscribers-mlir

Author: Artem Kroviakov (akroviakov)

Changes

This brief PR fixes the bug in XeGPU's CreateNdDescOp tensor creation with dynamic offset and strides.


Full diff: https://github.com/llvm/llvm-project/pull/93580.diff

1 Files Affected:

  • (modified) mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp (+1-1)
diff --git a/mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp b/mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp
index 22959224d56c2..37904f55cc23a 100644
--- a/mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp
+++ b/mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp
@@ -110,7 +110,7 @@ void CreateNdDescOp::build(OpBuilder &builder, OperationState &state,
 
   dispatchIndexOpFoldResults(offsets, dynamicOffsets, staticOffsets);
   dispatchIndexOpFoldResults(shape, dynamicShape, staticShape);
-  dispatchIndexOpFoldResults(strides, dynamicStrides, staticOffsets);
+  dispatchIndexOpFoldResults(strides, dynamicStrides, dynamicOffsets);
 
   auto staticOffsetsAttr = builder.getDenseI64ArrayAttr(staticOffsets);
   auto staticShapeAttr = builder.getDenseI64ArrayAttr(staticShape);

@llvmbot
Copy link
Member

llvmbot commented May 28, 2024

@llvm/pr-subscribers-mlir-gpu

Author: Artem Kroviakov (akroviakov)

Changes

This brief PR fixes the bug in XeGPU's CreateNdDescOp tensor creation with dynamic offset and strides.


Full diff: https://github.com/llvm/llvm-project/pull/93580.diff

1 Files Affected:

  • (modified) mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp (+1-1)
diff --git a/mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp b/mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp
index 22959224d56c2..37904f55cc23a 100644
--- a/mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp
+++ b/mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp
@@ -110,7 +110,7 @@ void CreateNdDescOp::build(OpBuilder &builder, OperationState &state,
 
   dispatchIndexOpFoldResults(offsets, dynamicOffsets, staticOffsets);
   dispatchIndexOpFoldResults(shape, dynamicShape, staticShape);
-  dispatchIndexOpFoldResults(strides, dynamicStrides, staticOffsets);
+  dispatchIndexOpFoldResults(strides, dynamicStrides, dynamicOffsets);
 
   auto staticOffsetsAttr = builder.getDenseI64ArrayAttr(staticOffsets);
   auto staticShapeAttr = builder.getDenseI64ArrayAttr(staticShape);

@Garra1980
Copy link

cc @chencha3

@adam-smnk adam-smnk requested a review from chencha3 May 31, 2024 10:39
@akroviakov akroviakov force-pushed the patch-xegpu-createnddesc branch from 61d0c77 to bd8c26a Compare June 5, 2024 16:07
Copy link
Contributor

@adam-smnk adam-smnk left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the fix!

I guess XeGPU op verifier is too simple.
@chencha3 we should probably look into that in a separate PR

@chencha3
Copy link
Contributor

chencha3 commented Jun 5, 2024

Thanks a lot for the fix!

I guess XeGPU op verifier is too simple. @chencha3 we should probably look into that in a separate PR

Yes, you are right. Currently some parameters of XeGPU ops are architecture specific, and we left them checked by an arch class in downstream. We need to rethink this part.

Copy link
Contributor

@chencha3 chencha3 left a comment

Choose a reason for hiding this comment

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

LGTM

@chencha3 chencha3 merged commit 73a2fd4 into llvm:main Jun 5, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants