-
Notifications
You must be signed in to change notification settings - Fork 69
Fix allocation logic: non-divisible split #5186
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
base: main
Are you sure you want to change the base?
Conversation
|
Review updated until commit 89b2f1c Description
Changes walkthrough 📝
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
clangformat
c64d299 to
33d0ce3
Compare
8fe76bd to
82fdd9b
Compare
|
I'm keeping this as draft for now until I add more tests per @naoyam 's request. |
82fdd9b to
beab9a3
Compare
33d0ce3 to
17df15a
Compare
17df15a to
f9acfc3
Compare
beab9a3 to
30c1640
Compare
1. refactor buffer allocation buffer to use allocation domain, intead of logical domain. 2. fixing projection from allocation to logical special path when projection is not possible: We now compute correct extent instead of returning the allocation buffer as-is, this allows that layout op to return a tensor with the correct logical size, while still allocating a large enough buffer to accommodate the padding requirement.
This PR changes the projection to ensure extent for non-divisible split on backward projection maintains the correct extent, instead of including padded sizes from the two split IDs.
e.g. with ID i0 (extent 5), if we do split by 4, we'll get two new ID
i0 (extent 5)
/ \
i0/4 4
Because i0/4 is a ceilDiv, it will ended up having extent 2.
When we project the extent from i0/4 and 4 back, the combined extent will be 8, instead of 5.
When we allocate buffer, we want the buffer to use codomain sizes (buffer size should be 5). But the tensor we produce should have size that's faithful to its logical domain sizes. Otherwise, later consumer of the tensor would assert on mismatch tensor sizes.
f9acfc3 to
87afb60
Compare
30c1640 to
89b2f1c
Compare
c64d299 to
ea3cd68
Compare
Stacked PRs
Breaking original PR #5170 into three:
#5186 Fix allocation logic: non-divisible split <- this one
#5185 Fix allocation logic: unconnected alloc/logical
#5184 Allow non-device split on allocation domain
This PR
Fixing project from allocation to logical for non-divisible split
This PR changes the projection to ensure extent for non-divisible split on backward projection maintains the correct extent, instead of including padded sizes from the two split IDs.
e.g. with ID i0 (extent 5), if we do split by 4, we'll get two new ID
Because i0/4 is a ceilDiv, it will ended up having extent 2.
When we project the extent from i0/4 and 4 back, the combined extent will be 8, instead of 5.
When we allocate buffer, we want the buffer to use allocation sizes (buffer size should be 8). But the tensor we produce should have size that's faithful to its logical domain sizes (tensor size should be 5). Otherwise, later consumer of the tensor would assert on mismatch tensor sizes.
TODO