Skip to content
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

[ForwardMode] Runtime Activity not supported for BLAS calls #1995

Open
mhauru opened this issue Oct 22, 2024 · 0 comments
Open

[ForwardMode] Runtime Activity not supported for BLAS calls #1995

mhauru opened this issue Oct 22, 2024 · 0 comments

Comments

@mhauru
Copy link
Contributor

mhauru commented Oct 22, 2024

I'm running into the following while trying to adapt existing Distributions.jl tests for Enzyme integration tests:

julia> import Enzyme; using PDMats, Distributions

julia> func = (m, S, x) -> logpdf(MvLogitNormal(m, S), vcat(x, 1 - sum(x)))
#23 (generic function with 1 method)

julia> args = ([0.4, 0.6], PDMat([6.06 0.91; 0.91  6.37]), [0.27, 0.24])
([0.4, 0.6], [6.06 0.91; 0.91 6.37], [0.27, 0.24])

julia> Enzyme.gradient(Enzyme.set_runtime_activity(Enzyme.Forward), Enzyme.Const(func), args...)
ERROR: Current scope:
; Function Attrs: mustprogress willreturn
define internal fastcc nonnull "enzyme_type"="{[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}" {} addrspace(10)* @preprocess_julia_trtrs__176332(i32 zeroext "enzyme_inactive" "enzyme_type"="{[-1]:Integer}" "enzymejl_parmtype"="4766342512" "enzymejl_parmtype_ref"="0" %0, i32 zeroext "enzyme_inactive" "enzyme_type"="{[-1]:Integer}" "enzymejl_parmtype"="4766342512" "enzymejl_parmtype_ref"="0" %1, {} addrspace(10)* noundef nonnull align 16 dereferenceable(40) "enzyme_type"="{[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}" "enzymejl_parmtype"="5260936144" "enzymejl_parmtype_ref"="2" %2, {} addrspace(10)* noundef nonnull align 16 dereferenceable(40) "enzyme_type"="{[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}" "enzymejl_parmtype"="4694385600" "enzymejl_parmtype_ref"="2" %3) unnamed_addr #65 !dbg !4674 {
top:
  %4 = alloca i64, align 16
  %5 = bitcast i64* %4 to i8*
  %6 = alloca i8, align 1
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  %9 = alloca i64, align 16
  %10 = bitcast i64* %9 to i8*
  %11 = alloca i64, align 16
  %12 = bitcast i64* %11 to i8*
  %13 = alloca i64, align 16
  %14 = bitcast i64* %13 to i8*
  %15 = alloca i64, align 16
  %16 = bitcast i64* %15 to i8*
  %17 = call {}*** @julia.get_pgcstack() #67
  %current_task1124 = getelementptr inbounds {}**, {}*** %17, i64 -14
  %current_task1 = bitcast {}*** %current_task1124 to {}**
  %ptls_field125 = getelementptr inbounds {}**, {}*** %17, i64 2
  %18 = bitcast {}*** %ptls_field125 to i64***
  %ptls_load126127 = load i64**, i64*** %18, align 8, !tbaa !50
  %19 = getelementptr inbounds i64*, i64** %ptls_load126127, i64 2
  %safepoint = load i64*, i64** %19, align 8, !tbaa !54
  fence syncscope("singlethread") seq_cst
  call void @julia.safepoint(i64* %safepoint) #67, !dbg !4675
  fence syncscope("singlethread") seq_cst
  switch i32 %1, label %L18 [
    i32 1308622848, label %L39
    i32 1409286144, label %L39
    i32 1124073472, label %L39
  ], !dbg !4676

L18:                                              ; preds = %top
  %20 = call nonnull {} addrspace(10)* @julia_string_176344({} addrspace(10)* nofree noundef nonnull align 32 addrspacecast ({}* inttoptr (i64 4799399712 to {}*) to {} addrspace(10)*), i32 zeroext %1) #67, !dbg !4678
  %box = call noalias nonnull dereferenceable(8) "enzyme_inactive" "enzyme_type"="{[-1]:Pointer, [-1,-1]:Pointer}" {} addrspace(10)* @julia.gc_alloc_obj({}** nonnull %current_task1, i64 8, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 4765200624 to {}*) to {} addrspace(10)*)) #68, !dbg !4678
  %21 = bitcast {} addrspace(10)* %box to [1 x {} addrspace(10)*] addrspace(10)*, !dbg !4678, !enzyme_inactive !0
  %22 = getelementptr [1 x {} addrspace(10)*], [1 x {} addrspace(10)*] addrspace(10)* %21, i64 0, i64 0, !dbg !4678
  store {} addrspace(10)* %20, {} addrspace(10)* addrspace(10)* %22, align 8, !dbg !4678, !tbaa !656, !alias.scope !248, !noalias !4679
  %23 = addrspacecast {} addrspace(10)* %box to {} addrspace(12)*, !dbg !4678, !enzyme_inactive !0
  call void @ijl_throw({} addrspace(12)* %23) #67, !dbg !4678
  unreachable, !dbg !4678

L39:                                              ; preds = %top, %top, %top
  %24 = addrspacecast {} addrspace(10)* %2 to {} addrspace(11)*, !dbg !4682
  %25 = addrspacecast {} addrspace(10)* %2 to {} addrspace(10)* addrspace(11)*, !dbg !4682
  %arraysize_ptr = getelementptr inbounds {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %25, i64 3, !dbg !4682
  %26 = bitcast {} addrspace(10)* addrspace(11)* %arraysize_ptr to i64 addrspace(11)*, !dbg !4682
  %arraysize = load i64, i64 addrspace(11)* %26, align 8, !dbg !4682, !tbaa !54, !range !238, !alias.scope !147, !noalias !148, !enzyme_inactive !0
  %arraysize_ptr8 = getelementptr inbounds {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %25, i64 4, !dbg !4682
  %27 = bitcast {} addrspace(10)* addrspace(11)* %arraysize_ptr8 to i64 addrspace(11)*, !dbg !4682
  %arraysize9 = load i64, i64 addrspace(11)* %27, align 8, !dbg !4682, !tbaa !54, !range !238, !alias.scope !147, !noalias !148, !enzyme_inactive !0
  %.not = icmp eq i64 %arraysize, %arraysize9, !dbg !4685
  br i1 %.not, label %L52, label %L44, !dbg !4686

L44:                                              ; preds = %L39
  %newstruct105 = call noalias nonnull dereferenceable(16) "enzyme_inactive" "enzyme_type"="{[-1]:Pointer}" {} addrspace(10)* @julia.gc_alloc_obj({}** nonnull %current_task1, i64 16, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 4696195872 to {}*) to {} addrspace(10)*)) #68, !dbg !4687
  %28 = addrspacecast {} addrspace(10)* %newstruct105 to {} addrspace(10)* addrspace(11)*, !dbg !4687, !enzyme_inactive !0
  store {} addrspace(10)* null, {} addrspace(10)* addrspace(11)* %28, align 8, !dbg !4687, !tbaa !652, !alias.scope !248, !noalias !4679
  %29 = getelementptr inbounds {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %28, i64 1, !dbg !4687
  store {} addrspace(10)* null, {} addrspace(10)* addrspace(11)* %29, align 8, !dbg !4687, !tbaa !652, !alias.scope !248, !noalias !4679
  %box107 = call noalias nonnull dereferenceable(24) "enzyme_inactive" "enzyme_type"="{[-1]:Pointer, [-1,0]:Pointer, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer}" {} addrspace(10)* @julia.gc_alloc_obj({}** nonnull %current_task1, i64 24, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 13257870160 to {}*) to {} addrspace(10)*)) #68, !dbg !4687
  %30 = bitcast {} addrspace(10)* %box107 to { {} addrspace(10)*, [2 x i64] } addrspace(10)*, !dbg !4687, !enzyme_inactive !0
  %.repack = getelementptr inbounds { {} addrspace(10)*, [2 x i64] }, { {} addrspace(10)*, [2 x i64] } addrspace(10)* %30, i64 0, i32 0, !dbg !4687
  store {} addrspace(10)* addrspacecast ({}* inttoptr (i64 4811711520 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspace(10)* %.repack, align 8, !dbg !4687, !tbaa !656, !alias.scope !248, !noalias !4679
  %.repack134.repack = getelementptr inbounds { {} addrspace(10)*, [2 x i64] }, { {} addrspace(10)*, [2 x i64] } addrspace(10)* %30, i64 0, i32 1, i64 0, !dbg !4687
  store i64 %arraysize, i64 addrspace(10)* %.repack134.repack, align 8, !dbg !4687, !tbaa !656, !alias.scope !248, !noalias !4679
  %.repack134.repack136 = getelementptr inbounds { {} addrspace(10)*, [2 x i64] }, { {} addrspace(10)*, [2 x i64] } addrspace(10)* %30, i64 0, i32 1, i64 1, !dbg !4687
  store i64 %arraysize9, i64 addrspace(10)* %.repack134.repack136, align 8, !dbg !4687, !tbaa !656, !alias.scope !248, !noalias !4679
  store atomic {} addrspace(10)* %box107, {} addrspace(10)* addrspace(11)* %28 release, align 8, !dbg !4687, !tbaa !652, !alias.scope !248, !noalias !4679
  call void ({} addrspace(10)*, ...) @julia.write_barrier({} addrspace(10)* nonnull %newstruct105, {} addrspace(10)* nonnull %box107) #69, !dbg !4687
  %31 = addrspacecast {} addrspace(10)* %newstruct105 to i8 addrspace(11)*, !dbg !4687, !enzyme_inactive !0
  %32 = getelementptr inbounds i8, i8 addrspace(11)* %31, i64 8, !dbg !4687
  %33 = bitcast i8 addrspace(11)* %32 to {} addrspace(10)* addrspace(11)*, !dbg !4687
  store atomic {} addrspace(10)* addrspacecast ({}* inttoptr (i64 4301111304 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspace(11)* %33 release, align 8, !dbg !4687, !tbaa !652, !alias.scope !248, !noalias !4679
  %box109 = call noalias nonnull dereferenceable(8) "enzyme_inactive" "enzyme_type"="{[-1]:Pointer, [-1,-1]:Pointer}" {} addrspace(10)* @julia.gc_alloc_obj({}** nonnull %current_task1, i64 8, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 4743037616 to {}*) to {} addrspace(10)*)) #68, !dbg !4686
  %34 = bitcast {} addrspace(10)* %box109 to [1 x {} addrspace(10)*] addrspace(10)*, !dbg !4686, !enzyme_inactive !0
  %35 = getelementptr [1 x {} addrspace(10)*], [1 x {} addrspace(10)*] addrspace(10)* %34, i64 0, i64 0, !dbg !4686
  store {} addrspace(10)* %newstruct105, {} addrspace(10)* addrspace(10)* %35, align 8, !dbg !4686, !tbaa !656, !alias.scope !248, !noalias !4679
  %36 = addrspacecast {} addrspace(10)* %box109 to {} addrspace(12)*, !dbg !4686, !enzyme_inactive !0
  call void @ijl_throw({} addrspace(12)* %36) #67, !dbg !4686
  unreachable, !dbg !4686

L52:                                              ; preds = %L39
  switch i32 %0, label %L63 [
    i32 1426063360, label %L69
    i32 1275068416, label %L69
  ], !dbg !4688

L63:                                              ; preds = %L52
  %37 = insertvalue { {} addrspace(10)*, i32 } { {} addrspace(10)* addrspacecast ({}* inttoptr (i64 4799401152 to {}*) to {} addrspace(10)*), i32 0 }, i32 %0, 1, !dbg !4690
  %newstruct = call noalias nonnull dereferenceable(16) "enzyme_inactive" "enzyme_type"="{[-1]:Pointer}" {} addrspace(10)* @julia.gc_alloc_obj({}** nonnull %current_task1, i64 16, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 4696195872 to {}*) to {} addrspace(10)*)) #68, !dbg !4690
  %38 = addrspacecast {} addrspace(10)* %newstruct to {} addrspace(10)* addrspace(11)*, !dbg !4690, !enzyme_inactive !0
  store {} addrspace(10)* null, {} addrspace(10)* addrspace(11)* %38, align 8, !dbg !4690, !tbaa !652, !alias.scope !248, !noalias !4679
  %39 = getelementptr inbounds {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %38, i64 1, !dbg !4690
  store {} addrspace(10)* null, {} addrspace(10)* addrspace(11)* %39, align 8, !dbg !4690, !tbaa !652, !alias.scope !248, !noalias !4679
  %box13 = call noalias nonnull dereferenceable(16) "enzyme_inactive" "enzyme_type"="{[-1]:Pointer, [-1,0]:Pointer, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer}" {} addrspace(10)* @julia.gc_alloc_obj({}** nonnull %current_task1, i64 16, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 4715656560 to {}*) to {} addrspace(10)*)) #68, !dbg !4690
  %40 = bitcast {} addrspace(10)* %box13 to { {} addrspace(10)*, i32 } addrspace(10)*, !dbg !4690, !enzyme_inactive !0
  store { {} addrspace(10)*, i32 } %37, { {} addrspace(10)*, i32 } addrspace(10)* %40, align 8, !dbg !4690, !tbaa !656, !alias.scope !248, !noalias !4679
  store atomic {} addrspace(10)* %box13, {} addrspace(10)* addrspace(11)* %38 release, align 8, !dbg !4690, !tbaa !652, !alias.scope !248, !noalias !4679
  call void ({} addrspace(10)*, ...) @julia.write_barrier({} addrspace(10)* nonnull %newstruct, {} addrspace(10)* nonnull %box13) #69, !dbg !4690
  %41 = addrspacecast {} addrspace(10)* %newstruct to i8 addrspace(11)*, !dbg !4690, !enzyme_inactive !0
  %42 = getelementptr inbounds i8, i8 addrspace(11)* %41, i64 8, !dbg !4690
  %43 = bitcast i8 addrspace(11)* %42 to {} addrspace(10)* addrspace(11)*, !dbg !4690
  store atomic {} addrspace(10)* addrspacecast ({}* inttoptr (i64 4301111304 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspace(11)* %43 release, align 8, !dbg !4690, !tbaa !652, !alias.scope !248, !noalias !4679
  %box15 = call noalias nonnull dereferenceable(8) "enzyme_inactive" "enzyme_type"="{[-1]:Pointer, [-1,-1]:Pointer}" {} addrspace(10)* @julia.gc_alloc_obj({}** nonnull %current_task1, i64 8, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 4765200624 to {}*) to {} addrspace(10)*)) #68, !dbg !4691
  %44 = bitcast {} addrspace(10)* %box15 to [1 x {} addrspace(10)*] addrspace(10)*, !dbg !4691, !enzyme_inactive !0
  %45 = getelementptr [1 x {} addrspace(10)*], [1 x {} addrspace(10)*] addrspace(10)* %44, i64 0, i64 0, !dbg !4691
  store {} addrspace(10)* %newstruct, {} addrspace(10)* addrspace(10)* %45, align 8, !dbg !4691, !tbaa !656, !alias.scope !248, !noalias !4679
  %46 = addrspacecast {} addrspace(10)* %box15 to {} addrspace(12)*, !dbg !4691, !enzyme_inactive !0
  call void @ijl_throw({} addrspace(12)* %46) #67, !dbg !4691
  unreachable, !dbg !4691

L69:                                              ; preds = %L52, %L52
  %47 = addrspacecast {} addrspace(10)* %3 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)*, !dbg !4692
  %arraylen_ptr = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %47, i64 0, i32 1, !dbg !4692
  %arraylen = load i64, i64 addrspace(11)* %arraylen_ptr, align 8, !dbg !4692, !tbaa !236, !range !238, !alias.scope !133, !noalias !136, !enzyme_inactive !0
  %48 = icmp eq i64 %arraysize, %arraylen, !dbg !4694
  br i1 %48, label %L153, label %L73, !dbg !4693

L73:                                              ; preds = %L69
  %49 = call noalias nonnull "enzyme_inactive" "enzyme_type"="{[-1]:Pointer, [-1,-1]:Integer}" {} addrspace(10)* @ijl_box_int64(i64 signext %arraylen) #70, !dbg !4696
  %50 = call noalias nonnull "enzyme_inactive" "enzyme_type"="{[-1]:Pointer, [-1,-1]:Integer}" {} addrspace(10)* @ijl_box_int64(i64 signext %arraysize) #70, !dbg !4696
  %51 = call nonnull "enzyme_type"="{[-1]:Pointer}" {} 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 4709156736 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspacecast ({}* inttoptr (i64 4694577584 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspacecast ({}* inttoptr (i64 4799013888 to {}*) to {} addrspace(10)*), {} addrspace(10)* nonnull %49, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 4799013856 to {}*) to {} addrspace(10)*), {} addrspace(10)* nonnull %50) #71, !dbg !4696
  %box21 = call noalias nonnull dereferenceable(8) "enzyme_inactive" "enzyme_type"="{[-1]:Pointer, [-1,-1]:Pointer}" {} addrspace(10)* @julia.gc_alloc_obj({}** nonnull %current_task1, i64 8, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 4743037616 to {}*) to {} addrspace(10)*)) #68, !dbg !4696
  %52 = bitcast {} addrspace(10)* %box21 to [1 x {} addrspace(10)*] addrspace(10)*, !dbg !4696, !enzyme_inactive !0
  %53 = getelementptr [1 x {} addrspace(10)*], [1 x {} addrspace(10)*] addrspace(10)* %52, i64 0, i64 0, !dbg !4696
  store {} addrspace(10)* %51, {} addrspace(10)* addrspace(10)* %53, align 8, !dbg !4696, !tbaa !656, !alias.scope !248, !noalias !4679
  %54 = addrspacecast {} addrspace(10)* %box21 to {} addrspace(12)*, !dbg !4696, !enzyme_inactive !0
  call void @ijl_throw({} addrspace(12)* %54) #67, !dbg !4696
  unreachable, !dbg !4696

L153:                                             ; preds = %L69
  %55 = addrspacecast {} addrspace(10)* %3 to {} addrspace(11)*, !dbg !4692
  %56 = lshr i32 %0, 24, !dbg !4697
  %value_phi26 = trunc i32 %56 to i8, !dbg !4705
  store i8 %value_phi26, i8* %6, align 1, !dbg !4701, !tbaa !652, !alias.scope !248, !noalias !4679
  %57 = lshr i32 %1, 24, !dbg !4697
  %value_phi29 = trunc i32 %57 to i8, !dbg !4705
  store i8 %value_phi29, i8* %7, align 1, !dbg !4701, !tbaa !652, !alias.scope !248, !noalias !4679
  store i8 78, i8* %8, align 1, !dbg !4701, !tbaa !652, !alias.scope !248, !noalias !4679
  store i64 %arraysize, i64* %9, align 16, !dbg !4701, !tbaa !652, !alias.scope !248, !noalias !4679
  store i64 1, i64* %11, align 16, !dbg !4701, !tbaa !652, !alias.scope !248, !noalias !4679
  %.not129 = icmp eq i64 %arraysize, 0, !dbg !4706
  %58 = select i1 %.not129, i64 1, i64 %arraysize, !dbg !4708
  store i64 %58, i64* %13, align 16, !dbg !4701, !tbaa !652, !alias.scope !248, !noalias !4679
  store i64 %58, i64* %15, align 16, !dbg !4701, !tbaa !652, !alias.scope !248, !noalias !4679
  %59 = call nonnull "enzyme_type"="{[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}" {}* @julia.pointer_from_objref({} addrspace(11)* %24) #72, !dbg !4709
  %60 = bitcast {}* %59 to double**, !dbg !4709
  %arrayptr131 = load double*, double** %60, align 8, !dbg !4709, !tbaa !54, !alias.scope !147, !noalias !148, !nonnull !0
  %61 = call nonnull "enzyme_type"="{[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}" {}* @julia.pointer_from_objref({} addrspace(11)* %55) #72, !dbg !4709
  %62 = bitcast {}* %61 to double**, !dbg !4709
  %arrayptr72132 = load double*, double** %62, align 8, !dbg !4709, !tbaa !130, !alias.scope !133, !noalias !136, !nonnull !0
  %bitcast_coercion77 = ptrtoint i64* %4 to i64, !dbg !4710
  call void @dtrtrs_64_(i8* nonnull %6, i8* nonnull %7, i8* nonnull %8, i8* nonnull %10, i8* nonnull %12, double* nonnull %arrayptr131, i8* nonnull %14, double* nonnull %arrayptr72132, i8* nonnull %16, i64 %bitcast_coercion77, i64 1, i64 1, i64 1) #67 [ "jl_roots"({} addrspace(10)* null, {} addrspace(10)* null, {} addrspace(10)* %3, {} addrspace(10)* null, {} addrspace(10)* %2, {} addrspace(10)* null, {} addrspace(10)* null, {} addrspace(10)* null, {} addrspace(10)* null, {} addrspace(10)* null) ], !dbg !4704
  %63 = load i64, i64* %4, align 16, !dbg !4713, !tbaa !652, !alias.scope !248, !noalias !249
  %.not133 = icmp eq i64 %63, 0, !dbg !4716
  br i1 %.not133, label %L273, label %L263, !dbg !4717

L263:                                             ; preds = %L153
  %64 = icmp sgt i64 %63, -1, !dbg !4718
  br i1 %64, label %L270, label %L265, !dbg !4719

L265:                                             ; preds = %L263
  %65 = sub i64 0, %63, !dbg !4720
  call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %5) #67
  call void @llvm.lifetime.end.p0i8(i64 1, i8* nonnull %6) #67
  call void @llvm.lifetime.end.p0i8(i64 1, i8* nonnull %7) #67
  call void @llvm.lifetime.end.p0i8(i64 1, i8* nonnull %8) #67
  call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %10) #67
  call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %12) #67
  call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %14) #67
  call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %16) #67
  %66 = call noalias nonnull "enzyme_inactive" "enzyme_type"="{[-1]:Pointer, [-1,-1]:Integer}" {} addrspace(10)* @ijl_box_int64(i64 signext %65) #70, !dbg !4721
  %67 = call nonnull "enzyme_type"="{[-1]:Pointer}" {} 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 4709156736 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspacecast ({}* inttoptr (i64 4694577584 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspacecast ({}* inttoptr (i64 4799400544 to {}*) to {} addrspace(10)*), {} addrspace(10)* nonnull %66, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 4799400512 to {}*) to {} addrspace(10)*)) #71, !dbg !4721
  %box88 = call noalias nonnull dereferenceable(8) "enzyme_inactive" "enzyme_type"="{[-1]:Pointer, [-1,-1]:Pointer}" {} addrspace(10)* @julia.gc_alloc_obj({}** nonnull %current_task1, i64 8, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 4765200624 to {}*) to {} addrspace(10)*)) #68, !dbg !4721
  %68 = bitcast {} addrspace(10)* %box88 to [1 x {} addrspace(10)*] addrspace(10)*, !dbg !4721, !enzyme_inactive !0
  %69 = getelementptr [1 x {} addrspace(10)*], [1 x {} addrspace(10)*] addrspace(10)* %68, i64 0, i64 0, !dbg !4721
  store {} addrspace(10)* %67, {} addrspace(10)* addrspace(10)* %69, align 8, !dbg !4721, !tbaa !656, !alias.scope !248, !noalias !4679
  %70 = addrspacecast {} addrspace(10)* %box88 to {} addrspace(12)*, !dbg !4721, !enzyme_inactive !0
  call void @ijl_throw({} addrspace(12)* %70) #67, !dbg !4721
  unreachable, !dbg !4721

L270:                                             ; preds = %L263
  call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %5) #67
  call void @llvm.lifetime.end.p0i8(i64 1, i8* nonnull %6) #67
  call void @llvm.lifetime.end.p0i8(i64 1, i8* nonnull %7) #67
  call void @llvm.lifetime.end.p0i8(i64 1, i8* nonnull %8) #67
  call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %10) #67
  call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %12) #67
  call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %14) #67
  call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %16) #67
  %box93 = call noalias nonnull dereferenceable(8) "enzyme_inactive" "enzyme_type"="{[-1]:Pointer, [-1,-1]:Integer}" {} addrspace(10)* @julia.gc_alloc_obj({}** nonnull %current_task1, i64 8, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 4732901104 to {}*) to {} addrspace(10)*)) #68, !dbg !4722
  %memcpy_refined_dst = bitcast {} addrspace(10)* %box93 to i64 addrspace(10)*, !dbg !4722, !enzyme_inactive !0
  store i64 %63, i64 addrspace(10)* %memcpy_refined_dst, align 8, !dbg !4722, !tbaa !656, !alias.scope !248, !noalias !4679
  %71 = addrspacecast {} addrspace(10)* %box93 to {} addrspace(12)*, !dbg !4722, !enzyme_inactive !0
  call void @ijl_throw({} addrspace(12)* %71) #67, !dbg !4722
  unreachable, !dbg !4722

