Skip to content
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

fix squeeze op lowering issue when dim is not in sorted order #5751

Merged
merged 4 commits into from
Nov 7, 2023

Conversation

zpcore
Copy link
Collaborator

@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 qihqi, JackCaoG and lsy323 October 31, 2023 00:21
@zpcore zpcore self-assigned this Oct 31, 2023
@zpcore zpcore requested a review from wonjoolee95 October 31, 2023 16:34
@@ -49,6 +49,9 @@ xla::XlaOp BuildMaskedFillScalar(xla::XlaOp input, xla::XlaOp mask,
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
Collaborator 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
17 checks passed
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants