You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Integrate Phoenix (NPU1) support with correct cross-compilation
## What changed
**Phoenix (NPU1/aie2) support:**
- `ChanneledUnaryOperator` now auto-detects the target kernel directory
(`aie2` vs `aie2p`) at compile time via `get_kernel_dir()`, replacing the
hardcoded `kernel_subdir` ClassVar
- Adds `needs_lut_ops: ClassVar[bool] = False` to `ChanneledUnaryOperator`;
subclasses that require `lut_based_ops.o` on aie2 (gelu, sigmoid, tanh,
silu, softmax) set it to `True`
- `PeanoCompilationRule` derives the compiler target triple and runtime lib
dir from the device at compile time instead of a hardcoded `DEVICE_CONFIGS`
dict
**Cross-compilation:**
- All compilation-path `DefaultNPURuntime.device()` calls replaced with
`aie_utils.get_current_device()`, which respects `set_current_device()`
- Cross-compile for a specific target with
`aie_utils.set_current_device(NPU1())` before compilation; execution paths
(`DefaultNPURuntime.load/run`) are unchanged
- Artifact names now include the device architecture (e.g.
`GELU_..._npu2.xclbin`, `gelu_npu2.o`) so NPU1 and NPU2 artifacts coexist
safely in the same build directory without cache collisions
- Device detection uses `isinstance(dev, NPU2)` rather than string matching
**Cleanup:**
- Deleted `DEVICE_CONFIGS`, `get_device_name`, `get_device_type` from
`device_utils.py`; replaced with a single `get_kernel_dir()` helper
- Removed `AIEDeviceManager` imports from all test files (class was deleted
in this branch)
- Removed dead `get_device_name`/`get_device_type` imports from
`gemm/design.py` and `mha/design.py`
- Fixed `kernel_archive` NameError in gelu/sigmoid/tanh design files
- Fixed bare `kernel_dir` NameError in `mha/op.py`
- Fixed hardcoded `"aie2p"` in `gemm/op.py` and `mha/op.py` (mm.cc)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments