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
simulate: AOT-compile blocks before solve to avoid contention
`simulate(...)` previously kicked off `compile_all_simulate_functions`
in a single-thread background executor and ran solve concurrently;
`_resolve_simulate_internal_regimes` then awaited the future at the
state-action-space dispatch point. With realistic worker counts the
parallel XLA compile pool stayed busy through a substantial chunk of
the backward-induction loop, contending for CPU and XLA front-end
resources and stretching mid-loop ages by an order of magnitude.
Drop the future / executor entirely. simulate() now calls
compile_all_simulate_functions inline before _solve_compiled, so the
entire AOT compile (including its own internal worker pool) finishes
before backward induction starts. Same total compile work; predictable
timing; lower transient host-RAM peak because the AOT pool's
intermediate Lowered objects are released before solve allocates its
per-period V buffers.
_resolve_simulate_internal_regimes loses its compile_future parameter
and only consults the cache. _spawn_simulate_compile is gone, as are
the `Future` and `ThreadPoolExecutor` imports.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments