I noticed that the AbstractMCMC interface causes many memory allocations. It appears that each call to step reconstructs key objects, such as the Hamiltonian, integrator, adaptor, and state/transition objects, instead of reusing them.
Noticed most allocations in
|
# Make new transition. |
|
t = transition(rng, h, κ, t_old.z) |
This behavior contrasts with the direct AdvancedHMC approach, which reuses stateful objects and minimizes allocations.