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

squeeze: allow squeezing multiple dimensions at once #89017

Closed
wants to merge 15 commits into from

Conversation

peterbell10
Copy link
Collaborator

@peterbell10 peterbell10 commented Nov 14, 2022

Stack from ghstack (oldest at bottom):

Ref #70924

This addresses part 1 of the issue, allowing torch.squeeze to be
passed a tuple of dimensions. e.g.

x.squeeze(0).squeeze(0)

can now be written

x.squeeze((0, 1))

(assuming x has at least 2 dimensions)

cc @mlazos @soumith @voznesenskym @yanboliang @penguinwu @anijain2305 @EikanWang @jgong5 @Guobing-Chen @chunyuan-w @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @desertfire

Ref #70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze(0, 1)
```
(assuming x has at least 2 dimensions)

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Nov 14, 2022

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/89017

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit e44436d:
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

peterbell10 added a commit that referenced this pull request Nov 14, 2022
Ref #70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze(0, 1)
```
(assuming x has at least 2 dimensions)

ghstack-source-id: 23ef534a3464c1ff347101fefcbc56772421d457
Pull Request resolved: #89017
@peterbell10 peterbell10 added release notes: python_frontend release notes category topic: improvements topic category labels Nov 15, 2022
Ref #70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze(0, 1)
```
(assuming x has at least 2 dimensions)

[ghstack-poisoned]
peterbell10 added a commit that referenced this pull request Nov 15, 2022
Ref #70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze(0, 1)
```
(assuming x has at least 2 dimensions)

ghstack-source-id: 0213d7ee9ec144aa5fdf09672c1040d85da65707
Pull Request resolved: #89017
peterbell10 added a commit to peterbell10/pytorch that referenced this pull request Nov 15, 2022
Ref pytorch#70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze(0, 1)
```
(assuming x has at least 2 dimensions)

ghstack-source-id: 0213d7ee9ec144aa5fdf09672c1040d85da65707
Pull Request resolved: pytorch#89017
Ref #70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze(0, 1)
```
(assuming x has at least 2 dimensions)

[ghstack-poisoned]
peterbell10 added a commit that referenced this pull request Nov 15, 2022
Ref #70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze(0, 1)
```
(assuming x has at least 2 dimensions)

ghstack-source-id: 8b633caac70900ddf35220ea66fd49d50726f7b1
Pull Request resolved: #89017
Ref #70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze(0, 1)
```
(assuming x has at least 2 dimensions)

[ghstack-poisoned]
peterbell10 added a commit that referenced this pull request Nov 15, 2022
Ref #70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze(0, 1)
```
(assuming x has at least 2 dimensions)

ghstack-source-id: 332e823eb6d1a46e1f1ebfc790e3295d1f1089bb
Pull Request resolved: #89017
Ref #70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze(0, 1)
```
(assuming x has at least 2 dimensions)

[ghstack-poisoned]
peterbell10 added a commit that referenced this pull request Nov 15, 2022
Ref #70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze(0, 1)
```
(assuming x has at least 2 dimensions)

ghstack-source-id: e65942c9ef33d8c6a73aba8dd719c6fa5baece0e
Pull Request resolved: #89017
Ref #70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze((0, 1))
```
(assuming x has at least 2 dimensions)

[ghstack-poisoned]
peterbell10 added a commit that referenced this pull request Nov 16, 2022
Ref #70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze((0, 1))
```
(assuming x has at least 2 dimensions)

ghstack-source-id: c4860734ba7154ab4073d632f3ad13def6a010f3
Pull Request resolved: #89017
@peterbell10 peterbell10 marked this pull request as ready for review November 20, 2022 21:30
@albanD
Copy link
Collaborator

albanD commented Nov 22, 2022

@mruberry can you take care of this one?

peterbell10 added a commit to peterbell10/pytorch that referenced this pull request Dec 5, 2022
Ref pytorch#70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze((0, 1))
```
(assuming x has at least 2 dimensions)

ghstack-source-id: c4860734ba7154ab4073d632f3ad13def6a010f3
Pull Request resolved: pytorch#89017
…dimensions at once"

Ref #70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze((0, 1))
```
(assuming x has at least 2 dimensions)

[ghstack-poisoned]
peterbell10 added a commit that referenced this pull request Dec 5, 2022
Ref #70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze((0, 1))
```
(assuming x has at least 2 dimensions)

