Skip to content

Commit 9752a56

Browse files
chengjunluCopilot
andauthored
Add knobs TRITON_INTEL_ENABLE_BLOCK_IO_STORE_ON_REGULAR_PTR for block store. (#4610)
The 2D block IO store causes bad performance on flex attn. Disable the block store by default and add a knob to enable it. --------- Signed-off-by: Lu,Chengjun <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent 2892882 commit 9752a56

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

include/triton/Tools/Sys/GetEnv.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ inline const std::set<std::string> CACHE_INVALIDATING_ENV_VARS = {
5151
"TRITON_INTEL_ENABLE_INSTR_SCHED",
5252
"TRITON_INTEL_FAST_MATH",
5353
"TRITON_INTEL_REDUCE_TRANSPOSE",
54+
"TRITON_INTEL_ENABLE_BLOCK_IO_STORE_ON_REGULAR_PTR",
5455
// clang-format on
5556
};
5657

third_party/intel/lib/TritonIntelGPUToLLVM/LoadStoreOpToLLVM.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "intel/include/Dialect/TritonIntelGPU/IR/Attributes.h"
1515
#include "intel/include/Dialect/TritonIntelGPU/Transforms/Utility.h"
1616
#include "triton/Tools/LinearLayout.h"
17+
#include <triton/Tools/Sys/GetEnv.hpp>
1718

1819
using namespace mlir;
1920
using namespace mlir::triton;
@@ -2686,6 +2687,11 @@ struct StoreOpToBlockIOConversion
26862687
offsetBaseX = b.trunc(i32_ty, offsetX);
26872688
offsetBaseY = b.trunc(i32_ty, offsetY);
26882689
} else {
2690+
2691+
static const bool enableBlockStore = triton::tools::getBoolEnv(
2692+
"TRITON_INTEL_ENABLE_BLOCK_IO_STORE_ON_REGULAR_PTR");
2693+
if (!enableBlockStore)
2694+
return failure();
26892695
// Get the LLVM values for pointers
26902696
ptrElems = unpackLLElements(loc, llPtr, rewriter);
26912697
assert(ptrElems.size() == numElems &&

0 commit comments

Comments
 (0)