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

[TIR] Enhance LowerThreadAllreduce pass to automatically infer shared memory scope #17442

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

LeiWang1999
Copy link
Contributor

The pass LowerThreadAllreduce enables efficient block reduction. However, block reduction often requires a large amount of shared memory space. The current implementation of LowerThreadAllreduce only enable static shared memory reduce buffer allocation and prevents the shared memory merging when another shared memory scope is defined as shared.dyn.

A_shared: "shared.dyn"
B_shared: "shared.dyn"
C_shared: "shared.dyn"
red: "shared" (can not be merged into the union shared memory pool)

This pull request addresses this issue by first collecting buffer allocations, and then determining the memory scope of the reduction buffer, allowing for memory space fusion in the following MergeSharedMemoryAllocations pass.

@Hzfengsy
Copy link
Member

Hzfengsy commented Oct 6, 2024

Please add a testcase for the enhancement

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.

2 participants