Skip to content

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

Closed
LeiWang1999 wants to merge 3 commits intoapache:mainfrom
tile-ai:infer_scope
Closed

[TIR] Enhance LowerThreadAllreduce pass to automatically infer shared memory scope#17442
LeiWang1999 wants to merge 3 commits intoapache:mainfrom
tile-ai:infer_scope

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

@LeiWang1999 LeiWang1999 deleted the infer_scope branch November 14, 2024 05:45
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