Skip to content

Commit

Permalink
Increase stack size when compiling Enzyme gradients
Browse files Browse the repository at this point in the history
  • Loading branch information
ptiede committed Nov 19, 2024
1 parent 3f01da8 commit f1b61d4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ext/ComradeEnzymeExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ LogDensityProblems.capabilities(::Type{<:Comrade.TransformedVLBIPosterior}) = Lo
function LogDensityProblems.logdensity_and_gradient(d::Comrade.TransformedVLBIPosterior, x::AbstractArray)
mode = Enzyme.EnzymeCore.WithPrimal(Comrade.admode(d))
dx = zero(x)
(_, y) = autodiff(mode, Comrade.logdensityof, Active, Const(d), Duplicated(x, dx))
y = fetch(schedule(
Task(32*1024*2014) do
(_, y) = autodiff(mode, Comrade.logdensityof, Active, Const(d), Duplicated(x, dx))
return y
end
))
return y, dx
end

Expand Down

0 comments on commit f1b61d4

Please sign in to comment.