Skip to content

Expose target architecture via Device.arch (#2485)#3108

Draft
hunhoffe wants to merge 1 commit into
Xilinx:mainfrom
hunhoffe:ehunhoff/issue-2485-device-arch
Draft

Expose target architecture via Device.arch (#2485)#3108
hunhoffe wants to merge 1 commit into
Xilinx:mainfrom
hunhoffe:ehunhoff/issue-2485-device-arch

Conversation

@hunhoffe
Copy link
Copy Markdown
Collaborator

Implements the wrapper proposed in #2485: surfaces AIETargetModel::getTargetArch as an arch property on iron.Device returning the AIEArch enum (AIE1/AIE2/AIE2p).

  • C API: new aieTargetModelGetTargetArch in aie-c/TargetModel.h / lib/CAPI/TargetModel.cpp
  • Python binding: PyAieTargetModel.get_target_arch() in python/AIEMLIRModule.cpp
  • IRON: Device.arch property in python/iron/device/device.py
  • Refactor: python/utils/jit.py replaces the isinstance(NPU1/NPU2/...) / AIEDevice.npu* cascade with a single device.arch lookup (and drops the now-unused AIEDevice import)

C++ call sites already use RTTI on AIE1TargetModel/AIE2TargetModel per Jeff's suggestion in the issue, so no compiler-side changes were needed.

closes #2485

Wraps AIETargetModel::getTargetArch in the C API
(aieTargetModelGetTargetArch), binds it on PyAieTargetModel as
get_target_arch(), and adds an arch property on iron.Device that
returns the AIEArch enum. Replaces the isinstance/AIEDevice cascade
in utils/jit.py with a single device.arch lookup.
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.

Introduce get_target_architecture helper function

1 participant