Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AMDAIEDevice to the executable target config #528

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

jtuyls
Copy link
Collaborator

@jtuyls jtuyls commented Jul 10, 2024

This enables passes pre-aie.device to retrieve the target AIE device, which I will use in later PRs to lookup hardware-related parameters from the AMDAIEDeviceModel.

@makslevental
Copy link
Collaborator

I was wondering about how this could/should work. LGTM but can you get rid of https://github.com/nod-ai/iree-amd-aie/blob/main/runtime/src/iree-amd-aie/aie_runtime/iree_aie_runtime.h#L59-L68 then.

@jtuyls jtuyls force-pushed the add-amdaie-device-to-executable-target branch from aedc86f to 10b1454 Compare July 10, 2024 21:23
Copy link
Contributor

@nirvedhmeshram nirvedhmeshram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@makslevental makslevental left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

if (!config) return std::nullopt;
std::optional<StringAttr> attr = config.getAs<StringAttr>("target_device");
if (!attr) return std::nullopt;
return AMDAIE::symbolizeEnum<AMDAIEDevice>(attr.value().getValue());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😎 yea I forgot mlir gives symbolize and stringify.

@jtuyls jtuyls merged commit 33a8618 into nod-ai:main Jul 10, 2024
2 checks passed
@jtuyls jtuyls deleted the add-amdaie-device-to-executable-target branch July 10, 2024 22:31
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.

3 participants