Skip to content

Conversation

@pearu
Copy link
Collaborator

@pearu pearu commented Mar 8, 2024

As in the title.

openxla/xla#10376 fixes all inaccuracy issues in jax.numpy.expm1:

openxla/xla#10503 fixes all inaccuracy issues in jax.numpy.log1p:

  • before this PR the mismatch rate was 42.5%
  • after this PR the inaccuracies rate is 0%
  • In addition to log1p, there exists accuracy improvements for arctanh:
    • jax.numpy.arctanh mistmatch before is 55.5% and after 11.3 %

openxla/xla#10525 fixes all inaccuracy issues in jax.numpy.tan:

  • TBD

@google-ml-butler google-ml-butler bot added kokoro:force-run pull ready Ready for copybara import and testing labels Mar 8, 2024
@jakevdp jakevdp self-assigned this Mar 8, 2024
@jakevdp
Copy link
Collaborator

jakevdp commented Mar 8, 2024

There are some failures in one of the CI jobs – looks like inf/nan mismatches.

@pearu
Copy link
Collaborator Author

pearu commented Mar 8, 2024

There are some failures in one of the CI jobs – looks like inf/nan mismatches.

Yes, I am in a process of fixing these. These emerged because the closeness checking is changed in this PR and the mapping of inaccuracy lists requires updates re the tests that passed false-positively before.

@jakevdp jakevdp added pull ready Ready for copybara import and testing and removed pull ready Ready for copybara import and testing labels Mar 13, 2024
@jakevdp
Copy link
Collaborator

jakevdp commented Mar 13, 2024

Tests are failing on internal CPU.

Overall, I think the issue here is that these tests are too brittle: they make detailed assertions about the dark corners of hardware-dependent implementation details. Rather than add more exceptions for particular backends / package versions / devices / etc. I think it would be better to make the tests simpler and less brittle. What do you think?

@pearu
Copy link
Collaborator Author

pearu commented Mar 13, 2024

xla_extension_version >= 244 needs to be updated as the current xla_extension_version value conflicts with the one in the main branch, hence the test failures.

@pearu
Copy link
Collaborator Author

pearu commented Mar 13, 2024

... I think it would be better to make the tests simpler and less brittle.

I agree. I suggest replacing numpy with mpmath as a reference library.

@jakevdp jakevdp added the pull ready Ready for copybara import and testing label Mar 21, 2024
@jakevdp jakevdp assigned hawkinsp and unassigned jakevdp Mar 22, 2024
@pearu
Copy link
Collaborator Author

pearu commented Mar 22, 2024

Closing as #20373 has landed.

The items in the description will be addressed in follow-up PRs.

@pearu pearu closed this Mar 22, 2024
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Mar 26, 2024
…te values. Add Cosm1.

Imported from GitHub PR openxla/xla#10376

As in the title.

Tests and improvement reports are in jax-ml/jax#20144.

Accuracy tests are enabled in jax-ml/jax#20436
Copybara import of the project:

--
42e222a436787c52adf453c8c0c39125b010e2b2 by Pearu Peterson <pearu.peterson@gmail.com>:

Fix expm1 inaccuracies on complex inputs with small absolute values. Add Cosm1.
Fix expm1(x+yi) when x is large and y is zero.

Merging this change closes #10376

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#10376 from pearu:pearu/expm1 42e222a436787c52adf453c8c0c39125b010e2b2
PiperOrigin-RevId: 619208374
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Mar 26, 2024
…te values. Add Cosm1.

Imported from GitHub PR openxla/xla#10376

As in the title.

Tests and improvement reports are in jax-ml/jax#20144.

Accuracy tests are enabled in jax-ml/jax#20436
Copybara import of the project:

--
42e222a436787c52adf453c8c0c39125b010e2b2 by Pearu Peterson <pearu.peterson@gmail.com>:

Fix expm1 inaccuracies on complex inputs with small absolute values. Add Cosm1.
Fix expm1(x+yi) when x is large and y is zero.

