pytorch icon indicating copy to clipboard operation
pytorch copied to clipboard

[MPS] Native nonzero implementation

Open DenisVieriu97 opened this issue 9 months ago • 2 comments

Fixes https://github.com/pytorch/pytorch/issues/124850

Replace previous MPSGraph nonzero construction with native nonzero op. For older OSes, fallback to CPU (previous implementation was not reliable and was comparable to CPU in speed).

cc @skotapati

DenisVieriu97 avatar May 01 '24 23:05 DenisVieriu97

:link: Helpful Links

:test_tube: See artifacts and rendered test results at hud.pytorch.org/pr/125355

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

:white_check_mark: No Failures

As of commit 2f3d603493c784916b21b9bd65ab87b5d8d7d191 with merge base 1eb7b8eb6085322c96ba0bbacb039ef6f3b2875b (image): :green_heart: Looks good so far! There are no failures yet. :green_heart:

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

pytorch-bot[bot] avatar May 01 '24 23:05 pytorch-bot[bot]

=================================== FAILURES ===================================
_________ TestConsistencyCPU.test_output_match_argwhere_cpu_complex64 __________
Unexpected success
-----------------

@DenisVieriu97 , this test is passing on MacOS 13 as well.

diff --git a/test/test_mps.py b/test/test_mps.py
index 817a93fbb9e..34cc9663008 100644
--- a/test/test_mps.py
+++ b/test/test_mps.py
@@ -344,7 +344,6 @@ def mps_ops_modifier(ops):
         'any',
         'addcdiv',
         'addcmul',
-        'argwhere',
         'asin',
         'atan',
         'atanh',

Lets remove it from the After macOS 14 test list.

kulinseth avatar May 02 '24 14:05 kulinseth

@pytorchbot merge -g

DenisVieriu97 avatar May 03 '24 00:05 DenisVieriu97

❌ 🤖 pytorchbot command failed:

@pytorchbot: error: unrecognized arguments: -g

usage: @pytorchbot [-h] {merge,revert,rebase,label,drci,cherry-pick,close} ...

Try @pytorchbot --help for more info.

pytorch-bot[bot] avatar May 03 '24 00:05 pytorch-bot[bot]

@pytorchbot merge

DenisVieriu97 avatar May 03 '24 00:05 DenisVieriu97

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 avatar May 03 '24 00:05 pytorchmergebot

@pytorchbot cherry-pick --onto release/2.3 -c critical

atalman avatar May 13 '24 20:05 atalman

Cherry picking #125355

The cherry pick PR is at https://github.com/pytorch/pytorch/pull/126100 and it is recommended to link a critical cherry pick PR with an issue

Details for Dev Infra team Raised by workflow job

pytorchbot avatar May 13 '24 20:05 pytorchbot