-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AMD] Refactor decompose-unsupported-amd-conversions pass
This PR: - Simplifying pass code, reusing common code - Introduces supports 3d tensors in mfma -> dot conversion(supported in common code from item above) - Adds more lit tests for decompose-unsupported-amd-conversions pass
- Loading branch information
Showing
3 changed files
with
76 additions
and
101 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
test/Conversion/amd/decompose-unsupported-conversions-gfx9.mlir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// RUN: triton-opt %s --split-input-file --decompose-unsupported-amd-conversions=arch=gfx942 | FileCheck %s | ||
|
||
// CHECK: #[[DST_ENC:.+]] = #triton_gpu.blocked<{{.*}}> | ||
// CHECK: #[[SRC_ENC:.+]] = #triton_gpu.amd_mfma<{{.*}}> | ||
// CHECK: #[[TMP_ENC:.+]] = #triton_gpu.amd_mfma<{{.*}}> | ||
// CHECK: large_tensor_conversion | ||
#src = #triton_gpu.amd_mfma<{versionMajor = 3, versionMinor = 0, warpsPerCTA = [1, 4], instrShape = [32, 32], isTransposed = false}> | ||
#dst = #triton_gpu.blocked<{sizePerThread = [4, 1], threadsPerWarp = [8, 8], warpsPerCTA = [4, 1], order = [1, 0]}> | ||
module attributes {"triton_gpu.num-ctas" = 1 : i32, "triton_gpu.num-warps" = 4 : i32, "triton_gpu.threads-per-warp" = 64 : i32} { | ||
tt.func @large_tensor_conversion(%arg0: tensor<128x128xf32, #src>) { | ||
// CHECK: %0 = triton_gpu.convert_layout %arg0 : tensor<128x128xf32, #[[SRC_ENC]]> -> tensor<128x128xf32, #[[TMP_ENC]]> | ||
// CHECK: %1 = triton_gpu.convert_layout %0 : tensor<128x128xf32, #[[TMP_ENC]]> -> tensor<128x128xf32, #[[DST_ENC]]> | ||
%0 = triton_gpu.convert_layout %arg0 : tensor<128x128xf32, #src> -> tensor<128x128xf32, #dst> | ||
tt.return | ||
} | ||
} | ||
|
||
// ----- | ||
|
||
// CHECK: #[[DST_ENC:.+]] = #triton_gpu.blocked<{{.*}}> | ||
// CHECK: #[[SRC_ENC:.+]] = #triton_gpu.amd_mfma<{{.*}}> | ||
// CHECK: #[[TMP_ENC:.+]] = #triton_gpu.amd_mfma<{{.*}}> | ||
// CHECK: large_tensor_3d_conversion | ||
#src = #triton_gpu.amd_mfma<{versionMajor = 3, versionMinor = 0, warpsPerCTA = [2, 1, 2], instrShape = [32, 32], isTransposed = false}> | ||
#dst = #triton_gpu.blocked<{sizePerThread = [1, 1, 1], threadsPerWarp = [1, 64, 1], warpsPerCTA = [2, 2, 1], order = [2, 1, 0]}> | ||
module attributes {"triton_gpu.num-ctas" = 1 : i32, "triton_gpu.num-warps" = 4 : i32, "triton_gpu.threads-per-warp" = 64 : i32} { | ||
tt.func @large_tensor_3d_conversion(%arg0: tensor<2x128x64xf32, #src>) { | ||
// CHECK: %0 = triton_gpu.convert_layout %arg0 : tensor<2x128x64xf32, #[[SRC_ENC]]> -> tensor<2x128x64xf32, #[[TMP_ENC]]> | ||
// CHECK: %1 = triton_gpu.convert_layout %0 : tensor<2x128x64xf32, #[[TMP_ENC]]> -> tensor<2x128x64xf32, #[[DST_ENC]]> | ||
%0 = triton_gpu.convert_layout %arg0 : tensor<2x128x64xf32, #src> -> tensor<2x128x64xf32, #dst> | ||
tt.return | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters