Skip to content

Conversation

@DenisVieriu97
Copy link
Collaborator

Adds nonzero support for mps:

Pseudocode:

//
// inputTensor   = [1,  0,  0,  3]
// inputNonZero  = [1,  0,  0,  1] (input != 0)
// scan          = [1,  1,  1,  2] (prefix sum)
// maskedIndices = [0, -1, -1,  1] (select)
// coordinates   = [0,  1,  2,  3] (coordinateAlongAxis)
// scatterResult = [0,  3]         (scatter)

DenisVieriu97 and others added 3 commits January 2, 2023 23:19
* Add nonzero op support for mps

* Fix graph caching for nonzero op (use unranked placeholder for output)

* Add support for nonzero op starting from macOS Ventura. Fallback to CPU for older OS versions
@DenisVieriu97 DenisVieriu97 added the ciflow/mps Run MPS tests (subset of trunk) label Jan 3, 2023
@pytorch-bot
Copy link

pytorch-bot bot commented Jan 3, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/91616

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

❌ 1 Failures

As of commit 04afc3c:

FLAKY - The following jobs failed but were likely due to flakiness present on master:

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

@pytorch-bot pytorch-bot bot added the release notes: mps Release notes category label Jan 3, 2023
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

@DenisVieriu97
Copy link
Collaborator Author

@pytorchbot merge -g

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Jan 3, 2023
@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@DenisVieriu97
Copy link
Collaborator Author

@pytorchbot merge -g

@pytorchmergebot
Copy link
Collaborator

The merge job was canceled. If you believe this is a mistake,then you can re trigger it through pytorch-bot.

@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 2 additional jobs have failed, first few of them are: trunk ,trunk / linux-focal-rocm5.3-py3.8 / test (default, 2, 2, linux.rocm.gpu)

Details for Dev Infra team Raised by workflow job

@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

return out_;
}

bool contiguous_output = (out_.is_contiguous() && !out_.is_view());
Copy link
Contributor

@malfet malfet Jan 4, 2023

Choose a reason for hiding this comment

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

This feels wrong (i.e. non-contiguous tensors can sometimes be reported as contiguous and views are sometimes contiguous) Is there an umbrella issue that talks about MPS support for non-contiguous tensors?)

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) ciflow/trunk Trigger trunk jobs on your pull request Merged open source release notes: mps Release notes category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants