Skip to content

Conversation

@zpcore
Copy link
Member

@zpcore zpcore commented Oct 31, 2023

We notice that torch.ops.aten.sequeeze(tensor, dims) will throw out an error if the dims is not in sorted order after we convert it to Canonical dimensions. Meanwhile if the dims = [-1], it will also throw out an error.

The issue is mostly due to the logic here.

We make the logic fix and add the test case in the pr.

@zpcore zpcore requested review from JackCaoG, lsy323 and qihqi October 31, 2023 00:21
@zpcore zpcore self-assigned this Oct 31, 2023
@zpcore zpcore added the lowering ATen Operation lowering label Oct 31, 2023
@zpcore zpcore requested a review from wonjoo-wj October 31, 2023 16:34
xla::XlaOp BuildMaskedFillScalar(xla::XlaOp input, xla::XlaOp mask,
xla::XlaOp scalar);

std::vector<int64_t> BuildSqueezedDimensions(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above one should be a special case of the 2nd one, shall we just keep the second one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the point, I leave the original signature there in case program still relays on the 1st one. However, I just made the update in 1st one function to call 2nd function to simplify the coding.

Copy link
Collaborator

@lsy323 lsy323 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@lsy323 lsy323 merged commit 2192031 into master Nov 7, 2023
mbzomowski pushed a commit to mbzomowski-test-org/xla that referenced this pull request Nov 16, 2023
…h#5751) * fix squeeze op lowering issue when dim is not in sorted order * remove debug info * remove debug info * refactor BuildSqueezedDimensions
ManfeiBai pushed a commit that referenced this pull request Nov 29, 2023
* fix squeeze op lowering issue when dim is not in sorted order * remove debug info * remove debug info * refactor BuildSqueezedDimensions
ManfeiBai pushed a commit that referenced this pull request Nov 29, 2023
* fix squeeze op lowering issue when dim is not in sorted order * remove debug info * remove debug info * refactor BuildSqueezedDimensions
chunnienc pushed a commit to chunnienc/xla that referenced this pull request Dec 14, 2023
…h#5751) * fix squeeze op lowering issue when dim is not in sorted order * remove debug info * remove debug info * refactor BuildSqueezedDimensions
golechwierowicz pushed a commit that referenced this pull request Jan 12, 2024
* fix squeeze op lowering issue when dim is not in sorted order * remove debug info * remove debug info * refactor BuildSqueezedDimensions
@zpcore zpcore deleted the piz/op_lowering branch February 12, 2024 18:03
bhavya01 pushed a commit that referenced this pull request Apr 22, 2024
* fix squeeze op lowering issue when dim is not in sorted order * remove debug info * remove debug info * refactor BuildSqueezedDimensions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lowering ATen Operation lowering

3 participants