forked from nod-ai/iree-amd-aie
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Dma] Don't check Dma unit dims during subsumption and fold them duri…
…ng controlCodeLowering (nod-ai#1070) Before this PR, we need to check the number of sizes/strides before dma loop subsumption to make sure the number of dims are not exceed the maximum after subsumption. However, this blocks some opportunities for loop subsumption when there are unit dimensions which are not canonicalized because the offsets of these dimensions are none 0. For example the following loop cannot be subsumed because there are already 4 dimensions on L3 source side. ``` scf.for %arg2 = %c0 to %c6 step %c1 { %1 = affine.apply affine_map<(d0) -> (d0 + 1)>(%arg2) amdaie.npu.dma_cpy_nd %0([] [] [], [1, %1, 0, 0] [1, 1, 32, 32] [8192, 1024, 32, 1]) } ``` This PR relaxes the constraint by only checking the non-unit dimensions, so the above loop can be subsumed into dma as ``` amdaie.npu.dma_cpy_nd %0([] [] [], [0, 1, 1, 0, 0] [6, 1, 1, 32, 32] [1024, 8192, 1024, 32, 1]) ``` And this dma can be further canonicalized.
- Loading branch information
Showing
5 changed files
with
145 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.