Skip to content

Commit dc4d128

Browse files
Introduce env var to disable IGC optimization (#4301)
It disables all IGC optimizations. When debugging functional failures, it is often useful to know if it passes with IGC optimizations disabled. If a test case fails with IGC optimizations, and passes with IGC optimizations disabled, then there is a high chance that the problem is in IGC. Signed-off-by: Whitney Tsang <[email protected]>
1 parent 4438059 commit dc4d128

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

python/triton/knobs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ class intel_knobs(base_knobs):
494494
advanced_path: env_bool = env_bool("TRITON_INTEL_ADVANCED_PATH", False)
495495
opt_reduction_locality: env_bool = env_bool("TRITON_INTEL_OPTIMIZE_REDUCTION_LOCALITY", False)
496496
reduce_transpose: env_bool = env_bool("TRITON_INTEL_REDUCE_TRANSPOSE", False)
497+
disable_igc_opt: env_bool = env_bool("TRITON_INTEL_DISABLE_IGC_OPT", False)
497498

498499
raise_block_pointer: env_str = env_str("TRITON_INTEL_RAISE_BLOCK_POINTER", "0")
499500
dump_spirv_kernel_args: env_opt_str = env_opt_str("TRITON_XPU_DUMP_SPIRV_KERNEL_ARGS")

third_party/intel/backend/compiler.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,9 @@ def make_spv(src, metadata, options):
378378
else:
379379
metadata["build_flags"] = ""
380380

381+
if knobs.intel.disable_igc_opt:
382+
metadata["build_flags"] += " -cl-opt-disable"
383+
381384
metadata["generate_native_code"] = options.generate_native_code
382385

383386
if options.generate_native_code:

0 commit comments

Comments
 (0)