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

Add StableHLO complex log to stablehlo-complex-math-expander pass #2681

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

Conversation

pearu
Copy link
Contributor

@pearu pearu commented Dec 31, 2024

As in the title. This PR is created on top of the branch of #2679.

This PR improves the accuracy of JAX complex log function as follows:

Before
------
test_accuracy.py::test_unary[log-jax-cpu-complex64-default] maximal ULP difference: 4294967296
ULP difference == 0: 1612359
ULP difference == 1: 487617
ULP difference == 2: 306
ULP difference == 3: 140
ULP difference == 4: 68
ULP difference == 5: 49
ULP difference == 6: 26
ULP difference == 7: 35
ULP difference == 8: 19
ULP difference == 9: 15
ULP difference == 10: 15
ULP difference >= 11: 151

test_accuracy.py::test_unary[log-jax-cuda-complex64-default] maximal ULP difference: 4294967296
ULP difference == 0: 1797796
ULP difference == 1: 301398
ULP difference == 2: 1044
ULP difference == 3: 169
ULP difference == 4: 85
ULP difference == 5: 51
ULP difference == 6: 32
ULP difference == 7: 20
ULP difference == 8: 7
ULP difference == 9: 13
ULP difference == 10: 8
ULP difference >= 11: 177

After
-----
test_accuracy.py::test_unary[log-jax-cpu-complex64-default] maximal ULP difference: 3
ULP difference == 0: 1581126
ULP difference == 1: 519652
ULP difference == 2: 19
ULP difference == 3: 3

test_accuracy.py::test_unary[log-jax-cuda-complex64-default] maximal ULP difference: 2
ULP difference == 0: 1775914
ULP difference == 1: 324185
ULP difference == 2: 701

The corresponding accuracy patterns are available in pearu/functional_algorithms#46 (comment) .

@pearu
Copy link
Contributor Author

pearu commented Dec 31, 2024

@GleasonK , please review.

@GleasonK
Copy link
Member

Hey! The team is mostly OOO until ~Jan 3-6th

cc @sdasgup3 @ghpvnist @abhigunj if any of you are back before the 6th PTAL

Copy link
Member

@ghpvnist ghpvnist left a comment

Choose a reason for hiding this comment

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

LGTM. Once sqrt PR is merged, let's rebase and submit.

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.

4 participants