Not yet implemented: dgebal_64_ (Lapack)
- Dominant language
- Julia
- Stars
- 586
- Forks
- 108
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 44
Description
Trying to differentiate through a matrix exponential took a very very very long time, and then finally errored.
MWE:
```julia
julia> let M = rand(2, 2)
∂M = similar(M)
autodiff(Reverse, x -> sum(exp(x)), Duplicated(M, ∂M))
end
┌ Warning: Using fallback BLAS replacements, performance may be degraded
└ @ Enzyme.Compiler ~/.julia/packages/GPUCompiler/2mJjc/src/utils.jl:59
warning: didn't implement memmove, using memcpy as fallback which can result in errors
warning: didn't implement memmove, using memcpy as fallback which can result in errors
ERROR: Enzyme execution failed.
Enzyme compilation failed.
Current scope:
; Function Attrs: mustprogress willreturn
define internal fastcc void @preprocess_julia_gebal__2428({ i64, i64, {} addrspace(10)* }* noalias nocapture noundef nonnull writeonly sret({ i64, i64, {} addrspace(10)* }) align 8 dereferenceable(24) %0, [1 x {} addrspace(10)*]* noalias nocapture noundef nonnull writeonly align 8 dereferenceable(8) "enzyme_inactive" "enzymejl_returnRoots" %1, {} addrspace(10)* noundef nonnull align 16 dereferenceable(40) %2) unnamed_addr #117 !dbg !14207 {
top:
%3 = call noalias nonnull dereferenceable(8) dereferenceable_or_null(8) i8* @malloc(i64 8), !enzyme_fromstack !223
%4 = bitcast i8* %3 to i64*, !enzyme_caststack !114
%5 = bitcast i64* %4 to i8*
%6 = call noalias nonnull dereferenceable(8) dereferenceable_or_null(8) i8* @malloc(i64 8), !enzyme_fromstack !223
%7 = bitcast i8* %6 to i64*, !enzyme_caststack !114
%8 = bitcast i64* %7 to i8*
%9 = call noalias nonnull dereferenceable(8) dereferenceable_or_null(8) i8* @malloc(i64 8), !enzyme_fromstack !223
%10 = bitcast i8* %9 to i64*, !enzyme_caststack !114
%11 = bitcast i64* %10 to i8*
%12 = call noalias nonnull dereferenceable(1) dereferenceable_or_null(1) i8* @malloc(i64 1), !enzyme_fromstack !10523
%13 = call noalias nonnull dereferenceable(8) dereferenceable_or_null(8) i8* @malloc(i64 8), !enzyme_fromstack !223
%14 = bitcast i8* %13 to i64*, !enzyme_caststack !114
%15 = bitcast i64* %14 to i8*
%16 = call noalias nonnull dereferenceable(8) dereferenceable_or_null(8) i8* @malloc(i64 8), !enzyme_fromstack !223
%17 = bitcast i8* %16 to i64*, !enzyme_caststack !114
%18 = bitcast i64* %17 to i8*
%19 = call noalias nonnull dereferenceable(16) dereferenceable_or_null(16) i8* @malloc(i64 16), !enzyme_fromstack !6333
%newstruct74 = bitcast i8* %19 to [2 x i64]*, !enzyme_caststack !114
%20 = call {}*** @julia.get_pgcstack() #118
%ptls_field80 = getelementptr inbounds {}**, {}*** %20, i64 2
%21 = bitcast {}*** %ptls_field80 to i64***
%ptls_load8182 = load i64**, i64*** %21, align 8, !tbaa !115
%22 = getelementptr inbounds i64*, i64** %ptls_load8182, i64 2
%safepoint = load i64*, i64** %22, align 8, !tbaa !119, !invariant.load !114
fence syncscope("singlethread") seq_cst
call void @julia.safepoint(i64* %safepoint) #118, !dbg !14208
fence syncscope("singlethread") seq_cst
%23 = addrspacecast {} addrspace(10)* %2 to {} addrspace(10)* addrspace(11)*, !dbg !14209
%arraysize_ptr = getelementptr inbounds {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %23, i64 3, !dbg !14209
%24 = bitcast {} addrspace(10)* addrspace(11)* %arraysize_ptr to i64 addrspace(11)*, !dbg !14209
%arraysize = load i64, i64 addrspace(11)* %24, align 8, !dbg !14209, !tbaa !119, !range !126, !invariant.load !114, !alias.scope !127, !noalias !130
%arraysize_ptr2 = getelementptr inbounds {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %23, i64 4, !dbg !14209
%25 = bitcast {} addrspace(10)* addrspace(11)* %arraysize_ptr2 to i64 addrspace(11)*, !dbg !14209
%arraysize3 = load i64, i64 addrspace(11)* %25, align 16, !dbg !14209, !tbaa !119, !range !126, !invariant.load !114, !alias.scope !127, !noalias !130
%.not = icmp eq i64 %arraysize, %arraysize3, !dbg !14212
br i1 %.not, label %L13, label %L6, !dbg !14213
L6: ; preds = %top
%26 = getelementptr inbounds [2 x i64], [2 x i64]* %newstruct74, i64 0, i64 0, !dbg !14214
store i64 %arraysize, i64* %26, align 8, !dbg !14214, !tbaa !200, !alias.scope !202, !noalias !14215
%27 = getelementptr inbounds [2 x i64], [2 x i64]* %newstruct74, i64 0, i64 1, !dbg !14214
store i64 %arraysize3, i64* %27, align 8, !dbg !14214, !tbaa !200, !alias.scope !202, !noalias !14215
%28 = addrspacecast [2 x i64]* %newstruct74 to [2 x i64] addrspace(11)*, !dbg !14213
%29 = call fastcc nonnull {} addrspace(10)* @julia_string_2337({} addrspace(10)* nofree noundef nonnull align 32 addrspacecast ({}* inttoptr (i64 140057409912800 to {}*) to {} addrspace(10)*), [2 x i64] addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(16) %28) #118, !dbg !14213
%current_task75102 = getelementptr inbounds {}**, {}*** %20, i64 -14, !dbg !14213
%current_task75 = bitcast {}*** %current_task75102 to {}**, !dbg !14213
%box76 = call noalias nonnull dereferenceable(8) "enzyme_inactive" {} addrspace(10)* @julia.gc_alloc_obj({}** nonnull %current_task75, i64 noundef 8, {} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 140057349415104 to {}*) to {} addrspace(10)*)) #119, !dbg !14213
%30 = bitcast {} addrspace(10)* %box76 to [1 x {} addrspace(10)*] addrspace(10)*, !dbg !14213
%31 = getelementptr [1 x {} addrspace(10)*], [1 x {} addrspace(10)*] addrspace(10)* %30, i64 0, i64 0, !dbg !14213
store {} addrspace(10)* %29, {} addrspace(10)* addrspace(10)* %31, align 8, !dbg !14213, !tbaa !206, !alias.scope !210, !noalias !14218
%32 = addrspacecast {} addrspace(10)* %box76 to {} addrspace(12)*, !dbg !14213
call void @ijl_throw({} addrspace(12)* %32) #120, !dbg !14213
unreachable, !dbg !14213
L13: ; preds = %top
%33 = addrspacecast {} addrspace(10)* %2 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)*, !dbg !14219
%arraylen_ptr = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %33, i64 0, i32 1, !dbg !14219
%arraylen = load i64, i64 addrspace(11)* %arraylen_ptr, align 8, !dbg !14219, !tbaa !119, !range !126, !invariant.load !114, !alias.scope !127, !noalias !130
%.not83 = icmp eq i64 %arraylen, 0, !dbg !14224
br i1 %.not83, label %L60, label %L29, !dbg !14220
L29: ; preds = %L13
%34 = addrspacecast {} addrspace(10)* %2 to double addrspace(13)* addrspace(11)*, !dbg !14226
%arrayptr84 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %34, align 16, !dbg !14226, !tbaa !119, !invariant.load !114, !alias.scope !14227, !noalias !130, !nonnull !114
%value_phi6114 = load double, double addrspace(13)* %arrayptr84, align 8, !dbg !14228, !tbaa !332, !alias.scope !210, !noalias !334
%35 = fsub double %value_phi6114, %value_phi6114, !dbg !14229
%36 = fcmp ord double %35, 0.000000e+00, !dbg !14232
br i1 %36, label %L41.lr.ph, label %L38, !dbg !14231
L41.lr.ph: ; preds = %L29
%37 = add nuw nsw i64 %arraylen, 1, !dbg !14231
br label %L41, !dbg !14231
L38.loopexit: ; preds = %L53
br label %L38, !dbg !14234
L38: ; preds = %L38.loopexit, %L29
%38 = call fastcc [1 x {} addrspace(10)*] @julia_ArgumentError_2241({} addrspace(10)* nofree noundef nonnull align 16 addrspacecast ({}* inttoptr (i64 140057409874544 to {}*) to {} addrspace(10)*)) #118, !dbg !14234
%current_task885 = getelementptr inbounds {}**, {}*** %20, i64 -14, !dbg !14234
%current_task8 = bitcast {}*** %current_task885 to {}**, !dbg !14234
%box = call noalias nonnull dereferenceable(8) "enzyme_inactive" {} addrspace(10)* @julia.gc_alloc_obj({}** nonnull %current_task8, i64 8, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140057370703792 to {}*) to {} addrspace(10)*)) #119, !dbg !14234
%39 = bitcast {} addrspace(10)* %box to [1 x {} addrspace(10)*] addrspace(10)*, !dbg !14234
%40 = extractvalue [1 x {} addrspace(10)*] %38, 0, !dbg !14234
%41 = getelementptr [1 x {} addrspace(10)*], [1 x {} addrspace(10)*] addrspace(10)* %39, i64 0, i64 0, !dbg !14234
store {} addrspace(10)* %40, {} addrspace(10)* addrspace(10)* %41, align 8, !dbg !14234, !tbaa !206, !alias.scope !210, !noalias !14218
%42 = addrspacecast {} addrspace(10)* %box to {} addrspace(12)*, !dbg !14234
call void @ijl_throw({} addrspace(12)* %42) #118, !dbg !14234
unreachable, !dbg !14234
L41: ; preds = %L53, %L41.lr.ph
%iv = phi i64 [ %iv.next, %L53 ], [ 0, %L41.lr.ph ]
%43 = add i64 %iv, 2, !dbg !14235
%iv.next = add nuw nsw i64 %iv, 1, !dbg !14235
%exitcond.not = icmp eq i64 %43, %37, !dbg !14235
br i1 %exitcond.not, label %L60.loopexit, label %L53, !dbg !14237
L53: ; preds = %L41
%44 = add nsw i64 %43, -1, !dbg !14239
%45 = getelementptr inbounds double, double addrspace(13)* %arrayptr84, i64 %44, !dbg !14241
%46 = add nuw i64 %43, 1, !dbg !14242
%value_phi6 = load double, double addrspace(13)* %45, align 8, !dbg !14228, !tbaa !332, !alias.scope !210, !noalias !334
%47 = fsub double %value_phi6, %value_phi6, !dbg !14229
%48 = fcmp ord double %47, 0.000000e+00, !dbg !14232
br i1 %48, label %L41, label %L38.loopexit, !dbg !14231
L60.loopexit: ; preds = %L41
br label %L60, !dbg !14243
L60: ; preds = %L60.loopexit, %L13
%current_task1788 = getelementptr inbounds {}**, {}*** %20, i64 -14, !dbg !14243
%current_task17 = bitcast {}*** %current_task1788 to {}**, !dbg !14243
call void @llvm.lifetime.start.p0i8(i64 noundef 8, i8* noundef nonnull %5) #118
call void @llvm.lifetime.start.p0i8(i64 noundef 8, i8* noundef nonnull %8) #118
%49 = call noalias nonnull {} addrspace(10)* @ijl_alloc_array_1d({} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 140057345879072 to {}*) to {} addrspace(10)*), i64 %arraysize) #121, !dbg !14246
call void @llvm.lifetime.start.p0i8(i64 noundef 8, i8* noundef nonnull %11) #118
call void @llvm.lifetime.start.p0i8(i64 noundef 1, i8* noundef nonnull %12) #118
store i8 66, i8* %12, align 1, !dbg !14251, !tbaa !3725, !alias.scope !210, !noalias !14218
call void @llvm.lifetime.start.p0i8(i64 noundef 8, i8* noundef nonnull %15) #118
store i64 %arraysize, i64* %14, align 16, !dbg !14251, !tbaa !3725, !alias.scope !210, !noalias !14218
%.not93 = icmp eq i64 %arraysize, 0, !dbg !14255
%50 = select i1 %.not93, i64 1, i64 %arraysize, !dbg !14257
call void @llvm.lifetime.start.p0i8(i64 noundef 8, i8* noundef nonnull %18) #118
store i64 %50, i64* %17, align 16, !dbg !14251, !tbaa !3725, !alias.scope !210, !noalias !14218
%51 = addrspacecast {} addrspace(10)* %2 to {} addrspace(11)*, !dbg !14258
%52 = call nonnull {}* @julia.pointer_from_objref({} addrspace(11)* %51) #122, !dbg !14258
%53 = bitcast {}* %52 to i8**, !dbg !14258
%arrayptr39 = load i8*, i8** %53, align 8, !dbg !14258, !tbaa !119, !invariant.load !114, !alias.scope !127, !noalias !130, !nonnull !114
%54 = ptrtoint i8* %arrayptr39 to i64, !dbg !14258
%bitcast_coercion47 = ptrtoint i64* %7 to i64, !dbg !14259
%bitcast_coercion51 = ptrtoint i64* %4 to i64, !dbg !14259
%55 = addrspacecast {} addrspace(10)* %49 to {} addrspace(11)*, !dbg !14258
%56 = call nonnull {}* @julia.pointer_from_objref({} addrspace(11)* %55) #122, !dbg !14258
%57 = bitcast {}* %56 to i8**, !dbg !14258
%arrayptr53 = load i8*, i8** %57, align 8, !dbg !14258, !tbaa !286, !alias.scope !238, !noalias !239, !nonnull !114
%58 = ptrtoint i8* %arrayptr53 to i64, !dbg !14258
%bitcast_coercion57 = ptrtoint i64* %10 to i64, !dbg !14259
call void @dgebal_64_(i8* noundef nonnull %12, i8* noundef nonnull %15, i64 %54, i8* noundef nonnull %18, i64 noundef %bitcast_coercion47, i64 noundef %bitcast_coercion51, i64 %58, i64 noundef %bitcast_coercion57, i64 noundef 1) #118 [ "jl_roots"({} addrspace(10)* null, {} addrspace(10)* %49, {} addrspace(10)* null, {} addrspace(10)* null, {} addrspace(10)* null, {} addrspace(10)* %2, {} addrspace(10)* null, {} addrspace(10)* null) ], !dbg !14254
%59 = load i64, i64* %10, align 16, !dbg !14261, !tbaa !3725, !alias.scope !210, !noalias !334
%.not95 = icmp eq i64 %59, 0, !dbg !14264
br i1 %.not95, label %L176, label %L166, !dbg !14265
L166: ; preds = %L60
%60 = icmp sgt i64 %59, -1, !dbg !14266
br i1 %60, label %L173, label %L168, !dbg !14267
L168: ; preds = %L166
%61 = sub i64 0, %59, !dbg !14268
call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %5) #118
call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %8) #118
call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %11) #118
call void @llvm.lifetime.end.p0i8(i64 1, i8* nonnull %12) #118
call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %15) #118
call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %18) #118
%62 = call noalias nonnull {} addrspace(10)* @ijl_box_int64(i64 signext %61) #121, !dbg !14269
%63 = call nonnull {} addrspace(10)* ({} addrspace(10)* ({} addrspace(10)*, {} addrspace(10)**, i32, {} addrspace(10)*)*, {} addrspace(10)*, {} addrspace(10)*, ...) @julia.call2({} addrspace(10)* ({} addrspace(10)*, {} addrspace(10)**, i32, {} addrspace(10)*)* nonnull @ijl_invoke, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140057328687824 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140057299463376 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140057409876736 to {}*) to {} addrspace(10)*), {} addrspace(10)* nonnull %62, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140057409876704 to {}*) to {} addrspace(10)*)) #123, !dbg !14269
%box61 = call noalias nonnull dereferenceable(8) "enzyme_inactive" {} addrspace(10)* @julia.gc_alloc_obj({}** nonnull %current_task17, i64 8, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140057370703792 to {}*) to {} addrspace(10)*)) #119, !dbg !14269
%64 = bitcast {} addrspace(10)* %box61 to [1 x {} addrspace(10)*] addrspace(10)*, !dbg !14269
%65 = getelementptr [1 x {} addrspace(10)*], [1 x {} addrspace(10)*] addrspace(10)* %64, i64 0, i64 0, !dbg !14269
store {} addrspace(10)* %63, {} addrspace(10)* addrspace(10)* %65, align 8, !dbg !14269, !tbaa !206, !alias.scope !210, !noalias !14218
%66 = addrspacecast {} addrspace(10)* %box61 to {} addrspace(12)*, !dbg !14269
call void @ijl_throw({} addrspace(12)* %66) #118, !dbg !14269
unreachable, !dbg !14269
L173: ; preds = %L166
call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %5) #118
call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %8) #118
call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %11) #118
call void @llvm.lifetime.end.p0i8(i64 1, i8* nonnull %12) #118
call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %15) #118
call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %18) #118
%box66 = call noalias nonnull dereferenceable(8) "enzyme_inactive" {} addrspace(10)* @julia.gc_alloc_obj({}** nonnull %current_task17, i64 8, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140057328233392 to {}*) to {} addrspace(10)*)) #119, !dbg !14270
%memcpy_refined_dst = bitcast {} addrspace(10)* %box66 to i64 addrspace(10)*, !dbg !14270
store i64 %59, i64 addrspace(10)* %memcpy_refined_dst, align 8, !dbg !14270, !tbaa !206, !alias.scope !210, !noalias !14218
%67 = addrspacecast {} addrspace(10)* %box66 to {} addrspace(12)*, !dbg !14270
call void @ijl_throw({} addrspace(12)* %67) #118, !dbg !14270
unreachable, !dbg !14270
L176: ; preds = %L60
%68 = load i64, i64* %7, align 16, !dbg !14271, !tbaa !3725, !alias.scope !210, !noalias !334
%69 = load i64, i64* %4, align 16, !dbg !14271, !tbaa !3725, !alias.scope !210, !noalias !334
%70 = getelementptr inbounds [1 x {} addrspace(10)*], [1 x {} addrspace(10)*]* %1, i64 0, i64 0, !dbg !14273
store {} addrspace(10)* %49, {} addrspace(10)** %70, align 8, !dbg !14273, !noalias !14274
%.repack = getelementptr inbounds { i64, i64, {} addrspace(10)* }, { i64, i64, {} addrspace(10)* }* %0, i64 0, i32 0, !dbg !14273
store i64 %68, i64* %.repack, align 8, !dbg !14273, !noalias !14274
%.repack96 = getelementptr inbounds { i64, i64, {} addrspace(10)* }, { i64, i64, {} addrspace(10)* }* %0, i64 0, i32 1, !dbg !14273
store i64 %69, i64* %.repack96, align 8, !dbg !14273, !noalias !14274
%.repack98 = getelementptr inbounds { i64, i64, {} addrspace(10)* }, { i64, i64, {} addrspace(10)* }* %0, i64 0, i32 2, !dbg !14273
store {} addrspace(10)* %49, {} addrspace(10)** %.repack98, align 8, !dbg !14273, !noalias !14274
ret void, !dbg !14273
}
No augmented forward pass found for dgebal_64_
at context: call void @dgebal_64_(i8* noundef nonnull %12, i8* noundef nonnull %15, i64 %54, i8* noundef nonnull %18, i64 noundef %bitcast_coercion47, i64 noundef %bitcast_coercion51, i64 %58, i64 noundef %bitcast_coercion57, i64 noundef 1) #118 [ "jl_roots"({} addrspace(10)* null, {} addrspace(10)* %49, {} addrspace(10)* null, {} addrspace(10)* null, {} addrspace(10)* null, {} addrspace(10)* %2, {} addrspace(10)* null, {} addrspace(10)* null) ], !dbg !221
Stacktrace:
[1] gebal!
@ ~/julia-1.10/usr/share/julia/stdlib/v1.10/LinearAlgebra/src/lapack.jl:221
Stacktrace:
[1] throwerr(cstr::Cstring)
@ Enzyme.Compiler ~/.julia/packages/Enzyme/R8qo4/src/compiler.jl:1303
[2] gebal!
@ ~/julia-1.10/usr/share/julia/stdlib/v1.10/LinearAlgebra/src/lapack.jl:221
[3] exp!
@ ~/julia-1.10/usr/share/julia/stdlib/v1.10/LinearAlgebra/src/dense.jl:654
[4] exp
@ ~/julia-1.10/usr/share/julia/stdlib/v1.10/LinearAlgebra/src/dense.jl:594 [inlined]
[5] #10
@ ./REPL[3]:3 [inlined]
[6] diffejulia__10_2152wrap
@ ./REPL[3]:0
[7] macro expansion
@ Enzyme.Compiler ~/.julia/packages/Enzyme/R8qo4/src/compiler.jl:5220 [inlined]
[8] enzyme_call
@ Enzyme.Compiler ~/.julia/packages/Enzyme/R8qo4/src/compiler.jl:4898 [inlined]
[9] CombinedAdjointThunk
@ Enzyme.Compiler ~/.julia/packages/Enzyme/R8qo4/src/compiler.jl:4861 [inlined]
[10] autodiff
@ Enzyme ~/.julia/packages/Enzyme/R8qo4/src/Enzyme.jl:215 [inlined]
[11] autodiff
@ Enzyme ~/.julia/packages/Enzyme/R8qo4/src/Enzyme.jl:238 [inlined]
[12] autodiff(mode::ReverseMode{false, FFIABI}, f::var"#10#11", args::Duplicated{Matrix{Float64}})
@ Enzyme ~/.julia/packages/Enzyme/R8qo4/src/Enzyme.jl:224
[13] top-level scope
@ REPL[3]:3
```
Contributor guide
Assessment
This issue has not been assessed yet.