-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[MPS] Add missing backward for _upsample_bicubic2d_aa support #169785
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
base: main
Are you sure you want to change the base?
[MPS] Add missing backward for _upsample_bicubic2d_aa support #169785
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/169785
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ No FailuresAs of commit 0cd700d with merge base 3ab4b9a ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Attention! native_functions.yaml was changedIf you are adding a new function or defaulted argument to native_functions.yaml, you cannot use it from pre-existing Python frontend code until our FC window passes (two weeks). Split your PR into two PRs, one which adds the new C++ functionality, and one that makes use of it from Python, and land them two weeks apart. See https://github.com/pytorch/pytorch/wiki/PyTorch's-Python-Frontend-Backward-and-Forward-Compatibility-Policy#forwards-compatibility-fc for more info. Caused by: |
|
@malfet |
kurtamohler
left a comment
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.
Thanks for the PR! I left a few suggestions
| @@ -6075,6 +6075,38 @@ def interp(x): | |||
| return F.interpolate(x, 3, mode='linear', align_corners=align_corners) | |||
| self.assertEqual(interp(inp).cpu(), interp(inp.cpu())) | |||
|
|
|||
| def test_interpolate_bicubic2d_aa(self): | |||
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.
Does this test specifically add something that the existing OpInfo tests don't? If not, I think it can probably be removed
| uint thread_index [[thread_position_in_grid]]) { | ||
| auto output_x = thread_index % static_cast<uint>(output_sizes.w); | ||
| auto output_y = thread_index / static_cast<uint>(output_sizes.w); | ||
| (void)align_corners; // Align corners is unused for AA algorithm |
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.
nit: This line isn't really necessary is it?
| constant bool& align_corners [[buffer(7)]], \ | ||
| uint thread_index [[thread_position_in_grid]]) | ||
|
|
||
| #define INSTANTIATE_UPSAMPLE_2D_AA_BACKWARD(NAME, FUNCTOR, DTYPE) \ |
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.
Looks like this is an exact duplicate of the one above, right?
Fixes #141287
Implemented missing backward for already implemented _upsample_bilinear2d_aa mps support.
Confirmed this is under to-be-implemented from the tracking board here
Summary: