Optimize Metal Kernels with sincos
Open
bot-triaged
enhancement
module: complex
module: mps
module: performance
triaged
- Dominant language
- Python
- Stars
- 103k
- Forks
- 29.5k
- PR merge metrics
- PR metrics pending
Description
### 🚀 The feature, motivation and pitch
A lot of complex dtypes on Metal manually implement exp_ and trigonometric functions. Main have to apply both sin and cos to the same input args to do so via trig identities. These separate calls to sin and cos can be optimized to metal::precise::sincos primitive to share the range reduction between both calls and compute the exact same answer with fewer cycle. We should update these calls to use them.
### Alternatives
_No response_
### Additional context
_No response_
cc @jerryzh168 @ezyang @anjali411 @dylanbespalko @mruberry @nikitaved @amjames @kulinseth @malfet @DenisVieriu97 @jhavukainen @aditvenk
Contributor guide
Assessment
This issue has not been assessed yet.