Skip to content

Commit e5ad020

Browse files
authored
Add boundary_check to block pointer store in flash_attention_benchmark.py kernel. (#4637)
It is required for protecting the kernel instance access the memory out of boundary. Signed-off-by: Lu,Chengjun <[email protected]>
1 parent 62ece72 commit e5ad020

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

benchmarks/triton_kernels_benchmark/flash_attention_benchmark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def _attn_fwd_with_block_pointers(Q, K, V, sm_scale, M, Out, #
155155
# epilogue
156156
m_i += tl.math.log2(l_i)
157157
acc = acc / l_i[:, None]
158-
tl.store(O_block_ptr, acc.to(Out.type.element_ty))
158+
tl.store(O_block_ptr, acc.to(Out.type.element_ty), boundary_check=(0, 1))
159159

160160

161161
configs = [

0 commit comments

Comments
 (0)