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

Merged
merged 1 commit into from
Jan 8, 2025

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.

@GleasonK
Copy link
Member

GleasonK commented Jan 8, 2025

There are some merge conflicts between the 3 PRs.. let's get them in 1 at a time

@pearu
Copy link
Contributor Author

pearu commented Jan 8, 2025

@GleasonK this PR is ready for landing.

@GleasonK GleasonK merged commit f67c73d into openxla:main Jan 8, 2025
10 checks passed
GleasonK pushed a commit that referenced this pull request Jan 8, 2025
…pass (#2682)

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

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

```
Before
------

test_unary[exp-jax-cpu-complex64-default] maximal ULP difference: 4294967296
ULP difference == 0: 1964868
ULP difference == 1: 133291
ULP difference == 2: 1035
ULP difference == 4294967296: 1606

test_unary[exp-jax-cuda-complex64-default] maximal ULP difference: 4294967296
ULP difference == 0: 1787925
ULP difference == 1: 300591
ULP difference == 2: 10657
ULP difference == 3: 79
ULP difference == 4294967296: 1548

After
-----

test_unary[exp-jax-cpu-complex64-default] maximal ULP difference: 2
ULP difference == 0: 1966101
ULP difference == 1: 133662
ULP difference == 2: 1037

test_unary[exp-jax-cuda-complex64-default] maximal ULP difference: 3
ULP difference == 0: 1788889
ULP difference == 1: 301112
ULP difference == 2: 10720
ULP difference == 3: 79
```

The corresponding accuracy patterns are available in
pearu/functional_algorithms#44 (comment)
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