feat: add scalable colocated online training - #766
Draft
maocheng23 wants to merge 2 commits into
Draft
Conversation
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
SpecForge online training currently requires a disaggregated producer/consumer topology even when target capture and draft training fit on the same accelerator. That adds feature serialization, transport, and a second GPU pool, and makes target-feature locality difficult for K3-class multi-node jobs.
This draft adds a bounded colocated path: every trainer rank owns its local SGLang target shard and FSDP draft shard, captures on demand, trains its rank-local feature slice, and releases it before the next capture.
Modifications
deployment.mode: local_colocatedvalidation and launch planning for online SGLang capture.LocalRolloutStream, local capture adapter, packed variable-length capture, TP-local slicing, and zero-copy feature loading.HYBRID_SHARDsupport using target-TP as the FSDP shard group and target-DP as the replica group. Loss/metric reductions remain WORLD-wide and gradient norm counts each shard once.Related Issues
No linked issue.
Accuracy Test
NoValidChoicesError.273 passed, 7 skipped, 501 subtests passed.Benchmark & Profiling
Environment: Qwen3-8B, DSpark, BF16, SGLang 0.5.14 local capture, FSDP
SHARD_GRAD_OP, batch size 1/rank, 4x H200, 90 optimizer steps, 360 global samples, variable lengths up to 3911 tokens.The historical repository experiment measured 23.85 samples/s for an 8x H200 colocated run, but it used a different GPU count and sample window; that number is directional context, not a direct speedup claim for this PR.
Checklist
black --checkandisort --check-only).