ghstack-source-id: 9e7299c6b4622e12c5b4eb3706a2a50440a5db5e
Pull Request resolved: #89017
peterbell10 added a commit to peterbell10/pytorch that referenced this pull request Dec 8, 2022
Ref pytorch#70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze((0, 1))
```
(assuming x has at least 2 dimensions)

ghstack-source-id: c4860734ba7154ab4073d632f3ad13def6a010f3
Pull Request resolved: pytorch#89017
peterbell10 added a commit to peterbell10/pytorch that referenced this pull request Dec 8, 2022
Ref pytorch#70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze((0, 1))
```
(assuming x has at least 2 dimensions)

ghstack-source-id: 9e7299c6b4622e12c5b4eb3706a2a50440a5db5e
Pull Request resolved: pytorch#89017
Ref #70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze((0, 1))
```
(assuming x has at least 2 dimensions)

[ghstack-poisoned]
…ns at once"

Ref #70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze((0, 1))
```
(assuming x has at least 2 dimensions)

cc mlazos soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen chunyuan-w XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx desertfire

[ghstack-poisoned]
Copy link
Collaborator

@albanD albanD left a comment

Choose a reason for hiding this comment

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

Ok!

@peterbell10 peterbell10 added the ciflow/trunk Trigger trunk jobs on your pull request label Jan 3, 2023
@peterbell10
Copy link
Collaborator Author

@pytorchbot merge -f "ROCm timeout is unrelated"

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

razarmehr pushed a commit to kulinseth/pytorch that referenced this pull request Jan 4, 2023
Ref pytorch#70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze((0, 1))
```
(assuming x has at least 2 dimensions)

Pull Request resolved: pytorch#89017
Approved by: https://github.com/albanD
@mehtanirav
Copy link
Contributor

This PR is causing internal build failures with errors like

[2023-01-04T23:03:00.073-08:00] Stderr: fbcode/caffe2/aten/src/ATen/native/nested/NestedTensorMath.cpp:711:20: error: comparison of integers of different signs: 'int64_t' (aka 'long') and 'unsigned long' [-Werror,-Wsign-compare]
[CONTEXT] [2023-01-04T23:03:00.073-08:00]   TORCH_CHECK(ndim > 1 + dims.size(),
[CONTEXT] [2023-01-04T23:03:00.073-08:00]               ~~~~ ^ ~~~~~~~~~~~~~~~

@mehtanirav
Copy link
Contributor

@pytorchbot revert -m "Internal breakages" -c ghfirst

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

@pytorchmergebot
Copy link
Collaborator

@peterbell10 your PR has been successfully reverted.

pytorchmergebot added a commit that referenced this pull request Jan 5, 2023
@ngimel
Copy link
Collaborator

ngimel commented Jan 5, 2023

Next PR in the stack will also need to be reverted, why wasn't it reverted automatically?

@mehtanirav
Copy link
Contributor

Next PR in the stack will also need to be reverted, why wasn't it reverted automatically?

Looks like there was no conflict in reverting this PR independently. do we still need to revert #91602?

@ngimel
Copy link
Collaborator

ngimel commented Jan 5, 2023

Yes, even though there's no conflicts, #91602 relies on functionality introduced here. Could we have done a quick fix here instead? If unsigned comparison is the only problem, that's an easy forward fix.

@peterbell10 peterbell10 reopened this Jan 6, 2023
Ref #70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze((0, 1))
```
(assuming x has at least 2 dimensions)

cc mlazos soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen chunyuan-w XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx desertfire

[ghstack-poisoned]
Ref #70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze((0, 1))
```
(assuming x has at least 2 dimensions)

cc mlazos soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen chunyuan-w XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx desertfire

[ghstack-poisoned]
…t once"

Ref #70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze((0, 1))
```
(assuming x has at least 2 dimensions)

cc mlazos soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen chunyuan-w XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx desertfire

[ghstack-poisoned]
peterbell10 added a commit to peterbell10/pytorch that referenced this pull request Jan 16, 2023
Ref pytorch#70924

This addresses part 1 of the issue, allowing `torch.squeeze` to be
passed a tuple of dimensions. e.g.
```python
x.squeeze(0).squeeze(0)
```
can now be written
```python
x.squeeze((0, 1))
```
(assuming x has at least 2 dimensions)

ghstack-source-id: c8cb5290cf011cbabc372c9d23fd6707c793297f
Pull Request resolved: pytorch#89017
@peterbell10
Copy link
Collaborator Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

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.

None yet

7 participants