Repository navigation
Conversation
Retire routed-reference holders without forcing shared Ray objects free; preserve pixel cleanup and reject out-of-band serialized vLLM ObjectRefs. Exercise actual TrainBatch materialization and release across remote consumers, repeated passes and final holder retirement.
2026-11-09 new-main compatibility checkValidated this PR independently against fixed upstream main Focused targets:
Result: 100 passed, pytest exit 0. Python 3.12.12, Torch 2.10.0, Ray 2.56.1, Transformers 5.17.0, existing LMDeploy 0.18.0 environment. This does not validate main's all-extra Ray 2.58.0 environment. ProduceBatchResult impact: batch lifecycle and ref-sharing tests pass; no new field changes in this refresh. RoutedExperts impact: checks exercise shared XTuner ref ownership and cleanup after transfer; they do not establish live LMDeploy transfer behavior. Ray concurrency impact: local tests are not cluster load validation. These are targeted CPU/local-runtime checks, not a full-suite, GPU/PPO performance or CI-green claim. The unit-test check for this head was cancelled at the status inspection; cancellation is not a pass. Existing draft/readiness status is unchanged. |
|
Closing: the shared routed-expert lifetime problem this PR addressed is now solved on main by #2297 ( |
Independently based on
mainatc93eb15dc0b1e4fd371b33d79bec9e1321fe20f2, after the PPO stack merged. This preserves the fix from #2243, which was closed without merging whenstack/rl-ppowas deleted.Root Cause
Routed-expert Ray ObjectRefs are shared by partial rollouts, trace sessions, sibling samples, and repeated training passes. Explicitly freeing one holder's shared object invalidates other consumers. TrainBatch ownership does not make trainer/trace-store force-free safe.
Fix
ProduceBatchResult impact: not affected; sample status, reward, and batch accounting are unchanged.
RoutedExperts impact: after transfer from LMDeploy, XTuner drops only each retiring holder; shared data remains readable until the final holder retires. Pre-transfer LMDeploy cleanup is unchanged.
Ray concurrency impact: dispatch groups and scheduling are unchanged; no blocking actor RPC or new concurrency lane.
Test Plan — main-based head
tests/rl/test_routed_experts_lifetime.py,test_trace_store.py,test_train_batch_contract.py, andtest_rollout_logic.pyin the development container.pre-commit run --all-filesexecuted: mypy passed on 430 source files; overall failure remains due to upstreamautotestformatting/import-order violations. Unrelated formatter edits were not retained.