Skip to content

Commit

Permalink
[mlir][gpu] Fix cuda integration tests
Browse files Browse the repository at this point in the history
https://reviews.llvm.org/D138758 has added `uniform` flag to gpu reduce ops, update integration tests.

Differential Revision: https://reviews.llvm.org/D140014
  • Loading branch information
Hardcode84 committed Dec 14, 2022
1 parent e45cf47 commit befd167
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion mlir/test/Integration/GPU/CUDA/all-reduce-and.mlir
Expand Up @@ -55,7 +55,7 @@ func.func @main() {
gpu.launch blocks(%bx, %by, %bz) in (%grid_x = %c2, %grid_y = %c1, %grid_z = %c1)
threads(%tx, %ty, %tz) in (%block_x = %c6, %block_y = %c1, %block_z = %c1) {
%val = memref.load %data[%bx, %tx] : memref<2x6xi32>
%reduced = gpu.all_reduce and %val {} : (i32) -> (i32)
%reduced = gpu.all_reduce and %val uniform {} : (i32) -> (i32)
memref.store %reduced, %sum[%bx] : memref<2xi32>
gpu.terminator
}
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Integration/GPU/CUDA/all-reduce-max.mlir
Expand Up @@ -55,7 +55,7 @@ func.func @main() {
gpu.launch blocks(%bx, %by, %bz) in (%grid_x = %c2, %grid_y = %c1, %grid_z = %c1)
threads(%tx, %ty, %tz) in (%block_x = %c6, %block_y = %c1, %block_z = %c1) {
%val = memref.load %data[%bx, %tx] : memref<2x6xi32>
%reduced = gpu.all_reduce max %val {} : (i32) -> (i32)
%reduced = gpu.all_reduce max %val uniform {} : (i32) -> (i32)
memref.store %reduced, %sum[%bx] : memref<2xi32>
gpu.terminator
}
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Integration/GPU/CUDA/all-reduce-min.mlir
Expand Up @@ -55,7 +55,7 @@ func.func @main() {
gpu.launch blocks(%bx, %by, %bz) in (%grid_x = %c2, %grid_y = %c1, %grid_z = %c1)
threads(%tx, %ty, %tz) in (%block_x = %c6, %block_y = %c1, %block_z = %c1) {
%val = memref.load %data[%bx, %tx] : memref<2x6xi32>
%reduced = gpu.all_reduce min %val {} : (i32) -> (i32)
%reduced = gpu.all_reduce min %val uniform {} : (i32) -> (i32)
memref.store %reduced, %sum[%bx] : memref<2xi32>
gpu.terminator
}
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Integration/GPU/CUDA/all-reduce-op.mlir
Expand Up @@ -28,7 +28,7 @@ func.func @main() {
%idx = arith.addi %tx, %t2 : index
%t3 = arith.index_cast %idx : index to i32
%val = arith.sitofp %t3 : i32 to f32
%sum = gpu.all_reduce add %val {} : (f32) -> (f32)
%sum = gpu.all_reduce add %val uniform {} : (f32) -> (f32)
memref.store %sum, %dst[%tz, %ty, %tx] : memref<?x?x?xf32>
gpu.terminator
}
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Integration/GPU/CUDA/all-reduce-or.mlir
Expand Up @@ -55,7 +55,7 @@ func.func @main() {
gpu.launch blocks(%bx, %by, %bz) in (%grid_x = %c2, %grid_y = %c1, %grid_z = %c1)
threads(%tx, %ty, %tz) in (%block_x = %c6, %block_y = %c1, %block_z = %c1) {
%val = memref.load %data[%bx, %tx] : memref<2x6xi32>
%reduced = gpu.all_reduce or %val {} : (i32) -> (i32)
%reduced = gpu.all_reduce or %val uniform {} : (i32) -> (i32)
memref.store %reduced, %sum[%bx] : memref<2xi32>
gpu.terminator
}
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Integration/GPU/CUDA/all-reduce-region.mlir
Expand Up @@ -20,7 +20,7 @@ func.func @main() {
gpu.launch blocks(%bx, %by, %bz) in (%grid_x = %one, %grid_y = %one, %grid_z = %one)
threads(%tx, %ty, %tz) in (%block_x = %sx, %block_y = %one, %block_z = %one) {
%val = arith.index_cast %tx : index to i32
%xor = gpu.all_reduce %val {
%xor = gpu.all_reduce %val uniform {
^bb(%lhs : i32, %rhs : i32):
%xor = arith.xori %lhs, %rhs : i32
"gpu.yield"(%xor) : (i32) -> ()
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Integration/GPU/CUDA/all-reduce-xor.mlir
Expand Up @@ -55,7 +55,7 @@ func.func @main() {
gpu.launch blocks(%bx, %by, %bz) in (%grid_x = %c2, %grid_y = %c1, %grid_z = %c1)
threads(%tx, %ty, %tz) in (%block_x = %c6, %block_y = %c1, %block_z = %c1) {
%val = memref.load %data[%bx, %tx] : memref<2x6xi32>
%reduced = gpu.all_reduce xor %val {} : (i32) -> (i32)
%reduced = gpu.all_reduce xor %val uniform {} : (i32) -> (i32)
memref.store %reduced, %sum[%bx] : memref<2xi32>
gpu.terminator
}
Expand Down
4 changes: 2 additions & 2 deletions mlir/test/Integration/GPU/CUDA/multiple-all-reduce.mlir
Expand Up @@ -58,9 +58,9 @@ func.func @main() {
gpu.launch blocks(%bx, %by, %bz) in (%grid_x = %c2, %grid_y = %c1, %grid_z = %c1)
threads(%tx, %ty, %tz) in (%block_x = %c6, %block_y = %c1, %block_z = %c1) {
%val = memref.load %data[%bx, %tx] : memref<2x6xf32>
%reduced0 = gpu.all_reduce add %val {} : (f32) -> (f32)
%reduced0 = gpu.all_reduce add %val uniform {} : (f32) -> (f32)
memref.store %reduced0, %sum[%bx] : memref<2xf32>
%reduced1 = gpu.all_reduce mul %val {} : (f32) -> (f32)
%reduced1 = gpu.all_reduce mul %val uniform {} : (f32) -> (f32)
memref.store %reduced1, %mul[%bx] : memref<2xf32>
gpu.terminator
}
Expand Down

0 comments on commit befd167

Please sign in to comment.