Repository navigation
Conversation
Keep timed-out request IDs pending after the HTTP lease exits. Confirm backend stop at offload and preserve trace ownership for retained samples.
This was referenced Dec 4, 2026
Collaborator
Author
|
The HTTP timeout barrier patch is now Layer 1 of the same-repository Mini-Agent stack. Closing this fork PR in favor of #2381. |
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.
Motivation
An upstream HTTP forwarding timeout can end the local request while LMDeploy is still generating. Treating that request as an unknown failure blocks the whole cross-weight-update barrier. This is a simpler alternative to #2332. It lets healthy requests finish and commit their traces, then uses the ordinary pause and offload sequence to confirm that remaining inference has stopped.
Changes
request_gate.py,session_server.py,worker.pydistinguish a connector-confirmed timeout before send from a timeout during forwarding. The latter releases the HTTP lease but keeps the original request ID pending under its SID. The gate rejects reuse of that SID until backend stop is confirmed. This path requires LMDeploy PyTorch and a fixed entrypoint or session affinity.controller.py,cross_weight_update_rollout.py,lmdeploy.pydrain healthy requests before pausing and require successful ordinary offload across the fixed worker cohort before weight loading. A failed offload keeps admission sealed. Publication follows successful weight and KV reload.sandbox_agent_loop/agent_in_sandbox_loop.pyreleases orphaned traces from mixed groups and preserves the traces and routed-expert references owned by retained samples. CPU regression tests cover these paths and both trainer modes.Validation
Run in
pt29_glm2withCUDA_VISIBLE_DEVICES=''. The HTTP integration tests use loopback inference and management endpoints, the actual XTuner LMDeploy adapter, and a CPU Ray trace store.python -B -m pytest -ra tests/rl/{test_request_gate,test_session_server_cross_weight_update_rollout,test_session_server_trace,test_session_server_endpoints,test_rollout_request_barrier,test_rollout_forward_timeout_offload}.py python -B -m pytest -ra tests/rl/{test_rollout_logic,test_rollout_config_dist_port_base_patch,test_affinity_port_integration,test_affinity_router,test_trace_store_turn_provenance,test_rollout_state_training,test_rollout_teacher_scorer,test_rollout_to_train_item,test_lmdeploy_trust_remote_code,test_agent_loop_localhost,test_single_turn_agent_loop}.py python -B -m pytest -ra tests/rl/{test_agent_loop_timeout_training,test_agent_loop_manager_checkpoint,test_rl_colocate_trainer,test_rl_disaggregated_trainer,test_rl_trainer_checkpoint}.pyAll 268 CPU tests passed across the three groups (69, 143, and 56).
ruff check,ruff format --check,git diff --check, and the applicable pre-commit hooks passed, including mypy. The unmodified repository-wide Pydantic hook tries to initialize CUDA while importing RMSNorm, which also fails on upstream main with devices hidden. The schema scan passed on CPU with that CUDA-only import excluded.