Skip to content

Commit da0aaba

Browse files
erwei-xilinxclaude
andcommitted
Switch from Python aircc to C++ aircc binary
Replace the in-process Python aircc.run() call with a subprocess call to the C++ aircc binary shipped in the mlir-air wheel. The C++ binary is a full rewrite using LLVM's CommandLine library and in-process MLIR PassManager, and is the intended replacement for the Python tool. The IR file (asm_air_output.mlir) is already written to disk before this point, so the change is straightforward: pass the file path as a positional argument to the C++ binary with the same CLI options. Verified: all 14 non-skipped examples pass on NPU2 (Strix/AIE2P). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6f432cd commit da0aaba

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

amd_triton_npu/backend/driver.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,10 @@ def launch(
731731
###### Compile to xclbin and runtime sequence
732732
xclbin_path = os.path.join(air_proj_path, "aie.xclbin")
733733
insts_path = os.path.join(air_proj_path, "insts.bin")
734-
aircc_options = [
734+
air_mlir_path = os.path.join(air_proj_path, "asm_air_output.mlir")
735+
aircc_bin = str(Path(aircc.__file__).resolve().parent.parent.parent.parent.parent / "bin" / "aircc")
736+
aircc_cmd = [
737+
aircc_bin,
735738
"--device",
736739
detect_npu_version(),
737740
"--no-xchesscc",
@@ -741,8 +744,9 @@ def launch(
741744
"-o",
742745
xclbin_path,
743746
"--peano" + " ",
747+
air_mlir_path,
744748
]
745-
aircc.run(air_output, aircc_options)
749+
subprocess.check_call(aircc_cmd)
746750

747751
with open(so_path, "rb") as f:
748752
cache_path = cache.put(f.read(), filename, binary=True)

0 commit comments

Comments
 (0)