Skip to content

Conversation

@kvathupo
Copy link
Contributor

@kvathupo kvathupo commented Mar 11, 2023

What?
Per discussion at #94634, deprecate masked_fill with non-bool masks. Deprecation warnings were previously added by #22261, but not for Apple MPS. I can revert the MPS changes if deprecation warnings are wanted first tho. See also #96112.

Fixes #85063 and #89320.

Further Development?

  • Fixed the mask dtype checking for the cuda dispatch for masked_fill in aten/src/ATen/native/cuda/Indexing.cu

cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @EikanWang @soumith @voznesenskym @penguinwu @anijain2305 @Guobing-Chen @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @desertfire

@pytorch-bot
Copy link

pytorch-bot bot commented Mar 11, 2023

🔗 Helpful Links

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

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

✅ No Failures

As of commit b80429e:
💚 Looks good so far! There are no failures yet. 💚

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

@pytorch-bot pytorch-bot bot added ciflow/mps Run MPS tests (subset of trunk) release notes: mps Release notes category labels Mar 11, 2023
@github-actions github-actions bot added module: cpu CPU specific problem (e.g., perf, algorithm) release notes: quantization release notes category labels Mar 11, 2023
@kvathupo kvathupo marked this pull request as ready for review March 12, 2023 14:20
@kvathupo
Copy link
Contributor Author

CC: @malfet @ngimel

Copy link
Contributor

@malfet malfet left a comment

Choose a reason for hiding this comment

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

Thank you very much for the PR. Looks good to me.
Please cleanup mask_t template parameter (left a few suggestions, tough technically its optional)

@malfet malfet added topic: bc breaking topic category release notes: python_frontend python frontend release notes category and removed release notes: quantization release notes category release notes: mps Release notes category labels Mar 12, 2023
@github-actions github-actions bot added the release notes: quantization release notes category label Mar 12, 2023
@kvathupo
Copy link
Contributor Author

Thank you very much for the PR. Looks good to me. Please cleanup mask_t template parameter (left a few suggestions, tough technically its optional)

Applied, looks cleaner without the redundant bool params and checks !

Copy link
Collaborator

@ngimel ngimel left a comment

Choose a reason for hiding this comment

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

Let's hope nothing breaks

@kvathupo
Copy link
Contributor Author

@pytorchbot merge

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

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

cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Mar 23, 2023
__What?__
Per discussion at #94634, deprecate `masked_fill` with non-bool masks. Deprecation warnings were previously added by #22261, but not for Apple MPS. I can revert the MPS changes if deprecation warnings are wanted first tho. See also #96112.

Fixes #85063 and #89320.

__Further Development?__
- Fixed the mask dtype checking for the cuda dispatch for `masked_fill` in `aten/src/ATen/native/cuda/Indexing.cu`

Pull Request resolved: pytorch/pytorch#96594
Approved by: https://github.com/malfet, https://github.com/ngimel
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Mar 27, 2023
__What?__
Per discussion at #94634, deprecate `masked_fill` with non-bool masks. Deprecation warnings were previously added by #22261, but not for Apple MPS. I can revert the MPS changes if deprecation warnings are wanted first tho. See also #96112.

Fixes #85063 and #89320.

__Further Development?__
- Fixed the mask dtype checking for the cuda dispatch for `masked_fill` in `aten/src/ATen/native/cuda/Indexing.cu`

Pull Request resolved: pytorch/pytorch#96594
Approved by: https://github.com/malfet, https://github.com/ngimel
pytorchmergebot pushed a commit that referenced this pull request Apr 1, 2023
Modify test_torch to check that assert is raised in this case

torch.uint8 usage has been deprecated for a few releases, and errors has been raised for other dtypes on CUDA device, but not on CPU.
This PR finally restricts mask to just `torch.bool`
See #96594 as an example doing it for `torch.masked_fill`

Fixes #94634

Pull Request resolved: #97999
Approved by: https://github.com/ngimel
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 module: cpu CPU specific problem (e.g., perf, algorithm) open source release notes: python_frontend python frontend release notes category release notes: quantization release notes category topic: bc breaking topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tensor.masked_fill treats DoubleTensor masks as BoolTensor masks of all False

5 participants