Skip to content

Commit fd9b976

Browse files
erwei-xilinxclaude
andcommitted
Add ELF output format support for NPU2 (AIE2P) devices
ELF is a newer, self-contained XRT binary format that replaces the two-file xclbin+insts.bin workflow. It embeds instructions via PDI and simplifies deployment. ELF is only supported on NPU2 (AIE2P/Strix). NPU2 now defaults to ELF format. NPU1 (AIE2) continues to use xclbin unchanged. The format can be overridden via AMD_TRITON_NPU_OUTPUT_FORMAT. Key changes to driver.py: - Add _get_output_format() for auto-detection and env var override - Add _generate_elf_launcher() using xrt::elf, xrt::ext::kernel, xrt::ext::bo, and xrt::run APIs (no instruction binary needed) - Add _extract_elf_kernel_name() to read kernel name from ELF config - Modify compile_module() for conditional linker flags, aircc flags (--output-format elf --elf-name), caching (2 vs 3 files), and module loading - Modify NPULauncher to dispatch to correct launcher generator Tested: 14/15 examples pass on NPU2 with ELF (matvec fails in both ELF and xclbin modes -- pre-existing issue). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8ef0b74 commit fd9b976

1 file changed

Lines changed: 464 additions & 53 deletions

File tree

0 commit comments

Comments
 (0)