-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Description
I'm trying to run some of the tests model in Turing with the new Libtask but run into an index error:
Got exception outside of a @test
MethodError: no method matching getindex(::Libtask.Box{Nothing}, ::Int64) The IR looks like this:
DynamicPPL.Model{var"#normal#21", (), (), (), Tuple{}, Tuple{}, DynamicPPL.DefaultContext}(:normal, var"#normal#21"(Core.Box(var"#normal
#21"(#= circular reference @-2 =#))), NamedTuple(), NamedTuple(), DynamicPPL.DefaultContext())
1: (%1, %2, %3)
%9 = Libtask.Tape()
%10 = Libtask.run_and_record!(%9, Libtask.box_args, %2, %3)
%11 = Libtask.run_and_record!(%9, Base.indexed_iterate, %10, 1)
%12 = Libtask.run_and_record!(%9, Core.getfield, %11, 1)
%13 = Libtask.run_and_record!(%9, Core.getfield, %11, 2)
%14 = Libtask.run_and_record!(%9, Base.indexed_iterate, %10, 2, %13)
%15 = Libtask.run_and_record!(%9, Core.getfield, %14, 1)
%4 = Libtask.run_and_record!(%9, Base.getproperty, DynamicPPL.Threads, :nthreads)
%5 = Libtask.run_and_record!(%9, %4)
%6 = Libtask.run_and_record!(%9, DynamicPPL.:(==), %5, 1)
%17 = Libtask.val(%6)
br 3 unless %17
2:
%7 = Libtask.run_and_record!(%9, DynamicPPL.evaluate_threadunsafe, %1, %12, %15)
return %7
3:
%8 = Libtask.run_and_record!(%9, DynamicPPL.evaluate_threadsafe, %1, %12, %15)
%16 = Libtask.run_and_record!(%9, Base.identity, %8)
return %9
From what I understand DynamicPPL branches on the number of threads here:
function evaluate!!(model::Model, varinfo::AbstractVarInfo, context::AbstractContext)
return if use_threadsafe_eval(context, varinfo)
evaluate_threadsafe!!(model, varinfo, context)
else
evaluate_threadunsafe!!(model, varinfo, context)
end
endbut we only intercept one return block in intercept:
last_blk = IRTools.blocks(ir)[end]Metadata
Metadata
Assignees
Labels
No labels