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

[MPS] Add 2d grid sampler #94273

Closed
wants to merge 7 commits into from

Conversation

DenisVieriu97
Copy link
Collaborator

@DenisVieriu97 DenisVieriu97 commented Feb 7, 2023

Add support for MPS grid sampler

DenisVieriu97 and others added 5 commits February 6, 2023 20:05
* 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
@DenisVieriu97 DenisVieriu97 added the ciflow/mps Run MPS tests (subset of trunk) label Feb 7, 2023
@pytorch-bot pytorch-bot bot added the release notes: mps Release notes category label Feb 7, 2023
@pytorch-bot
Copy link

pytorch-bot bot commented Feb 7, 2023

🔗 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 Failures

As 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.

aten/src/ATen/mps/MPSDevice.mm Outdated Show resolved Hide resolved
@@ -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):
Copy link
Collaborator

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 ?

Copy link
Collaborator Author

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.

Copy link
Collaborator

@razarmehr razarmehr left a comment

Choose a reason for hiding this comment

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

LGTM

@soulitzer soulitzer added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Feb 8, 2023
@DenisVieriu97
Copy link
Collaborator Author

@pytorchbot merge -f "Lint+MPS is 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

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)
Copy link
Contributor

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... :/

Copy link
Collaborator Author

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

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) Merged 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
Development

Successfully merging this pull request may close these issues.

None yet

7 participants