-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[Inductor] added aten.cauchy_ decomp #92047
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
[Inductor] added aten.cauchy_ decomp #92047
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/92047
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit ed42dd0: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
torch/_decomp/decompositions.py
Outdated
| @register_decomposition(aten.cauchy_) | ||
| def cauchy_(self, median=0, gamma=1, generator=None): | ||
| assert generator is None | ||
| M_PI = 3.141592653589793238462643383279502 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not using math.pi?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, we should use math.pi
…ub.com/min-jean-cho/pytorch into minjean/inductor_decompose_aten_cauchy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has test covered?
|
Could you add the relevant OpInfo test? |
|
Let's split this into first adding |
| "bernoulli": {f32, f64}, | ||
| "bincount": {i32, i64}, | ||
| "bucketize": {b8, f16, f32, f64, i32, i64}, | ||
| "cauchy": {f16, f64}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this add expected failures?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what's the story with inductor opinfo testing now? It can't be passing because results for random sampling would be different between eager and inductor. Is the test not run?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can't be passing because results for random sampling would be different between eager and inductor. Is the test not run?
Yes, the tests will be skipped because eager --vs-- inductor randomness are not comparable. (The tests are not skipped due to graph break of inplace ops; graph break has been resolved in #93243.)
But I don't know why some inductor randomness tests (eg: uniform cpu float32, float64) have passed. https://github.com/pytorch/pytorch/pull/93243/files#r1094149843
I'm not sure how generator is partially supported in inductor.
) Related #92047 (1) `torch.Tensor.cauchy_` is missing check for `gamma > 0` (`torch.distributions.cauchy.Cauchy` correctly checks `gamma > 0`). (2) add better error log on dtype similar to exponential_ Pull Request resolved: #93314 Approved by: https://github.com/jgong5, https://github.com/fritzo, https://github.com/lezcano
…ub.com/min-jean-cho/pytorch into minjean/inductor_decompose_aten_cauchy
…ub.com/min-jean-cho/pytorch into minjean/inductor_decompose_aten_cauchy
|
[Cauchy] Hi all, thank you for the review. I see all tests have passed now - I've made few minor changes since the last approvals, could you help have a final scan ? |
|
@pytorchbot merge |
Merge startedYour 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 |
Fixes #91675
TODO: compare perf of decomposed tan --vs-- libdevice tan, aten tan for triton, cpp backeneds
cc @mlazos @soumith @voznesenskym @yanboliang @penguinwu @anijain2305 @EikanWang @jgong5 @Guobing-Chen @chunyuan-w @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @desertfire