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

Enzyme autodiff breaking on tanh function #37

Closed
sandreza opened this issue Jan 23, 2021 · 1 comment · Fixed by #38
Closed

Enzyme autodiff breaking on tanh function #37

sandreza opened this issue Jan 23, 2021 · 1 comment · Fixed by #38

Comments

@sandreza
Copy link

The following example crashes Julia on my system

using Enzyme
autodiff(tanh, Active(1.0))

version info of my system:
Julia Version 1.5.2
Commit 539f3ce943 (2020-09-23 23:17 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin18.7.0)
CPU: Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, skylake)

@wsmoses
Copy link
Member

wsmoses commented Jan 23, 2021

There's two solutions to this -- one more of a long term fix, and one to immediately resolve this. We should just mark tanh to be lowered to the standard math tanh which is perfectly fine (and we'll add this immediately).

As a broader question, the way this is currently running it's trying to differentiate Julia's custom definition of the tanh function, which calls a function without definition jl_f_tuple, which we should add a custom adjoint for from the Julia lowering side. Related to this, it appears the function requires function pointers that have already been lowered to integers known to the runtime -- which we should enable JIT re-entrance to retrieve. @vchuravy

@wsmoses wsmoses mentioned this issue Jan 23, 2021
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 a pull request may close this issue.

2 participants