Repository navigation
fix(rollout): wait up to --session-collect-timeout for a session's samples [fork fix-017] - #50
Merged
Merged
Conversation
…mples [fork fix-017] Collecting a finished session's training samples and deleting the session had a fixed 120 s bound. A timeout aborts the sample and the group filter drops the whole group. The new --session-collect-timeout (default 1,800 s) bounds both calls; it only has to catch a stuck server. Patch page: fork/patches/fix-017-session-collect-timeout.md Fork-Fix: fix-017 Touches: miles/rollout/generate_utils/openai_endpoint_utils.py, miles/utils/arguments.py, tests/fast/rollout/generate_utils/test_openai_endpoint_utils.py Evidence: a 3-node DeepSeek-V4.1-Flash overfit run lost 134 tries to "Failed collecting samples: TimeoutError" at 120 s, all during the trainer's optimizer phases; 15 groups dropped, the next step waited 29 min for its batch Upstream-Status: not filed Remove-When: upstream makes the collection bound configurable, or session servers stop sharing a node with the trainer's optimizer Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Fork-Infra: patch-fix-017 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.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.
Merge with rebase, not squash
Replaces #49 (same change, renumbered to fix-017 after review).
Outcome
Finished agent runs no longer get thrown away when the server holding their data is slow to hand it back. The trainer now waits up to 30 min (new flag
--session-collect-timeout) instead of a fixed 2 min.Words used below:
--session-collect-timeout, default 1,800 sIn that run, the 32 session servers ran on the head trainer node. Every one of the 134 timeouts landed while the trainer was running its optimizer step. The head node's optimizer step also took about 30% longer than the other trainer node's, so CPU contention on that node is the likely cause (inferred, not measured per process). All of those tries had finished normally. After this change, a slow session server costs a few minutes, not a whole group.
Patch page:
fork/patches/fix-017-session-collect-timeout.mdContract
--session-collect-timeout(float, seconds, default 1800). It bounds both the request for a finished session's samples and the session delete. Recipes don't need to set it.OpenAIEndpointTracer(..., collect_timeout=120)is a new keyword with the old value as its default, so direct constructions behave as before.OpenAIEndpointTracer.create(args)reads the argument.Side-effects
[fork fix-017]:miles/rollout/generate_utils/openai_endpoint_utils.py,miles/utils/arguments.py,tests/fast/rollout/generate_utils/test_openai_endpoint_utils.py.fork/patches/README.md; they merge cleanly in either order.Done
collect_samplesusesself.collect_timeoutfor both calls, andcreate()takes it fromargs.session_collect_timeout.--session-collect-timeoutin the session argument group.createreads the argument, and both calls get the bound.fork/patches/fix-017-session-collect-timeout.mdand its README row.Verification
python fork/tools/ledger.py check: ok.pre-commit run --from-ref c678bbd778 --to-ref HEAD: all hooks pass.pytest tests/fast/rollout/generate_utils/test_openai_endpoint_utils.py tests/fast/rollout/test_fully_async_rollout.py tests/fast/rollout/sessiongave 416 passed and 3 failed. Two failures aretest_session_server_benchmark[v1|v2], which also fail on main c678bbd in the same container. The third,test_post_buffer_no_retry_closes_stalled_body_connection[cancel], is a timing race that fails at random on main and on this branch alike (1 of 3 repeat runs failed on main, 0 of 3 here).create()sets nocollect_timeout(AttributeError), and the constructor rejectscollect_timeout(TypeError).Failed collecting sampleslines remain.