fix(reassessment): stay serial on low-core hosts; release 0.2.7.post1#113
Merged
Merged
Conversation
The parallel per-action reassessment (0.2.6) clones the whole network per worker (save/load_from_binary_buffer + SimulationEnvironment + observation build) — a fixed overhead the serial path never pays, only amortized above ~3-4 usable cores. On a 2-vCPU host (e.g. a small HuggingFace Space) the two clones + GIL contention on the Python-side observation build make the parallel path SLOWER than serial (observed ~42 s vs ~9 s on a many-core Mac for the same 15-action pan-European case). Parallel reassessment is now gated behind `min(10, cores, n_actions) >= EXPERT_OP4GRID_MIN_PARALLEL_REASSESS_WORKERS` (default 4, floored at 2, env-tunable): 2-vCPU deployments fall back to the faster serial path, >=4-core hosts keep the speed-up. Behaviour-preserving — only which path runs changes, not the per-action results. Adds tests/test_reassessment_parallel_gate.py (16 tests) for the decision + env override. Bumps version to 0.2.7.post1 (CHANGELOG entry). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGzwaP2SnQCbLKo4ZNuwSg Signed-off-by: Antoine Marot <amarot91@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The parallel per-action reassessment (0.2.6) clones the whole network per worker (save/load_from_binary_buffer + SimulationEnvironment + observation build) — a fixed overhead the serial path never pays, only amortized above ~3-4 usable cores. On a 2-vCPU host (e.g. a small HuggingFace Space) the two clones + GIL contention on the Python-side observation build make the parallel path SLOWER than serial (observed ~42 s vs ~9 s on a many-core Mac for the same 15-action pan-European case).
Parallel reassessment is now gated behind
min(10, cores, n_actions) >= EXPERT_OP4GRID_MIN_PARALLEL_REASSESS_WORKERS(default 4, floored at 2, env-tunable): 2-vCPU deployments fall back to the faster serial path, >=4-core hosts keep the speed-up. Behaviour-preserving — only which path runs changes, not the per-action results.Adds tests/test_reassessment_parallel_gate.py (16 tests) for the decision + env override. Bumps version to 0.2.7.post1 (CHANGELOG entry).
Claude-Session: https://claude.ai/code/session_01LGzwaP2SnQCbLKo4ZNuwSg