-
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
[MPS] Add 2d grid sampler #94273
[MPS] Add 2d grid sampler #94273
Conversation
* Add grid sampler op * Add fallback support * Update grid_sampler_2d to use roundToEven for nearest case * Remove tabs * Fix indentation
* Fix macos subversion check for grid sampler fallback * Address PR comments
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/94273
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 FailuresAs of commit d5e134b: BROKEN TRUNK - The following jobs failed but were present on the merge base b562be7:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@@ -7187,6 +7187,244 @@ def test_conv2d_single_stride(self): | |||
x_gpu = conv_gpu(y_gpu) | |||
self.assertEqual(x_cpu, x_gpu.cpu(), rtol=1e-03, atol=1e-05) | |||
|
|||
def test_grid_sample(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.
There is no test in TestConsistency ?
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.
TestConsistency uses border padding which is unsupported through MPS at this moment.
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.
LGTM
@pytorchbot merge -f "Lint+MPS is 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 |
Tensor grid_sampler_2d_mps(const Tensor& input, const Tensor& grid, | ||
int64_t interpolation_mode, int64_t padding_mode, | ||
bool align_corners) { | ||
#if defined(__MAC_13_2) |
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.
This means that GridSample is likely not available in any of our binary builds... :/
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.
Interesting. There is a test added for grid sampler which should fail if that is the case. I'll take a look
Add support for MPS grid sampler