-
Notifications
You must be signed in to change notification settings - Fork 68
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
Missing support for erf (and related I guess) #364
Comments
What system are you on and what is the error message specifically |
Julia Version 1.7.2 |
ERROR: Enzyme compilation failed.
Current scope:
; ModuleID = 'text'
source_filename = "text"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128-ni:10:11:12:13"
target triple = "x86_64-w64-mingw32"
; Function Attrs: readnone
declare {}*** @julia.get_pgcstack() local_unnamed_addr #0
declare double @.text(double) local_unnamed_addr
define double @julia_erf_2035_inner.1(double %0) local_unnamed_addr !dbg !5 {
entry:
%1 = call {}*** @julia.get_pgcstack()
%2 = call double @.text(double %0), !dbg !7
ret double %2, !dbg !11
}
; Function Attrs: willreturn mustprogress
define double @preprocess_julia_erf_2035_inner.1(double %0) local_unnamed_addr #1 !dbg !12 {
entry:
%1 = call {}*** @julia.get_pgcstack() #1
%2 = call double @.text(double %0) #1, !dbg !13
ret double %2, !dbg !16
}
; Function Attrs: willreturn mustprogress
define internal { double } @diffejulia_erf_2035_inner.1(double %0, double %differeturn) local_unnamed_addr #1 !dbg !17 {
entry:
%1 = call {}*** @julia.get_pgcstack() #1
%2 = call double @.text(double %0) #1, !dbg !18
br label %invertentry, !dbg !21
allocsForInversion: ; No predecessors!
%"'de" = alloca double, align 8
store double 0.000000e+00, double* %"'de", align 8
invertentry: ; preds = %entry
store double %differeturn, double* %"'de", align 8
}
attributes #0 = { readnone "enzyme_inactive" }
attributes #1 = { willreturn mustprogress }
!llvm.module.flags = !{!0, !1}
!llvm.dbg.cu = !{!2}
!0 = !{i32 2, !"Dwarf Version", i32 4}
!1 = !{i32 2, !"Debug Info Version", i32 3}
!2 = distinct !DICompileUnit(language: DW_LANG_Julia, file: !3, producer: "julia", isOptimized: true, runtimeVersion: 0, emissionKind: LineTablesOnly, enums: !4, nameTableKind: None)
!3 = !DIFile(filename: "C:\\Users\\Nicola\\.julia\\packages\\SpecialFunctions\\oPGFg\\src\\erf.jl", directory: ".")
!4 = !{}
!5 = distinct !DISubprogram(name: "erf", linkageName: "julia_erf_2035", scope: null, file: !3, line: 13, type: !6, scopeLine: 13, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !4)
!6 = !DISubroutineType(types: !4)
!7 = !DILocation(line: 15, scope: !8, inlinedAt: !9)
!8 = distinct !DISubprogram(name: "_erf;", linkageName: "_erf", scope: !3, file: !3, type: !6, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !4)
!9 = distinct !DILocation(line: 13, scope: !5, inlinedAt: !10)
!10 = distinct !DILocation(line: 0, scope: !5)
!11 = !DILocation(line: 0, scope: !5)
!12 = distinct !DISubprogram(name: "erf", linkageName: "julia_erf_2035", scope: null, file: !3, line: 13, type: !6, scopeLine: 13, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !4)
!13 = !DILocation(line: 15, scope: !8, inlinedAt: !14)
!14 = distinct !DILocation(line: 13, scope: !12, inlinedAt: !15)
!15 = distinct !DILocation(line: 0, scope: !12)
!16 = !DILocation(line: 0, scope: !12)
!17 = distinct !DISubprogram(name: "erf", linkageName: "julia_erf_2035", scope: null, file: !3, line: 13, type: !6, scopeLine: 13, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !4)
!18 = !DILocation(line: 15, scope: !8, inlinedAt: !19)
!19 = distinct !DILocation(line: 13, scope: !17, inlinedAt: !20)
!20 = distinct !DILocation(line: 0, scope: !17)
!21 = !DILocation(line: 0, scope: !17)
No reverse pass found for .text
declare double @.text(double) local_unnamed_addr
Stacktrace:
[1] julia_error(cstr::Cstring, val::Ptr{LLVM.API.LLVMOpaqueValue}, errtype::Enzyme.API.ErrorType, data::Ptr{Nothing})
@ Enzyme.Compiler C:\Users\Nicola\.julia\packages\Enzyme\Wanbg\src\compiler.jl:2636
[2] EnzymeCreatePrimalAndGradient(logic::Enzyme.Logic, todiff::LLVM.Function, retType::Enzyme.API.CDIFFE_TYPE, constant_args::Vector{Enzyme.API.CDIFFE_TYPE}, TA::Enzyme.TypeAnalysis, returnValue::Bool, dretUsed::Bool, mode::Enzyme.API.CDerivativeMode, width::Int64, additionalArg::Ptr{Nothing}, typeInfo::Enzyme.FnTypeInfo, uncacheable_args::Vector{Bool}, augmented::Ptr{Nothing}, atomicAdd::Bool)
@ Enzyme.API C:\Users\Nicola\.julia\packages\Enzyme\Wanbg\src\api.jl:111
[3] enzyme!(job::GPUCompiler.CompilerJob{Enzyme.Compiler.EnzymeTarget, Enzyme.Compiler.EnzymeCompilerParams, GPUCompiler.FunctionSpec{typeof(erf), Tuple{Float64}}}, mod::LLVM.Module, primalf::LLVM.Function, adjoint::GPUCompiler.FunctionSpec{typeof(erf), Tuple{Active{Float64}}}, mode::Enzyme.API.CDerivativeMode, width::Int64, parallel::Bool, actualRetType::Type, dupClosure::Bool, wrap::Bool, modifiedBetween::Bool, returnPrimal::Bool)
@ Enzyme.Compiler C:\Users\Nicola\.julia\packages\Enzyme\Wanbg\src\compiler.jl:3271
[4] codegen(output::Symbol, job::GPUCompiler.CompilerJob{Enzyme.Compiler.EnzymeTarget, Enzyme.Compiler.EnzymeCompilerParams, GPUCompiler.FunctionSpec{typeof(erf), Tuple{Float64}}}; libraries::Bool, deferred_codegen::Bool, optimize::Bool, ctx::LLVM.Context, strip::Bool, validate::Bool, only_entry::Bool, parent_job::Nothing)
@ Enzyme.Compiler C:\Users\Nicola\.julia\packages\Enzyme\Wanbg\src\compiler.jl:4156
[5] _thunk(job::GPUCompiler.CompilerJob{Enzyme.Compiler.EnzymeTarget, Enzyme.Compiler.EnzymeCompilerParams, GPUCompiler.FunctionSpec{typeof(erf), Tuple{Float64}}})
@ Enzyme.Compiler C:\Users\Nicola\.julia\packages\Enzyme\Wanbg\src\compiler.jl:4562
[6] cached_compilation(job::GPUCompiler.CompilerJob, key::UInt64, specid::UInt64)
@ Enzyme.Compiler C:\Users\Nicola\.julia\packages\Enzyme\Wanbg\src\compiler.jl:4600
[7] #s565#115
@ C:\Users\Nicola\.julia\packages\Enzyme\Wanbg\src\compiler.jl:4660 [inlined]
[8] var"#s565#115"(F::Any, Fn::Any, DF::Any, A::Any, TT::Any, Mode::Any, ModifiedBetween::Any, width::Any, specid::Any, ReturnPrimal::Any, ::Any, #unused#::Type, f::Any, df::Any, #unused#::Type, tt::Any, #unused#::Type, #unused#::Type, #unused#::Type, #unused#::Type, #unused#::Any)
@ Enzyme.Compiler .\none:0
[9] (::Core.GeneratedFunctionStub)(::Any, ::Vararg{Any})
@ Core .\boot.jl:580
[10] thunk
@ C:\Users\Nicola\.julia\packages\Enzyme\Wanbg\src\compiler.jl:4688 [inlined]
[11] thunk (repeats 2 times)
@ C:\Users\Nicola\.julia\packages\Enzyme\Wanbg\src\compiler.jl:4681 [inlined]
[12] autodiff
@ C:\Users\Nicola\.julia\packages\Enzyme\Wanbg\src\Enzyme.jl:285 [inlined]
[13] autodiff(mode::Enzyme.ReverseMode, f::typeof(erf), args::Active{Float64})
@ Enzyme C:\Users\Nicola\.julia\packages\Enzyme\Wanbg\src\Enzyme.jl:319
[14] top-level scope
@ REPL[3]:1 |
We include erf now explicitly in our test set, which appears to pass on all systems. Please reopen if this persists. |
I am still getting an error, very similar to before: ; Function Attrs: nofree readnone declare double @.text(double) local_unnamed_addr define double @julia_erf_1063_inner.1(double %0) local_unnamed_addr #1 !dbg !4 { ; Function Attrs: mustprogress willreturn ; Function Attrs: mustprogress willreturn allocsForInversion: ; No predecessors! invertentry: ; preds = %entry attributes #0 = { nofree readnone "enzyme_inactive" "enzyme_shouldrecompute" "enzymejl_world"="33515" } !llvm.module.flags = !{!0, !1} !0 = !{i32 2, !"Dwarf Version", i32 4} No reverse pass found for .text Stacktrace: |
MWE:
The text was updated successfully, but these errors were encountered: