Skip to content

Commit d7935ea

Browse files
authored
Add TRITON_INTEL_DEVICE_ARCH env var to redefine architecture if needed (#4673)
Signed-off-by: Anatoly Myachev <[email protected]>
1 parent 96ceeb3 commit d7935ea

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

python/triton/knobs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ class intel_knobs(base_knobs):
506506
# `ocloc query CL_DEVICE_EXTENSIONS`. If not set, a compiler calls `ocloc` in runtime to get
507507
# the actual device extensions.
508508
device_extensions: env_opt_str = env_opt_str("TRITON_INTEL_DEVICE_EXTENSIONS")
509+
device_arch: env_opt_str = env_opt_str("TRITON_INTEL_DEVICE_ARCH")
509510

510511

511512
class amd_knobs(base_knobs):

third_party/intel/backend/compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def __init__(self, target: tuple) -> None:
118118
raise TypeError("target.arch is not a dict")
119119
dirname = os.path.dirname(os.path.realpath(__file__))
120120
mod = compile_module_from_src(Path(os.path.join(dirname, "arch_parser.c")).read_text(), "arch_utils")
121-
self.device_arch = mod.parse_device_arch(target.arch.get('architecture', 0))
121+
self.device_arch = knobs.intel.device_arch or mod.parse_device_arch(target.arch.get('architecture', 0))
122122
self.properties = self.parse_target(target.arch)
123123
self.binary_ext = "spv"
124124

0 commit comments

Comments
 (0)