Enzyme.jl icon indicating copy to clipboard operation
Enzyme.jl copied to clipboard

Missing support for erf (and related I guess) again

Open rcalxrc08 opened this issue 1 month ago • 3 comments

same as #364 MWE:

using Enzyme, Test, SpecialFunctions

f1(x) = erf(x)*x
@show first(autodiff(Reverse, f1, Active(1.0))[1])

and I get:

ERROR: Enzyme execution failed.
Enzyme compilation failed.
Current scope:
; Function Attrs: mustprogress willreturn
define "enzyme_type"="{[-1]:Float@double}" double @preprocess_julia_f1_1412(double "enzyme_type"="{[-1]:Float@double}" "enzymejl_parmtype"="140718177488032" "enzymejl_parmtype_ref"="0" %0) local_unnamed_addr #3 !dbg !23 {
top:
  %1 = call {}*** @julia.get_pgcstack() #4
  %ptls_field3 = getelementptr inbounds {}**, {}*** %1, i64 2
  %2 = bitcast {}*** %ptls_field3 to i64***
  %ptls_load45 = load i64**, i64*** %2, align 8, !tbaa !8
  %3 = getelementptr inbounds i64*, i64** %ptls_load45, i64 2
  %safepoint = load i64*, i64** %3, align 8, !tbaa !12
  fence syncscope("singlethread") seq_cst
  call void @julia.safepoint(i64* %safepoint) #4, !dbg !24
  fence syncscope("singlethread") seq_cst
  %4 = call double @.text(double %0) #4, !dbg !25
  %5 = fmul double %4, %0, !dbg !27
  ret double %5, !dbg !27
}

No augmented forward pass found for .text
 at context:   %4 = call double @.text(double %0) #4, !dbg !15

Stacktrace:
 [1] _erf
   @ C:\Users\Nicola\.julia\packages\SpecialFunctions\npKKV\src\erf.jl:15
 [2] erf
   @ C:\Users\Nicola\.julia\packages\SpecialFunctions\npKKV\src\erf.jl:13
 [3] f1
   @ .\REPL[2]:1


Stacktrace:
 [1] throwerr(cstr::Cstring)
   @ Enzyme.Compiler C:\Users\Nicola\.julia\packages\Enzyme\F71IJ\src\compiler.jl:1338

rcalxrc08 avatar Jun 01 '24 11:06 rcalxrc08