Skip to content
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

[RFC] Add result accuracy to unary ops #2592

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Conversation

hanrach9
Copy link

@hanrach9 hanrach9 commented Oct 15, 2024

This is a proposal to add result_accuracy attribute to the following transcendental unary ops to StableHLO: sin, cos, tan, tanh, sqrt, rsqrt,
cbrt, exp, expm1, log, logp1, logistic and erf. Any feedback would be appreciated, thanks!

Proposal to add result_accuracy to the following transcendental unary ops: `exp`, `expm1`, `log`, `logp1`, `logistic` and `tanh`.
[RFC] Add result accuracy to transcendental unary ops
@hanrach9 hanrach9 marked this pull request as draft October 15, 2024 23:14
@hanrach9 hanrach9 marked this pull request as ready for review October 16, 2024 22:37
rfcs/20241015-result-accuracy.md Outdated Show resolved Hide resolved
rfcs/20241015-result-accuracy.md Outdated Show resolved Hide resolved
@hanrach9 hanrach9 changed the title [RFC] Add result accuracy to transcendental unary ops [RFC] Add result accuracy to unary ops Oct 23, 2024
@dimvar
Copy link

dimvar commented Oct 29, 2024

  • Is DEFAULT the same as the current accuracy for these ops?
  • Can you give some information on what motivated this RFC? E.g., links to recent bugs, or something else.

@hanrach9
Copy link
Author

Replying to @dimvar,

  • Is DEFAULT the same as the current accuracy for these ops?

Yes.

  • Can you give some information on what motivated this RFC? E.g., links to recent bugs, or something else.

We have higher accuracy software versions of these functions when the hardware accuracy isn't good enough, and we want to enable the accurate versions from Jax. Also it's been difficult for Jax users to reconcile inconsistent numerical behaviors when they depend on these functions across devices. This lets you express your requirements to the compiler in a device-independent fashion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants