Skip to content

Conversation

@min-jean-cho
Copy link
Collaborator

@min-jean-cho min-jean-cho commented Jan 11, 2023

@pytorch-bot
Copy link

pytorch-bot bot commented Jan 11, 2023

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

As of commit ed42dd0:
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@register_decomposition(aten.cauchy_)
def cauchy_(self, median=0, gamma=1, generator=None):
assert generator is None
M_PI = 3.141592653589793238462643383279502
Copy link
Collaborator

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?

Copy link
Collaborator Author

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

@min-jean-cho min-jean-cho requested a review from jgong5 January 17, 2023 22:00
@min-jean-cho min-jean-cho marked this pull request as ready for review January 17, 2023 22:45
Copy link
Collaborator

@jgong5 jgong5 left a 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?

@lezcano
Copy link
Collaborator

lezcano commented Jan 18, 2023

Could you add the relevant OpInfo test?

@ngimel
Copy link
Collaborator

ngimel commented Jan 22, 2023

Let's split this into first adding tan lowering to inductor, and then add cauchy decomposition that'll also require some changes to vmap testing. For inductot tan lowering you'd need to use libdevice for triton, see other math functions for examples of how this is done.

"bernoulli": {f32, f64},
"bincount": {i32, i64},
"bucketize": {b8, f16, f32, f64, i32, i64},
"cauchy": {f16, f64},
Copy link
Contributor

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jansel, they shouldn't. The in-place sampling ops cause graph breaks with nopython=True. I'll remove the graph breaks prior to these decomps. Please see discussion here #92709. What do you think?

Copy link
Collaborator

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?

Copy link
Collaborator Author

@min-jean-cho min-jean-cho Feb 7, 2023

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.

@ngimel ngimel added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Jan 28, 2023
pytorchmergebot pushed a commit that referenced this pull request Feb 3, 2023
)

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
@min-jean-cho
Copy link
Collaborator Author

min-jean-cho commented Feb 8, 2023

[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 ?

@min-jean-cho
Copy link
Collaborator Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Feb 8, 2023
@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/inductor ciflow/trunk Trigger trunk jobs on your pull request Merged module: inductor open source triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFC] [Inductor] decompose aten.cauchy_

7 participants