-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Fix mps constant pad #89864
Conversation
🔗 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 FailuresAs of commit 617f005: The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@pytorchbot label "module: mps" |
@@ -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.") |
There was a problem hiding this comment.
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.
@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. |
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 Let me know if I'm missing something. |
I see, that does make sense. Lets go with this. |
3984d9b
to
09408cd
Compare
@pytorchbot rebase |
You don't have permissions to rebase this PR, only people with write permissions may rebase PRs. |
09408cd
to
617f005
Compare
@pytorchbot merge -g |
Merge startedYour 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 |
Merge failedReason: 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 teamRaised by workflow job |
@pytorchbot merge |
Merge startedYour 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 |
Merge failedReason: 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 teamRaised by workflow job |
Hello @kulinseth, the failing tests are unrelated, should be good to merge. |
@pytorchbot merge -f "MPS tests are green" |
Merge startedYour 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 |
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
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
Support arbitrary dimensions for constant padding on MPS
Fixes #89624
Fixes #87277
cc @kulinseth @albanD @malfet @DenisVieriu97 @razarmehr @abhudev