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
[vmap] symintify alias and squeeze #107577
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/107577
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 2abdba4 with merge base d0f8ee4 (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
if (self.is_quantized()) { | ||
self_ = at::detail::make_tensor<QTensorImpl>( | ||
c10::TensorImpl::VIEW, Storage(self.storage()), self.key_set(), self.dtype(), get_qtensorimpl(self)->quantizer()); | ||
self_.unsafeGetTensorImpl()->set_sizes_and_strides(sizes, strides, self.sym_storage_offset()); |
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.
Is there a reason why we can't change the ArrayRef<int64_t> and SmallVector<int64_t>
template above to use this line?
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 just forgot about that! Thanks!
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.
Actually, that won't work because there are two overloads for set_sizes_and_strides
void set_sizes_and_strides(SymIntArrayRef sizes, SymIntArrayRef strides, optional<c10::SymInt> storage_offset)
void set_sizes_and_strides(IntArrayRef new_size, IntArrayRef new_stride, optional<int64_t> storage_offset)
So, all inputs have to be symbolic or concrete, we can't pass self.sym_storage_offset()
to second overload.
Ping @zou3519 |
1 similar comment
Ping @zou3519 |
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Following tests now pass (both ops call into
alias
on certain paths)NOTE: Ideally, this symint version should work with non symint version as well but that would mean changes at multiple places. Wanted to get a review for this fix before-hand.
Other sites which use the
IntArrayRef
overload.pytorch/aten/src/ATen/native/TensorShape.cpp
Lines 1707 to 1713 in 5f56c4f
view_impl
is called fromview
and_unsafe_view
.pytorch/aten/src/ATen/native/TensorShape.cpp
Lines 3295 to 3306 in 5f56c4f
cc @ezyang