Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions amd_triton_npu/backend/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,16 +210,15 @@ def _get_transform_ir_string():
custom_script_path = os.getenv("AIR_TRANSFORM_TILING_SCRIPT")

if custom_script_path:
try:
with open(custom_script_path, "r") as f:
print(f"Using custom tiling script from: {custom_script_path}")
return f.read()
except FileNotFoundError:
print(f"Warning: Custom tiling script file not found: {custom_script_path}")
print("Falling back to default tiling recipe.")
except Exception as e:
print(f"Error reading custom tiling script {custom_script_path}: {e}")
print("Falling back to default tiling recipe.")
if not os.path.isfile(custom_script_path):
raise FileNotFoundError(
f"AIR_TRANSFORM_TILING_SCRIPT is set to '{custom_script_path}' "
f"but the file was not found (cwd: {os.getcwd()}). "
f"Use an absolute path or run from the directory containing the script."
)
with open(custom_script_path, "r") as f:
print(f"Using custom tiling script from: {custom_script_path}")
return f.read()

# Default hardcoded transform IR string
matmul_tiling_size_l1_m = 32
Expand Down
Loading