|
| 1 | +// RUN: triton-opt %s -split-input-file --intel-allocate-shared-memory | FileCheck %s |
| 2 | + |
| 3 | +#blocked = #triton_gpu.blocked<{sizePerThread = [1, 16], threadsPerWarp = [16, 1], warpsPerCTA = [1, 1], order = [0, 1]}> |
| 4 | +#blocked1 = #triton_gpu.blocked<{sizePerThread = [16, 1], threadsPerWarp = [1, 16], warpsPerCTA = [1, 1], order = [0, 1]}> |
| 5 | + |
| 6 | +// Check no scratch memory is allocated for sub-group shuffle-like layout conversions. |
| 7 | + |
| 8 | +// CHECK-LABEL: module attributes |
| 9 | +// CHECK-SAME: triton_gpu.shared = 0 : i32 |
| 10 | +module attributes {"triton_gpu.num-ctas" = 1 : i32, "triton_gpu.num-warps" = 1 : i32, "triton_gpu.threads-per-warp" = 16 : i32} { |
| 11 | + // CHECK: tt.func @test_sub_group_shuffle |
| 12 | + // CHECK-NOT: llvm.ptr<3> |
| 13 | + tt.func @test_sub_group_shuffle(%arg0: tensor<16xf16, #triton_gpu.slice<{dim = 1, parent = #blocked}>>) -> tensor<16xf16, #triton_gpu.slice<{dim = 1, parent = #blocked1}>> { |
| 14 | + %0 = triton_gpu.convert_layout %arg0 : tensor<16xf16, #triton_gpu.slice<{dim = 1, parent = #blocked}>> -> tensor<16xf16, #triton_gpu.slice<{dim = 1, parent = #blocked1}>> |
| 15 | + tt.return %0 : tensor<16xf16, #triton_gpu.slice<{dim = 1, parent = #blocked1}>> |
| 16 | + } |
| 17 | +} |
| 18 | + |
| 19 | +// ----- |
| 20 | + |
| 21 | +#blocked = #triton_gpu.blocked<{sizePerThread = [16, 1], threadsPerWarp = [1, 16], warpsPerCTA = [1, 1], order = [0, 1]}> |
| 22 | +#blocked1 = #triton_gpu.blocked<{sizePerThread = [1, 16], threadsPerWarp = [16, 1], warpsPerCTA = [1, 1], order = [0, 1]}> |
| 23 | + |
| 24 | +// Check scracth memory configuration for different sub-group transpose-like layout conversions. |
| 25 | + |
| 26 | +// CHECK-LABEL: module attributes |
| 27 | +// CHECK-SAME: triton_gpu.shared = 512 : i32 |
| 28 | +module attributes {"triton_gpu.num-ctas" = 1 : i32, "triton_gpu.num-warps" = 1 : i32, "triton_gpu.threads-per-warp" = 16 : i32} { |
| 29 | + tt.func @test_f16(%arg0: tensor<16x16xf16, #blocked>) -> tensor<16x16xf16, #blocked1> { |
| 30 | + %0 = triton_gpu.convert_layout %arg0 : tensor<16x16xf16, #blocked> -> tensor<16x16xf16, #blocked1> |
| 31 | + tt.return %0 : tensor<16x16xf16, #blocked1> |
| 32 | + } |
| 33 | +} |
| 34 | + |
| 35 | +// ----- |
| 36 | + |
| 37 | +#blocked = #triton_gpu.blocked<{sizePerThread = [16, 1], threadsPerWarp = [1, 16], warpsPerCTA = [1, 1], order = [0, 1]}> |
| 38 | +#blocked1 = #triton_gpu.blocked<{sizePerThread = [1, 16], threadsPerWarp = [16, 1], warpsPerCTA = [1, 1], order = [0, 1]}> |
| 39 | + |
| 40 | +// Check scracth memory configuration for different sub-group transpose-like layout conversions. |
| 41 | + |
| 42 | +// CHECK-LABEL: module attributes |
| 43 | +// CHECK-SAME: triton_gpu.shared = 1024 : i32 |
| 44 | +module attributes {"triton_gpu.num-ctas" = 1 : i32, "triton_gpu.num-warps" = 1 : i32, "triton_gpu.threads-per-warp" = 16 : i32} { |
| 45 | + tt.func @test_f32(%arg0: tensor<16x16xf32, #blocked>) -> tensor<16x16xf32, #blocked1> { |
| 46 | + %0 = triton_gpu.convert_layout %arg0 : tensor<16x16xf32, #blocked> -> tensor<16x16xf32, #blocked1> |
| 47 | + tt.return %0 : tensor<16x16xf32, #blocked1> |
| 48 | + } |
| 49 | +} |
| 50 | + |
| 51 | +// ----- |
| 52 | + |
| 53 | +#blocked = #triton_gpu.blocked<{sizePerThread = [16, 1], threadsPerWarp = [1, 16], warpsPerCTA = [4, 2], order = [0, 1]}> |
| 54 | +#blocked1 = #triton_gpu.blocked<{sizePerThread = [1, 16], threadsPerWarp = [16, 1], warpsPerCTA = [4, 2], order = [0, 1]}> |
| 55 | + |
| 56 | +// Check scracth memory configuration for different sub-group transpose-like layout conversions. |
| 57 | + |
| 58 | +// CHECK-LABEL: module attributes |
| 59 | +// CHECK-SAME: triton_gpu.shared = 32768 : i32 |
| 60 | +module attributes {"triton_gpu.num-ctas" = 1 : i32, "triton_gpu.num-warps" = 8 : i32, "triton_gpu.threads-per-warp" = 16 : i32} { |
| 61 | + tt.func @test_f32(%arg0: tensor<128x64xf32, #blocked>) -> tensor<128x64xf32, #blocked1> { |
| 62 | + %0 = triton_gpu.convert_layout %arg0 : tensor<128x64xf32, #blocked> -> tensor<128x64xf32, #blocked1> |
| 63 | + tt.return %0 : tensor<128x64xf32, #blocked1> |
| 64 | + } |
| 65 | +} |
0 commit comments