Skip to content

[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

Closed
wants to merge 4 commits into from

Conversation

malfet
Copy link
Contributor

@malfet malfet commented Apr 29, 2025

Stack from ghstack (oldest at bottom):

For 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 faster

if (!alpha_has_value && op_name == "lerp") {
if (!self.is_alias_of(other)) { // if inplace, no-op
output.copy_(other);
}
return;
}

[ghstack-poisoned]
@malfet malfet requested a review from kulinseth as a code owner April 29, 2025 18:22
Copy link

pytorch-bot bot commented Apr 29, 2025

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

As of commit da6a11c with merge base d35e900 (image):
💚 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 Apr 29, 2025
@malfet malfet added the topic: not user facing topic category label Apr 29, 2025
@malfet malfet requested a review from Skylion007 April 29, 2025 18:27
@malfet
Copy link
Contributor Author

malfet commented Apr 29, 2025

@pytorchbot merge -f "Lint + MPS are 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). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

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

@wdvr
Copy link
Contributor

wdvr commented Apr 29, 2025

@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

@wdvr
Copy link
Contributor

wdvr commented Apr 29, 2025

cc @malfet

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

@pytorchmergebot
Copy link
Collaborator

@malfet your PR has been successfully reverted.

pytorchmergebot added a commit that referenced this pull request Apr 29, 2025
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)))
@pytorchmergebot pytorchmergebot added Reverted ci-no-td Do not run TD on this PR labels Apr 29, 2025
@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #152466

malfet added 2 commits April 29, 2025 16:38
[ghstack-poisoned]
[ghstack-poisoned]
@malfet malfet added the ciflow/trunk Trigger trunk jobs on your pull request label Apr 30, 2025
[ghstack-poisoned]
@malfet
Copy link
Contributor Author

malfet commented Apr 30, 2025

@pytorchbot merge -f "Lint + MPS + trunk are 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). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

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 pushed a commit that referenced this pull request Apr 30, 2025
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
pytorchmergebot pushed a commit that referenced this pull request Apr 30, 2025
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
pytorchmergebot pushed a commit that referenced this pull request Apr 30, 2025
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
pytorchmergebot pushed a commit that referenced this pull request Apr 30, 2025
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
pytorchmergebot pushed a commit that referenced this pull request May 1, 2025
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
@github-actions github-actions bot deleted the gh/malfet/308/head branch June 14, 2025 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-no-td Do not run TD on this PR ciflow/mps Run MPS tests (subset of trunk) ciflow/trunk Trigger trunk jobs on your pull request Merged release notes: mps Release notes category Reverted topic: not user facing topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy