jaxrens.sampling.inter_re_manager¶
InterREManager: orchestrates inter-replica-exchange swap passes.
One swap pass fires after each ns_step call in _run_loop when configured.
The manager is descriptor-aware:
SingleRun:applyis a no-op (returns state unchanged with zero stats).VmapRuns: operates on(n_runs, K, ...)directly viareplica_exchange_step.PmapVmapRuns: useslax.all_gather(axis_name="gpu")to replicate the population across devices, swaps on each device’s identical view (same RNG = same swap decisions), then re-shards by slicing the device’s own offset. Forn_gpu=1the all_gather is a no-op (zero extra cost).
Design: built once at construction time, JIT’d swap step cached; _run_loop
calls fires(i) / apply(state, key) at each iteration.
The manager is flavor-agnostic. It hands the population to
replica_exchange_step() as a
SwapWalker pytree, plus the
per-run ensemble params the kernel declares in param_keys.
Classes
Manages inter-replica-exchange swap passes in the NS outer loop. |
|
Public return type of |