Merging this change closes #10376

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#10376 from pearu:pearu/expm1 42e222a436787c52adf453c8c0c39125b010e2b2
PiperOrigin-RevId: 619208374
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Mar 26, 2024
…te values. Add Cosm1.

Imported from GitHub PR openxla/xla#10376

As in the title.

Tests and improvement reports are in jax-ml/jax#20144.

Accuracy tests are enabled in jax-ml/jax#20436
Copybara import of the project:

--
42e222a436787c52adf453c8c0c39125b010e2b2 by Pearu Peterson <pearu.peterson@gmail.com>:

Fix expm1 inaccuracies on complex inputs with small absolute values. Add Cosm1.
Fix expm1(x+yi) when x is large and y is zero.

Merging this change closes #10376

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#10376 from pearu:pearu/expm1 42e222a436787c52adf453c8c0c39125b010e2b2
PiperOrigin-RevId: 619208374
copybara-service bot pushed a commit to openxla/xla that referenced this pull request Mar 26, 2024
…te values. Add Cosm1.

Imported from GitHub PR #10376

As in the title.

Tests and improvement reports are in jax-ml/jax#20144.

Accuracy tests are enabled in jax-ml/jax#20436
Copybara import of the project:

--
42e222a by Pearu Peterson <pearu.peterson@gmail.com>:

Fix expm1 inaccuracies on complex inputs with small absolute values. Add Cosm1.
Fix expm1(x+yi) when x is large and y is zero.

Merging this change closes #10376

COPYBARA_INTEGRATE_REVIEW=#10376 from pearu:pearu/expm1 42e222a
PiperOrigin-RevId: 619324160
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Mar 26, 2024
…te values. Add Cosm1.

Imported from GitHub PR openxla/xla#10376

As in the title.

Tests and improvement reports are in jax-ml/jax#20144.

Accuracy tests are enabled in jax-ml/jax#20436
Copybara import of the project:

--
42e222a436787c52adf453c8c0c39125b010e2b2 by Pearu Peterson <pearu.peterson@gmail.com>:

Fix expm1 inaccuracies on complex inputs with small absolute values. Add Cosm1.
Fix expm1(x+yi) when x is large and y is zero.

Merging this change closes #10376

PiperOrigin-RevId: 619324160
copybara-service bot pushed a commit to openxla/xla that referenced this pull request Apr 4, 2024
…te values.

Imported from GitHub PR #10503

As in the title.

Tests and improvement reports are in jax-ml/jax#20144.

Accuracy tests are enabled in jax-ml/jax#20436
Copybara import of the project:

--
2b8f253 by Pearu Peterson <pearu.peterson@gmail.com>:

Fix log1p inaccuracies on complex inputs with large absolute values.

--
d35cef4 by Pearu Peterson <pearu.peterson@gmail.com>:

Add tests to complex Log1p

Merging this change closes #10503

FUTURE_COPYBARA_INTEGRATE_REVIEW=#10503 from pearu:pearu/log1p d35cef4
PiperOrigin-RevId: 620293408
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Apr 4, 2024
…te values.

Imported from GitHub PR openxla/xla#10503

As in the title.

Tests and improvement reports are in jax-ml/jax#20144.

Accuracy tests are enabled in jax-ml/jax#20436
Copybara import of the project:

--
2b8f2539d6bf364c0a97f65e186430c5eb3ed07b by Pearu Peterson <pearu.peterson@gmail.com>:

Fix log1p inaccuracies on complex inputs with large absolute values.

--
d35cef4f5fa09482c49edfee709e86c5ca29adde by Pearu Peterson <pearu.peterson@gmail.com>:

Add tests to complex Log1p

Merging this change closes #10503

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#10503 from pearu:pearu/log1p d35cef4f5fa09482c49edfee709e86c5ca29adde
PiperOrigin-RevId: 620293408
copybara-service bot pushed a commit to openxla/xla that referenced this pull request Apr 4, 2024
…te values.

Imported from GitHub PR #10503

As in the title.

Tests and improvement reports are in jax-ml/jax#20144.

Accuracy tests are enabled in jax-ml/jax#20436
Copybara import of the project:

--
2b8f253 by Pearu Peterson <pearu.peterson@gmail.com>:

Fix log1p inaccuracies on complex inputs with large absolute values.

--
d35cef4 by Pearu Peterson <pearu.peterson@gmail.com>:

Add tests to complex Log1p

Merging this change closes #10503

FUTURE_COPYBARA_INTEGRATE_REVIEW=#10503 from pearu:pearu/log1p d35cef4
PiperOrigin-RevId: 620293408
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Apr 4, 2024
…te values.

Imported from GitHub PR openxla/xla#10503

As in the title.

Tests and improvement reports are in jax-ml/jax#20144.

Accuracy tests are enabled in jax-ml/jax#20436
Copybara import of the project:

--
2b8f2539d6bf364c0a97f65e186430c5eb3ed07b by Pearu Peterson <pearu.peterson@gmail.com>:

Fix log1p inaccuracies on complex inputs with large absolute values.

--
d35cef4f5fa09482c49edfee709e86c5ca29adde by Pearu Peterson <pearu.peterson@gmail.com>:

Add tests to complex Log1p

Merging this change closes #10503

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#10503 from pearu:pearu/log1p d35cef4f5fa09482c49edfee709e86c5ca29adde
PiperOrigin-RevId: 620293408
copybara-service bot pushed a commit to openxla/xla that referenced this pull request Apr 4, 2024
…te values.

Imported from GitHub PR #10503

As in the title.

Tests and improvement reports are in jax-ml/jax#20144.

Accuracy tests are enabled in jax-ml/jax#20436
Copybara import of the project:

--
2b8f253 by Pearu Peterson <pearu.peterson@gmail.com>:

Fix log1p inaccuracies on complex inputs with large absolute values.

--
d35cef4 by Pearu Peterson <pearu.peterson@gmail.com>:

Add tests to complex Log1p

Merging this change closes #10503

FUTURE_COPYBARA_INTEGRATE_REVIEW=#10503 from pearu:pearu/log1p d35cef4
PiperOrigin-RevId: 620293408
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Apr 4, 2024
…te values.

Imported from GitHub PR openxla/xla#10503

As in the title.

Tests and improvement reports are in jax-ml/jax#20144.

Accuracy tests are enabled in jax-ml/jax#20436
Copybara import of the project:

--
2b8f2539d6bf364c0a97f65e186430c5eb3ed07b by Pearu Peterson <pearu.peterson@gmail.com>:

Fix log1p inaccuracies on complex inputs with large absolute values.

--
d35cef4f5fa09482c49edfee709e86c5ca29adde by Pearu Peterson <pearu.peterson@gmail.com>:

Add tests to complex Log1p

Merging this change closes #10503

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#10503 from pearu:pearu/log1p d35cef4f5fa09482c49edfee709e86c5ca29adde
PiperOrigin-RevId: 620293408
copybara-service bot pushed a commit to openxla/xla that referenced this pull request Apr 4, 2024
…te values.

Imported from GitHub PR #10503

As in the title.

Tests and improvement reports are in jax-ml/jax#20144.

Accuracy tests are enabled in jax-ml/jax#20436
Copybara import of the project:

--
2b8f253 by Pearu Peterson <pearu.peterson@gmail.com>:

Fix log1p inaccuracies on complex inputs with large absolute values.

--
d35cef4 by Pearu Peterson <pearu.peterson@gmail.com>:

Add tests to complex Log1p

Merging this change closes #10503

FUTURE_COPYBARA_INTEGRATE_REVIEW=#10503 from pearu:pearu/log1p d35cef4
PiperOrigin-RevId: 621891416
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Apr 4, 2024
…te values.

Imported from GitHub PR openxla/xla#10503

As in the title.

Tests and improvement reports are in jax-ml/jax#20144.

Accuracy tests are enabled in jax-ml/jax#20436
Copybara import of the project:

--
2b8f2539d6bf364c0a97f65e186430c5eb3ed07b by Pearu Peterson <pearu.peterson@gmail.com>:

Fix log1p inaccuracies on complex inputs with large absolute values.

--
d35cef4f5fa09482c49edfee709e86c5ca29adde by Pearu Peterson <pearu.peterson@gmail.com>:

Add tests to complex Log1p

Merging this change closes #10503

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#10503 from pearu:pearu/log1p d35cef4f5fa09482c49edfee709e86c5ca29adde
PiperOrigin-RevId: 621891416
copybara-service bot pushed a commit to openxla/xla that referenced this pull request Apr 4, 2024
…te values.

Imported from GitHub PR #10503

As in the title.

Tests and improvement reports are in jax-ml/jax#20144.

Accuracy tests are enabled in jax-ml/jax#20436
Copybara import of the project:

--
2b8f253 by Pearu Peterson <pearu.peterson@gmail.com>:

Fix log1p inaccuracies on complex inputs with large absolute values.

--
d35cef4 by Pearu Peterson <pearu.peterson@gmail.com>:

Add tests to complex Log1p

Merging this change closes #10503

FUTURE_COPYBARA_INTEGRATE_REVIEW=#10503 from pearu:pearu/log1p d35cef4
PiperOrigin-RevId: 620293408
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Apr 4, 2024
…te values.

Imported from GitHub PR openxla/xla#10503

As in the title.

Tests and improvement reports are in jax-ml/jax#20144.

Accuracy tests are enabled in jax-ml/jax#20436
Copybara import of the project:

--
2b8f2539d6bf364c0a97f65e186430c5eb3ed07b by Pearu Peterson <pearu.peterson@gmail.com>:

Fix log1p inaccuracies on complex inputs with large absolute values.

--
d35cef4f5fa09482c49edfee709e86c5ca29adde by Pearu Peterson <pearu.peterson@gmail.com>:

Add tests to complex Log1p

Merging this change closes #10503

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#10503 from pearu:pearu/log1p d35cef4f5fa09482c49edfee709e86c5ca29adde
PiperOrigin-RevId: 620293408
copybara-service bot pushed a commit to openxla/xla that referenced this pull request Apr 4, 2024
…te values.

Imported from GitHub PR #10503

As in the title.

Tests and improvement reports are in jax-ml/jax#20144.

Accuracy tests are enabled in jax-ml/jax#20436
Copybara import of the project:

--
2b8f253 by Pearu Peterson <pearu.peterson@gmail.com>:

Fix log1p inaccuracies on complex inputs with large absolute values.

--
d35cef4 by Pearu Peterson <pearu.peterson@gmail.com>:

Add tests to complex Log1p

Merging this change closes #10503

COPYBARA_INTEGRATE_REVIEW=#10503 from pearu:pearu/log1p d35cef4
PiperOrigin-RevId: 621917683
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Apr 4, 2024
…te values.

Imported from GitHub PR openxla/xla#10503

As in the title.

Tests and improvement reports are in jax-ml/jax#20144.

Accuracy tests are enabled in jax-ml/jax#20436
Copybara import of the project:

--
2b8f2539d6bf364c0a97f65e186430c5eb3ed07b by Pearu Peterson <pearu.peterson@gmail.com>:

Fix log1p inaccuracies on complex inputs with large absolute values.

--
d35cef4f5fa09482c49edfee709e86c5ca29adde by Pearu Peterson <pearu.peterson@gmail.com>:

Add tests to complex Log1p

Merging this change closes #10503

PiperOrigin-RevId: 621917683
steeve pushed a commit to zml/xla that referenced this pull request Aug 30, 2024
… absolute values. Add Cosm1.

Imported from GitHub PR openxla#10376

As in the title.

Tests and improvement reports are in jax-ml/jax#20144.

Accuracy tests are enabled in jax-ml/jax#20436
Copybara import of the project:

--
42e222a by Pearu Peterson <pearu.peterson@gmail.com>:

Fix expm1 inaccuracies on complex inputs with small absolute values. Add Cosm1.
Fix expm1(x+yi) when x is large and y is zero.

Merging this change closes openxla#10376

COPYBARA_INTEGRATE_REVIEW=openxla#10376 from pearu:pearu/expm1 42e222a
PiperOrigin-RevId: 619324160
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pull ready Ready for copybara import and testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants