-
Notifications
You must be signed in to change notification settings - Fork 24.8k
[MPS][BE] Delete unused lerp functors #152443
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/152443
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 32 PendingAs of commit da6a11c with merge base d35e900 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@pytorchbot merge -f "Lint + MPS are green" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
@pytorchmergebot revert -m 'failing MPS test: test/test_optim.py::TestOptimRenewedMPS::test_can_load_from_to_named_state_dict_is_named_optim0_False_is_named_optim1_False_Adafactor_mps_float32' -c nosignal test_optim.py::TestOptimRenewedMPS::test_can_load_from_to_named_state_dict_is_named_optim0_False_is_named_optim1_False_Adafactor_mps_float32 GH job link HUD commit link |
cc @malfet |
@pytorchbot successfully started a revert job. Check the current status here. |
@malfet your PR has been successfully reverted. |
This reverts commit 0a2d320. Reverted #152443 on behalf of https://github.com/wdvr due to failing MPS test: test/test_optim.py::TestOptimRenewedMPS::test_can_load_from_to_named_state_dict_is_named_optim0_False_is_named_optim1_False_Adafactor_mps_float32 ([comment](#152443 (comment)))
Starting merge as part of PR stack under #152466 |
@pytorchbot merge -f "Lint + MPS + trunk are green" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Which multiplies two arguments for either scalar or complex data types This allows one to get rid of bunch of complex specialization in BinaryOps Pull Request resolved: #152466 Approved by: https://github.com/dcci ghstack dependencies: #152443
As well as `.add`/`.sub` with complex alpha Before this change `python3 -c "import torch;print(torch.rand(10, device='mps', dtype=torch.complex64).add(torch.rand(10, device='mps', dtype=torch.complex64), alpha=.5j))"` used to fail with ``` RuntimeError: value cannot be converted to type double without overflow ``` Pull Request resolved: #152479 Approved by: https://github.com/dcci ghstack dependencies: #152443, #152466
First of all, by extending `c10::metal::cast_to` to work correctly with complex dtypes, by introducing two more specializations: one that casts complex to scalar, and another that casts scalar to complex (as default metal typecast will turn `float x` into `float2(x, x)`) Add ComplexHalf and ComplexFloat enum values to `c10::metal::ScalarTypes` and handle them in `val_at_offs(ptr, offs, type)` Pull Request resolved: #152504 Approved by: https://github.com/dcci ghstack dependencies: #152443, #152466, #152479
Which was almost a complete copy-n-paste from exec_binary_kernel anyway Just add `Scalar` as an optional argument and figure out kernel name during the invocation rather than in executor Pull Request resolved: #152485 Approved by: https://github.com/Skylion007 ghstack dependencies: #152443, #152466, #152479, #152504
As typecasting harness shoudl take care of all permutations Fix bug in `exec_binary_kernel` where it was not properly downcasting CPU double/complexDouble scalars to floats Fixes #152582 Pull Request resolved: #152510 Approved by: https://github.com/Skylion007, https://github.com/dcci, https://github.com/cyyever ghstack dependencies: #152443, #152466, #152479, #152504, #152485
Stack from ghstack (oldest at bottom):
exec_binary_alpha_kernel
#152485c10::metal::mul
#152466For
lerp.Scalar_out
weight (aka alpha) is not an optional argument, so no point in having those specializations.But move
alpha=1.0
ahead of dispatching to Metal shaders, as plain copy of tensor should still be fasterpytorch/aten/src/ATen/native/mps/operations/BinaryOps.mm
Lines 285 to 290 in a1a4fee