You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whatever Enzyme is doing to detect if there are duplicated returns appears to be confused by type instabilities. Not sure if this is intentional or not, but here is a MWE:
using Enzyme
f_unstable = asin
f_stable(x) =asin(x)
functionfoo_unstable(x)
y =sin(x)
z =f_unstable(y) # untyped global variablecos(z)
end;
functionfoo_stable(x)
y =sin(x)
z =f_stable(y) # global constcos(z)
end;
Note that Enzyme can differentiate this function even with the instability:
julia>let x =1.0, ydy =Duplicated(Ref(0.0), Ref(0.0))
autodiff(Reverse, ydy, Active(x)) do y, x
y[] =foo_unstable(x[])
y[]
endend
((nothing, -0.8414709848078965),)
system info:
(jl_GwHTSw) pkg> st
Status `/tmp/jl_GwHTSw/Project.toml`
[7da242da] Enzyme v0.13.22
julia>versioninfo()
Julia Version 1.11.2
Commit 5e9a32e7af2 (2024-12-0120:02 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU:16× AMD Ryzen 77840U w/ Radeon 780M Graphics
WORD_SIZE:64
LLVM: libLLVM-16.0.6 (ORCJIT, znver4)
Threads:8 default, 0 interactive, 4 GC (on 16 virtual cores)
Environment:
JULIA_NUM_THREADS =8
JULIA_EDITOR = emacsclient
The text was updated successfully, but these errors were encountered:
Maybe we should at least give a hint in the error message as to what's going on here. E.g. something like
The function being differentiated has an inferred return type of Any, but autodiff(Reverse currently only handles functions which return isbits subtypes of Real.
Whatever Enzyme is doing to detect if there are duplicated returns appears to be confused by type instabilities. Not sure if this is intentional or not, but here is a MWE:
Note that Enzyme can differentiate this function even with the instability:
system info:
The text was updated successfully, but these errors were encountered: