Skip to content

Excessive Memory Allocations in AbstractMCMC Calls #410

@abhinavsns

Description

@abhinavsns

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions