EnzymeAD / EnzymeAD/Enzyme.jl

Setjmp handling

Open
#84 5 comments 1 reaction 1 assignee Claimed by @wsmoses View on GitHub
upstream
Dominant language
Julia
Stars
586
Forks
108
Avg merge
1d 5h
Merged PRs (30d)
44

Description

@aviatesk asked me what happens when Enzyme tries to differentiate through exceptional control flow

Version: Enzyme v0.6.2.

```
using Enzyme

function f(cond, x)
try
x = x*x
if cond
error("Why")
end
x = x*x
catch
end
x
end
f (generic function with 1 method)

julia> autodiff(f, Const(false), Active(2.0))
inlinable function call in a function with debug info must have a !dbg location
%2 = call fastcc double @julia_f_1802.inner(i8 %0, double %1)
define double @preprocess_julia_f_1802(i8 zeroext %0, double %1) local_unnamed_addr !dbg !56 {
entry:
%2 = call fastcc double @julia_f_1802.inner(i8 %0, double %1)
ret double %2
}

ERROR: LLVM error: function failed verification (1)
```

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.