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

[ObjectFifo] Create a new pass to split L2 buffers #659

Merged
merged 22 commits into from
Sep 2, 2024

Conversation

Abhishek-Varma
Copy link
Contributor

This PR includes 2 commits :-

Commit 1
-- This commit introduces a new pass --iree-amdaie-split-buffers to split L2 buffers for dealing with Matmul+Elementwise.
-- It addresses sub-action 2 as well from #644

Commit 2

  • Adds --iree-amdaie-split-buffers pass to the objectFifo pipeline.

Signed-off-by: Abhishek Varma [email protected]

NOTE: Let me know what can we name the pass instead of iree-amdaie-split-buffers - iree-amdaie-split-l2-buffers is a possibility but we clearly aren't splitting ALL L2 buffers.

@Abhishek-Varma
Copy link
Contributor Author

Previously L2's access patterns were incorrect after being split.

L3 -> L2 requires 4D access pattern. L2 -> L1 requires 6D access pattern. The previous revision was incorrectly forming 4D access pattern for both cases and was doing so by linearizing the L2 buffer.

The current revision takes care of the following :-

  1. 4D access pattern for L3 -> L2.
  2. 6D access pattern for L2 -> L1.
  3. Correct offset (L2 for both L3 -> L2 and L2 -> L1)
  4. Correct size (L2 for both L3 -> L2 and L2 -> L1)

I've pushed the current revision as a WIP because now I need to take a look at L3's case as well as strides in the access pattern.

Once verified, only then will I update the lit test case and clean up the code before asking for re-review. But attaching here the IR snippet - now instead of <1024>, I'm forming correct four splits (<1x1x32x32>) of the L2 buffer (<2x2x32x32>).

CC: @jtuyls

@Abhishek-Varma
Copy link
Contributor Author

Here is the current state of Matmul + Elemwise : e2e IR log with ToM + Splitting LogicalObjectFifos.

-- This commit introduces a new pass `--iree-amdaie-split-buffers`
   to split L2 buffers for dealing with Matmul+Elementwise.
-- It addresses sub-action 2 as well from #644

Signed-off-by: Abhishek Varma <[email protected]>
@Abhishek-Varma Abhishek-Varma merged commit 3a6f183 into main Sep 2, 2024
6 checks passed
@Abhishek-Varma Abhishek-Varma deleted the avarma_split_l2_buffers branch September 2, 2024 13:51
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