Skip to content

[mlir] Add description to amdgpu.dpp and rocdl.update.dpp #116598

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

knwng
Copy link
Contributor

@knwng knwng commented Nov 18, 2024

Add description to amdgpu.dpp and rocdl.update.dpp to explain their behaviors.

Copy link

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 @ followed by their GitHub username.

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.

@knwng
Copy link
Contributor Author

knwng commented Nov 18, 2024

@antiagainst Not sure a doc update is too trivial to be merged in MLIR. If so, it can be coalesced with other PR, e.g. gpu::shuffle lowering using dpp.

@llvmbot
Copy link
Member

llvmbot commented Nov 18, 2024

@llvm/pr-subscribers-mlir-gpu
@llvm/pr-subscribers-mlir-llvm
@llvm/pr-subscribers-mlir-amdgpu

@llvm/pr-subscribers-backend-amdgpu

Author: Kyle Wang (knwng)

Changes

Add description to amdgpu.dpp and rocdl.update.dpp to explain their behaviors.


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

2 Files Affected:

  • (modified) mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td (+5)
  • (modified) mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td (+9)
diff --git a/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td b/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td
index 69745addfd748e..cb25655cc29eb8 100644
--- a/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td
+++ b/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td
@@ -437,6 +437,11 @@ def AMDGPU_DPPOp : AMDGPU_Op<"dpp", [SameTypeOperands, AllTypesMatch<["result",
   let summary = "AMDGPU DPP operation";
   let description = [{
     This operation represents DPP functionality in a GPU program.
+
+    The behavior should be equivalent to:
+    v_mov_b32 `result` `old`
+    v_mov_b32 `result` `src` `kind` `row_mask` `bank_mask` `bound_ctrl`
+
      DPP provides the following operations:
     - Full crossbar in a group of four (`quad_perm`)
     - Wavefront shift left by one lane (`wave_shl`)
diff --git a/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td b/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
index 3695708439d91f..a2a86a3a8a2cf0 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
@@ -621,6 +621,15 @@ def ROCDL_DPPUpdateOp : ROCDL_IntrOp<"update.dpp", [], [0],
   Arguments<(ins LLVM_Type:$old, LLVM_Type:$src, I32Attr:$dppCtrl, I32Attr:$rowMask,
       I32Attr:$bankMask, I1Attr:$boundCtrl)> {
   let results = (outs LLVM_Type:$res);
+  let summary = "Represent the DPP(Data-Parallel Primitives) functionality";
+  let description = [{
+    Represent the DPP(Data-Parallel Primitives) functionality,
+    which supports cross-lane data operations.
+
+    The behavior should be equivalent to:
+    v_mov_b32 `res` `old`
+    v_mov_b32 `res` `src` `dppCtrl` `rowMask` `bankMask` `boundCtrl`
+  }];
   let assemblyFormat = [{
     attr-dict $old `,` $src `with` $dppCtrl `,` $rowMask `,` $bankMask `,` $boundCtrl `:` type($src)
   }];

@llvmbot
Copy link
Member

llvmbot commented Nov 18, 2024

@llvm/pr-subscribers-mlir

Author: Kyle Wang (knwng)

Changes

Add description to amdgpu.dpp and rocdl.update.dpp to explain their behaviors.


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

2 Files Affected:

  • (modified) mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td (+5)
  • (modified) mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td (+9)
diff --git a/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td b/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td
index 69745addfd748e..cb25655cc29eb8 100644
--- a/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td
+++ b/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td
@@ -437,6 +437,11 @@ def AMDGPU_DPPOp : AMDGPU_Op<"dpp", [SameTypeOperands, AllTypesMatch<["result",
   let summary = "AMDGPU DPP operation";
   let description = [{
     This operation represents DPP functionality in a GPU program.
+
+    The behavior should be equivalent to:
+    v_mov_b32 `result` `old`
+    v_mov_b32 `result` `src` `kind` `row_mask` `bank_mask` `bound_ctrl`
+
      DPP provides the following operations:
     - Full crossbar in a group of four (`quad_perm`)
     - Wavefront shift left by one lane (`wave_shl`)
diff --git a/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td b/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
index 3695708439d91f..a2a86a3a8a2cf0 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
@@ -621,6 +621,15 @@ def ROCDL_DPPUpdateOp : ROCDL_IntrOp<"update.dpp", [], [0],
   Arguments<(ins LLVM_Type:$old, LLVM_Type:$src, I32Attr:$dppCtrl, I32Attr:$rowMask,
       I32Attr:$bankMask, I1Attr:$boundCtrl)> {
   let results = (outs LLVM_Type:$res);
+  let summary = "Represent the DPP(Data-Parallel Primitives) functionality";
+  let description = [{
+    Represent the DPP(Data-Parallel Primitives) functionality,
+    which supports cross-lane data operations.
+
+    The behavior should be equivalent to:
+    v_mov_b32 `res` `old`
+    v_mov_b32 `res` `src` `dppCtrl` `rowMask` `bankMask` `boundCtrl`
+  }];
   let assemblyFormat = [{
     attr-dict $old `,` $src `with` $dppCtrl `,` $rowMask `,` $bankMask `,` $boundCtrl `:` type($src)
   }];

@knwng knwng requested a review from antiagainst November 19, 2024 10:02
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.

4 participants