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

[LowerToAIE] Refactor pass #705

Merged
merged 1 commit into from
Aug 29, 2024
Merged

Conversation

newling
Copy link
Contributor

@newling newling commented Aug 26, 2024

It'll be good to lower directly from amdaie objectfifo operations, to aie lock/bd operations. This PR moves in that direction by moving logic out of aie to amdaie dialects. Specifically, the lower-to-aie pass gets split up, with 2 small passes being extracted (see passes.td for descriptions)

  1. iree-amdaie-canonicalize-npu-dma-cpy-nd
    This pass gets the zero stride dimension to the outermost dimension, and now acts on the amdaie dialect.

  2. iree-amdaie-sink-into-core
    This pass sinks dependencies into amdaie.core operations.

@newling newling changed the title [WIP][LowerToAIE] Refactor pass [LowerToAIE] Refactor pass Aug 26, 2024
Copy link
Collaborator

@jtuyls jtuyls left a comment

Choose a reason for hiding this comment

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

iree-amdaie-sink-into-core
This pass will eventually be removed, once we can do the stateful transform on the amdaie dialect.

I don't think this is a limitation introduced by stateful trasnform, but needed to generate standalone code for the cores (through peano/chess), so this will still be needed?

@newling newling force-pushed the refactor_lower_to_aie branch from 520660c to d6c8dcc Compare August 28, 2024 00:16
@newling
Copy link
Contributor Author

newling commented Aug 28, 2024

iree-amdaie-sink-into-core
This pass will eventually be removed, once we can do the stateful transform on the amdaie dialect.

I don't think this is a limitation introduced by stateful trasnform, but needed to generate standalone code for the cores (through peano/chess), so this will still be needed?

Good point. I've moved it to act on amdaie.core. But in the process I realised using PatternRewriter for this is incredibly fragile unless the op we're sinking into can somehow be formally isolated from above. I've avoided PatternRewriter in the updated version, but we'll probably need to revisit this (in this PR or later).

@newling newling force-pushed the refactor_lower_to_aie branch from e2a1311 to 8c42d2a Compare August 28, 2024 21:33
@newling newling force-pushed the refactor_lower_to_aie branch from 8c42d2a to 1f2c628 Compare August 29, 2024 16:56
@newling
Copy link
Contributor Author

newling commented Aug 29, 2024

Thanks for the review @jtuyls, this should really be 2 PRs sorry about that.

@newling newling requested a review from jtuyls August 29, 2024 16:58
Copy link
Collaborator

@jtuyls jtuyls left a comment

Choose a reason for hiding this comment

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

LGTM. Great refactor!

@newling newling force-pushed the refactor_lower_to_aie branch from 1f2c628 to 2520721 Compare August 29, 2024 17:55
@newling newling force-pushed the refactor_lower_to_aie branch from 2520721 to 9a7be93 Compare August 29, 2024 17:56
@newling newling enabled auto-merge (squash) August 29, 2024 18:01
@newling newling requested review from Abhishek-Varma and removed request for Abhishek-Varma August 29, 2024 18:41
@newling newling dismissed Abhishek-Varma’s stale review August 29, 2024 18:44

Dismissing, as I have addressed comments :)

@newling newling merged commit 0a8b7dc into nod-ai:main Aug 29, 2024
5 checks passed
@newling newling deleted the refactor_lower_to_aie branch December 12, 2024 23:07
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