[MLIR][NVVM] Align the PTX string for StMatrixOp with the docs#148250
[MLIR][NVVM] Align the PTX string for StMatrixOp with the docs#148250Pecco-314 wants to merge 3 commits into
Conversation
|
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
|
@llvm/pr-subscribers-mlir @llvm/pr-subscribers-mlir-llvm Author: Pecco (Pecco-314) ChangesAccording to the PTX documents, the syntax of stmatrix should be: However, the current code will generate the PTX like "stmatrix.sync.aligned.x4.m8n8.shared.b16". It seems like a bug. Full diff: https://github.com/llvm/llvm-project/pull/148250.diff 1 Files Affected:
diff --git a/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
index 6895e946b8a45..b27c03ec2c63f 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
@@ -2000,13 +2000,13 @@ def NVVM_StMatrixOp: NVVM_PTXBuilder_Op<"stmatrix">,
let extraClassDefinition = [{
std::string $cppClass::getPtx() {
int d = getSources().size();
- std::string ptx = "stmatrix.sync.aligned";
+ std::string ptx = "stmatrix.sync.aligned.m8n8";
ptx += ".x" + std::to_string(d);
if (getLayout() == NVVM::MMALayout::col)
ptx += ".trans";
- if(d == 1) ptx += ".m8n8.shared.b16 [%0], {%1};";
- if(d == 2) ptx += ".m8n8.shared.b16 [%0], {%1, %2};";
- if(d == 4) ptx += ".m8n8.shared.b16 [%0], {%1, %2, %3, %4};";
+ if(d == 1) ptx += ".shared.b16 [%0], {%1};";
+ if(d == 2) ptx += ".shared.b16 [%0], {%1, %2};";
+ if(d == 4) ptx += ".shared.b16 [%0], {%1, %2, %3, %4};";
return ptx;
}
}];
|
|
LGTM, |
durga4github
left a comment
There was a problem hiding this comment.
Slightly updated the commit message.
LGTM.
Thanks for the patch!
|
This PR is covered by #148377 and can be closed. |
According to the PTX documents, the syntax of stmatrix should be:
However, the current code will generate the PTX like "stmatrix.sync.aligned.x4.m8n8.shared.b16".
Though the existing syntax works, it is cleaner to align the lowering with the docs.