Skip to content

Commit 299fed6

Browse files
ThomasRaouxguacamoleo
authored andcommitted
Revert "[BACKEND] Add barrier after assert op to avoid race condition" (triton-lang#5047)
Reverts triton-lang#5035
1 parent 9a6219b commit 299fed6

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

lib/Conversion/TritonGPUToLLVM/AssertOpToLLVM.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ struct AssertOpConversion : public ConvertOpToLLVMPattern<triton::AssertOp> {
3535
}
3636
}
3737
llAssert(op, condition, adaptor.getMessage(), rewriter);
38-
// Add a barrier to avoid a race condition in case an assert is followed by
39-
// an op that may trap if the assert condition is true. Since the tensor in
40-
// those two operations may have different layout we need to make sure all
41-
// the threads are done executing the assert before going to the next op.
42-
barrier();
4338
rewriter.eraseOp(op);
4439
return success();
4540
}

test/Conversion/tritongpu_to_llvm.mlir

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,8 +1906,6 @@ module attributes {"triton_gpu.num-ctas" = 1 : i32, "triton_gpu.num-warps" = 4 :
19061906
// CHECK-DAG: llvm.mlir.global internal constant @assertFunc_0("unknown\00") {addr_space = 0 : i32}
19071907
// CHECK-DAG: llvm.mlir.global internal constant @assertFile_0("inner_call\00") {addr_space = 0 : i32}
19081908
// CHECK-DAG: llvm.mlir.global internal constant @assertMessage_0("assert text\00") {addr_space = 0 : i32}
1909-
// CHECK: llvm.call @__assertfail
1910-
// CHECK: nvvm.barrier0
19111909
module attributes {"triton_gpu.num-ctas" = 1 : i32, "triton_gpu.num-warps" = 4 : i32, triton_gpu.target = "cuda:90", "triton_gpu.threads-per-warp" = 32 : i32} {
19121910
tt.func public @add_kernel(%arg0: tensor<1xi1, #blocked>) {
19131911
tt.assert %arg0, "assert text" : tensor<1xi1, #blocked> loc(#loc5)

0 commit comments

Comments
 (0)