L273:                                             ; preds = %L153
  ret {} addrspace(10)* %3, !dbg !4723
}

trtrs
0x6000be0a3da0
Runtime Activity not supported for BLAS calls


Stacktrace:
 [1] trtrs!
   @ ~/.julia/juliaup/julia-1.10.5+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/LinearAlgebra/src/lapack.jl:3557


Stacktrace:
  [1] trtrs!
    @ ~/.julia/juliaup/julia-1.10.5+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/LinearAlgebra/src/lapack.jl:3557
  [2] generic_trimatdiv!
    @ ~/.julia/juliaup/julia-1.10.5+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/LinearAlgebra/src/triangular.jl:830 [inlined]
  [3] _ldiv!
    @ ~/.julia/juliaup/julia-1.10.5+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/LinearAlgebra/src/triangular.jl:752 [inlined]
  [4] ldiv!
    @ ~/.julia/juliaup/julia-1.10.5+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/LinearAlgebra/src/triangular.jl:745 [inlined]
  [5] \
    @ ~/.julia/juliaup/julia-1.10.5+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/LinearAlgebra/src/triangular.jl:1485 [inlined]
  [6] invquad
    @ ~/.julia/packages/PDMats/cAM9h/src/pdmat.jl:146
  [7] sqmahal
    @ ~/.julia/packages/Distributions/nmUhn/src/multivariate/mvnormal.jl:267
  [8] _logpdf
    @ ~/.julia/packages/Distributions/nmUhn/src/multivariate/mvnormal.jl:143 [inlined]
  [9] logpdf
    @ ~/.julia/packages/Distributions/nmUhn/src/common.jl:263 [inlined]
 [10] _logpdf
    @ ~/.julia/packages/Distributions/nmUhn/src/multivariate/mvlogitnormal.jl:74
 [11] logpdf
    @ ~/.julia/packages/Distributions/nmUhn/src/common.jl:263 [inlined]
 [12] #23
    @ ./REPL[113]:1 [inlined]
 [13] fwddiffe2julia__23_176248_inner_1wrap
    @ ./REPL[113]:0
 [14] macro expansion
    @ ~/projects/Enzyme.jl/src/compiler.jl:8148 [inlined]
 [15] enzyme_call
    @ ~/projects/Enzyme.jl/src/compiler.jl:7714 [inlined]
 [16] ForwardModeThunk
    @ ~/projects/Enzyme.jl/src/compiler.jl:7503 [inlined]
 [17] autodiff
    @ ~/projects/Enzyme.jl/src/Enzyme.jl:647 [inlined]
 [18] macro expansion
    @ ~/projects/Enzyme.jl/src/Enzyme.jl:2068 [inlined]
 [19] gradient(::EnzymeCore.ForwardMode{…}, ::EnzymeCore.Const{…}, ::Vector{…}, ::PDMat{…}, ::Vector{…}; chunk::Nothing, shadows::Tuple{…})
    @ Enzyme ~/projects/Enzyme.jl/src/Enzyme.jl:1970
 [20] gradient(::EnzymeCore.ForwardMode{…}, ::EnzymeCore.Const{…}, ::Vector{…}, ::PDMat{…}, ::Vector{…})
    @ Enzyme ~/projects/Enzyme.jl/src/Enzyme.jl:1970
 [21] top-level scope
    @ REPL[116]:1
Some type information was truncated. Use `show(err)` to see complete types.

Without runtime activity I get the usual "you need to use runtime activity" error.

Is there hope that this would get fixed, or is there some fundamental issue here? A less intimidating error message would also be good.

@wsmoses wsmoses changed the title Runtime Activity not supported for BLAS calls [fRuntime Activity not supported for BLAS calls Oct 22, 2024
@wsmoses wsmoses changed the title [fRuntime Activity not supported for BLAS calls [ForwardMode] Runtime Activity not supported for BLAS calls Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant