Fix as_strided for inputs smaller than the arguments specification.#5914
Merged
ysiraichi merged 7 commits intopytorch:masterfrom Nov 28, 2023
Merged
Fix as_strided for inputs smaller than the arguments specification.#5914ysiraichi merged 7 commits intopytorch:masterfrom
as_strided for inputs smaller than the arguments specification.#5914ysiraichi merged 7 commits intopytorch:masterfrom
Conversation
Collaborator
|
lol do you mind resolve the conflict? |
f9958ef to
e66a809
Compare
Collaborator
Author
|
@JackCaoG I think this is ready for another round of reviews. Could you take a look at it? |
JackCaoG
reviewed
Nov 28, 2023
JackCaoG
reviewed
Nov 28, 2023
| const at::Tensor& GetRootBase(const at::Tensor& tensor); | ||
| // Sets the base tensor of a given XLATensor. Convenient function | ||
| // to be used when returning tensors. | ||
| XLATensorPtr SetBaseTensor(XLATensorPtr tensor, const at::Tensor& base); |
Collaborator
There was a problem hiding this comment.
do we ever expect base to be on non-xla device? If not can we add an explict check?
Collaborator
Author
There was a problem hiding this comment.
Good question. I don't think so, since we got to a XLA dispatched kernel. Will add the check.
JackCaoG
reviewed
Nov 28, 2023
JackCaoG
approved these changes
Nov 28, 2023
ManfeiBai
pushed a commit
to ManfeiBai/PyTorchXLA
that referenced
this pull request
Dec 1, 2023
…pytorch#5914) * Add test. * Create `base_` tensor for views. * Use base tensor in `as_strided` operation. * Set base tensor of `as_strided`. * Fix lint errors. * Fix for disabled functionalization. * Address review.
ManfeiBai
pushed a commit
to ManfeiBai/PyTorchXLA
that referenced
this pull request
Dec 1, 2023
…pytorch#5914) * Add test. * Create `base_` tensor for views. * Use base tensor in `as_strided` operation. * Set base tensor of `as_strided`. * Fix lint errors. * Fix for disabled functionalization. * Address review.
chunnienc
pushed a commit
to chunnienc/xla
that referenced
this pull request
Dec 14, 2023
…pytorch#5914) * Add test. * Create `base_` tensor for views. * Use base tensor in `as_strided` operation. * Set base tensor of `as_strided`. * Fix lint errors. * Fix for disabled functionalization. * Address review.
golechwierowicz
pushed a commit
that referenced
this pull request
Jan 12, 2024
…#5914) * Add test. * Create `base_` tensor for views. * Use base tensor in `as_strided` operation. * Set base tensor of `as_strided`. * Fix lint errors. * Fix for disabled functionalization. * Address review.
bhavya01
pushed a commit
that referenced
this pull request
Apr 22, 2024
…#5914) * Add test. * Create `base_` tensor for views. * Use base tensor in `as_strided` operation. * Set base tensor of `as_strided`. * Fix lint errors. * Fix for disabled functionalization. * Address review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: #5719
This PR introduces a
base_attribute forXLATensor. It keeps track of the tensor whose storage would be aliased by the outer tensor due to a view operation.