pytorch - 💡(How to fix) Fix Optimize Metal Kernels with sincos [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

🚀 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

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING