-
Notifications
You must be signed in to change notification settings - Fork 53
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
Validate allocation sizes and strides more widely. #3375
Conversation
!test |
536fd2a
to
21c6e2e
Compare
!test |
47b8ea7
to
2453f1b
Compare
@@ -209,65 +209,66 @@ class BackwardTraverseFromLogicalToAlloc { | |||
}; | |||
|
|||
void validateAllocationSizesAndStrides( | |||
const std::vector<IterDomain*>& alloc_dom_no_reductions, | |||
const std::vector<IterDomain*>& alloc_dom, |
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.
This is mostly a clean-up. I may have fixed a few bugs and/or hardened the validation, but I don't quite remember what was broken exactly...
} else { | ||
metadata->alloc_size = metadata->logical_size; | ||
metadata->alloc_stride = metadata->logical_stride; | ||
// TODO: validateAllocationSizesAndStrides |
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.
This is now done unconditionally in inferAndValidateAllocationSizesAndStrides.
metadata->alloc_stride = metadata->logical_stride; | ||
// TODO: validateAllocationSizesAndStrides | ||
} | ||
auto [sizes, strides] = |
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.
There's a micro optimization to reuse input.sizes() and input.strides(). I didn't do that because I chose to optimize for simplicity for now. Let me know if there's a compelling reason otherwise.
!test |
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.
I have a couple nitpick/questions.
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.
Currently, GetMetaData::evaluate validates allocation sizes and strides only when the TV has allocation that's different from logical. With this PR, it will validate allocation even when it's the same as logical. This extra validation captured many bugs including #3386 and #3194. These bugs are either fixed in this PR or in follow-ups. Fixes #3194.
546a429
to
d13a63e
Compare
!test |
Currently, GetMetaData::evaluate validates allocation sizes and strides
only when the TV has allocation that's different from logical. With this
PR, it will validate allocation even when it's the same as logical.
This extra validation captured many bugs including #3386 and #3194.
These bugs are either fixed in this PR or in follow-ups.
Prepares for #3282