Skip to content

Raise error when AIR_TRANSFORM_TILING_SCRIPT file is not found#12

Merged
erwei-xilinx merged 1 commit into
mainfrom
fix-transform-script-path-error
Mar 3, 2026
Merged

Raise error when AIR_TRANSFORM_TILING_SCRIPT file is not found#12
erwei-xilinx merged 1 commit into
mainfrom
fix-transform-script-path-error

Conversation

@erwei-xilinx

Copy link
Copy Markdown
Collaborator

Summary

  • When AIR_TRANSFORM_TILING_SCRIPT is set to a relative path and the script is run from a directory that doesn't contain that file, the driver now raises a clear FileNotFoundError instead of silently falling back to a default transform IR that causes an opaque MLIRError: Failure while executing pass pipeline in aircc.

Root cause

_get_transform_ir_string() in driver.py caught FileNotFoundError and fell back to a hardcoded default transform IR. This default IR only does simple 32x32 tiling without creating air.herd ops or proper memory staging, so the downstream aircc pass pipeline fails. The warning message (Warning: Custom tiling script file not found) was printed after the traceback, making it easy to miss.

Reproduced by running matmul.py from a directory other than examples/matmul/ with AIR_TRANSFORM_TILING_SCRIPT=transform_aie2.mlir (relative path). The new error message is:

FileNotFoundError: AIR_TRANSFORM_TILING_SCRIPT is set to 'transform_aie2.mlir'
but the file was not found (cwd: /tmp).
Use an absolute path or run from the directory containing the script.

Test plan

  • Set AIR_TRANSFORM_TILING_SCRIPT=transform_aie2.mlir and run matmul from a wrong directory — should get clear FileNotFoundError
  • Run matmul from examples/matmul/ with the env var set — should work as before
  • Run without AIR_TRANSFORM_TILING_SCRIPT set — default fallback still works

🤖 Generated with Claude Code

When AIR_TRANSFORM_TILING_SCRIPT is set to a relative path and the
working directory doesn't contain that file, the driver silently falls
back to a default transform IR that produces under-transformed MLIR.
The downstream aircc pass pipeline then fails with an opaque
"MLIRError: Failure while executing pass pipeline".

Replace the silent fallback with a clear FileNotFoundError that
includes the current working directory, so users know to either use
an absolute path or cd into the example directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@erwei-xilinx erwei-xilinx merged commit 918dc04 into main Mar 3, 2026
8 of 9 checks passed
@erwei-xilinx erwei-xilinx deleted the fix-transform-script-path-error branch March 3, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants