EnzymeAD / EnzymeAD/Enzyme.jl

error with ReverseSplitWithPrimal and Flux.RNN

Open
#2,897 5 comments 0 reactions 0 assignees View on GitHub
more information needed
Dominant language
Julia
Stars
586
Forks
108
Avg merge
1d 5h
Merged PRs (30d)
44

Description

on julia 1.10:
```julia
using Flux, Enzyme, Statistics

loss(m, x...) = mean(m(x...))

m = RNN(3 => 2, tanh)
dm = Duplicated(m, Enzyme.make_zero(m))
x = randn(Float32, 3, 2, 2)

autodiff(Reverse, Const(loss), Active, dm, Const(x)) # OK
autodiff(ReverseWithPrimal, Const(loss), Active, dm, Const(x)) # OK

# ERROR
forward, reverse = autodiff_thunk(ReverseSplitWithPrimal, Const{typeof(loss)}, Active, typeof(dm), typeof(Const(x)))
```
produces a very long error with first lines
```
ERROR: AssertionError: ; Function Attrs: alwaysinline mustprogress
define internal "enzymejl_parmtype"="4844532784" "enzymejl_parmtype_ref"="0" void @diffejulia_loss_84364_inner.1([1 x { {}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.