-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[TensorIR][PASS][M1c] PlanUpdateBufferAllocationLocation #7873
Conversation
Shall we find a shorter name this this pass 😆 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we find a short name for this pass? What about RealizeBufferAlloc
?
beab57d
to
b93f63f
Compare
Co-authored-by: Tianqi Chen <[email protected]> Co-authored-by: Junru Shao <[email protected]> Co-authored-by: Ruihang Lai <[email protected]>
for i_0 in range(0, 16): | ||
with tir.block([]): | ||
tir.reads([A[i_0, 0:16]]) | ||
tir.writes([C[i_0, 0:16]]) | ||
B = tir.alloc_buffer([16, 16]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this test case means that the buffer defined outside this block(the original element_func) will be transformed to a buffer inside the block?
What if the for i_0 in range(0, 16)
is a axis with parallel
, this will turns a thread common buffer to a thread local buffer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jcf94 i believe your understanding is correct in this case
The current naming is fine given it is a pass only used internally. Realize may also may not best describe it, as this pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just chatted with TQ but either of us found no better name... :-(
So let's just stick to PlanUpdateBufferAllocationLocation
then...
Co-authored-by: Tianqi Chen <[email protected]> Co-authored-by: Junru Shao <[email protected]> Co-authored-by: Ruihang Lai <[email protected]>
Co-authored-by: Tianqi Chen <[email protected]> Co-authored-by: Junru Shao <[email protected]> Co-authored-by: Ruihang Lai <[email protected]>
Co-authored-by: Tianqi Chen <[email protected]> Co-authored-by: Junru Shao <[email protected]> Co-authored-by: Ruihang Lai <[email protected]>
Co-authored-by: Tianqi Chen <[email protected]> Co-authored-by: Junru Shao <[email protected]> Co-authored-by: Ruihang Lai <[email protected]>
Co-authored-by: Tianqi Chen <[email protected]> Co-authored-by: Junru Shao <[email protected]> Co-authored-by: Ruihang Lai <[email protected]>
Co-authored-by: Tianqi Chen <[email protected]> Co-authored-by: Junru Shao <[email protected]> Co-authored-by: Ruihang Lai <[email protected]>
This PR is part of the TensorIR upstreaming effort (#7527) as one of the M1c stages, introducing the pass PlanUpdateBufferAllocationLocation.
This Pass will Locate the buffer allocation to the exact position (usually is the lca of buffer access) and inject opaque block
with alloc_buffers to annotate the buffer allocation site.
cc @tqchen @comaniac @jroesch @junrushao1994