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 mps constant pad #89864

Closed
wants to merge 4 commits into from
Closed

Fix mps constant pad #89864

wants to merge 4 commits into from

Conversation

qqaatw
Copy link
Collaborator

@qqaatw qqaatw commented Nov 29, 2022

Support arbitrary dimensions for constant padding on MPS

Fixes #89624
Fixes #87277

cc @kulinseth @albanD @malfet @DenisVieriu97 @razarmehr @abhudev

@pytorch-bot
Copy link

pytorch-bot bot commented Nov 29, 2022

🔗 Helpful Links

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

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

❌ 1 Failures

As of commit 617f005:

The following jobs have failed:

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

@pytorch-bot pytorch-bot bot added ciflow/mps Run MPS tests (subset of trunk) release notes: mps Release notes category labels Nov 29, 2022
@qqaatw
Copy link
Collaborator Author

qqaatw commented Nov 29, 2022

@pytorchbot label "module: mps"

@pytorch-bot pytorch-bot bot added the module: mps Related to Apple Metal Performance Shaders framework label Nov 29, 2022
@@ -15,27 +15,28 @@
const int padding_size = (int) padding.size();
const int padding_dim = padding_size / 2; // either 1D, 2D, or 3D

TORCH_CHECK(input_.numel() != 0, "MPS currently doesn't support zero-element input.")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added a check to prevent users from getting an uninitialized empty output when the padding mode is constant and the number of input elements is 0.

@drisspg drisspg requested a review from albanD December 1, 2022 17:33
@drisspg drisspg added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Dec 1, 2022
@drisspg drisspg requested a review from malfet December 1, 2022 17:33
@qqaatw
Copy link
Collaborator Author

qqaatw commented Dec 6, 2022

@kulinseth Hello can you please review?

@kulinseth
Copy link
Collaborator

@kulinseth Hello can you please review?

Hi @qqaatw , there was a more comprehensive fix we had, I am working on creating a PR. Can you take a look at that? if it addresses this PR. I will update here.

@qqaatw
Copy link
Collaborator Author

qqaatw commented Dec 7, 2022

Hello @kulinseth, did you refer to this kulinseth#144?

I've taken a look, and it seems to only remove some checks for constant padding, which is necessary indeed but doesn't support arbitrary dimensions inputs, as noted on the padding mode section on the docs.

Let me know if I'm missing something.

@kulinseth
Copy link
Collaborator

Hello @kulinseth, did you refer to this kulinseth#144?

I've taken a look, and it seems to only remove some checks for constant padding, which is necessary indeed but doesn't support arbitrary dimensions inputs, as noted on the padding mode section on the docs.

Let me know if I'm missing something.

I see, that does make sense. Lets go with this.

@qqaatw
Copy link
Collaborator Author

qqaatw commented Dec 13, 2022

@pytorchbot rebase

@pytorch-bot
Copy link

pytorch-bot bot commented Dec 13, 2022

You don't have permissions to rebase this PR, only people with write permissions may rebase PRs.

@qqaatw
Copy link
Collaborator Author

qqaatw commented Dec 13, 2022

@pytorchbot merge -g

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Dec 13, 2022
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks on your PR pass since you used the green (-g) flag (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

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 2 additional jobs have failed, first few of them are: trunk ,trunk / cuda11.6-py3.10-gcc7-sm86 / test (default, 2, 4, linux.g5.4xlarge.nvidia.gpu)

Details for Dev Infra team Raised by workflow job

@qqaatw
Copy link
Collaborator Author

qqaatw commented Dec 13, 2022

@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

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 2 additional jobs have failed, first few of them are: trunk ,trunk / cuda11.6-py3.10-gcc7-sm86 / test (default, 2, 4, linux.g5.4xlarge.nvidia.gpu)

Details for Dev Infra team Raised by workflow job

@qqaatw
Copy link
Collaborator Author

qqaatw commented Dec 13, 2022

Hello @kulinseth, the failing tests are unrelated, should be good to merge.

@malfet
Copy link
Contributor

malfet commented Dec 13, 2022

@pytorchbot merge -f "MPS tests are green"

@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 Dec 14, 2022
Support arbitrary dimensions for constant padding on MPS

Fixes pytorch#89624
Fixes pytorch#87277

Pull Request resolved: pytorch#89864
Approved by: https://github.com/kulinseth, https://github.com/malfet
kulinseth pushed a commit to kulinseth/pytorch that referenced this pull request Feb 6, 2023
Support arbitrary dimensions for constant padding on MPS

Fixes pytorch#89624
Fixes pytorch#87277

Pull Request resolved: pytorch#89864
Approved by: https://github.com/kulinseth, https://github.com/malfet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/mps Run MPS tests (subset of trunk) ciflow/trunk Trigger trunk jobs on your pull request Merged module: mps Related to Apple Metal Performance Shaders framework open source release notes: mps Release notes category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
6 participants