You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Initialize this cache outside of the call to phi! and pass it as a function argument (e.g. expcache?). I tried this locally and such a change would remove most allocations:
So what exactly is your suggestion to fix this issue? I'm more than happy to help here to have an (ideally easily accessible) allocation-free phi!.
From my point of view, I'd think that the preallocation for phi! in general could benefit from some improvements, e.g. the differences between caches and cache is not clear at all (the former is basically undocumented and there is no easy syntax to preallocate it right now), and maybe the output should also be more easily preallocateable.
The docstring of
phi!
states:ExponentialUtilities.jl/src/phi.jl
Lines 115 to 119 in 0cd7738
Yet, it allocates:
(and figuring out how to choose
out
andcaches
already required a bit of digging in the source code as this part is basically undocumented)In comparison, non-allocating
exponential!
is very straight-forward:The reason
Going through profilers and some code, the issue seems to be the combination of this call here
ExponentialUtilities.jl/src/phi.jl
Line 80 in 0cd7738
which then leads to some allocation here
ExponentialUtilities.jl/src/exp_noalloc.jl
Line 80 in 0cd7738
Potential solution
Initialize this cache outside of the call to
phi!
and pass it as a function argument (e.g.expcache
?). I tried this locally and such a change would remove most allocations:(unfortunately it does not affect times a lot)
The text was updated successfully, but these errors were encountered: