Repository navigation
perf: startup timing probes and env-gated startup optimizations - #310
OnePunchMonk wants to merge 4 commits into
Conversation
85605b1 to
749057e
Compare
|
Summary (2x H200, full MiniMax-H3, H3 t2va recipe, time from driver start to the first weight sync):
@Rockdu could you review these changes, and also take a look at OnePunchMonk/sglang#8? If the approach looks fine to you, I can open it as an upstream PR in sgl-project/sglang. |
|
Pushed 2ffa788:
CPU checks (benchmark image):
GPU check (2x H200, full MiniMax-H3, one cold run in a fresh container):
|
…nent interfaces The startup order stays as on main; each step gets cheaper. - Load engine weights with mmap instead of the RunAI streamer. - Keep sglang out of the processes that do not need it: cache sglang-d's CLI argument definitions for the driver (keyed on the installed sglang source, primed at image build), build ServerArgs in the sglang server process instead of the engine actor, defer module-level sglang imports in the rollout manager and engine actor, import the weight-sync helpers where the train actor builds its updater, and resolve fsdp_utils' exports lazily. - Create all train ranks at once; rank 0 still picks the rendezvous address. - Fill FSDP shards straight from the safetensors checkpoint, each rank reading only its dim-0 slice, for parameters that map 1:1 onto it; the rest is broadcast from rank 0 as before. Rank 0 spot-checks the filled slices, ranks agree on the files first, and any failure falls back to the full broadcast. Rank 0 no longer copies its own shard to the GPU before the broadcast. - --rollout-prespawn-schedulers (opt-in): start the sglang-d scheduler workers before the server process imports sglang, using sglang's register_prespawned_schedulers when it exists. - Bake .pyc files into the image.
2ffa788 to
a7b5f4e
Compare
…arded fill under LoRA
Add --startup-overlap {off,spawn,init} and --startup-keep-engines-resident. The driver starts the
rollout manager without waiting, creates (and with init, initialises) the train ranks while the
engines boot, then waits for both. Component interfaces are unchanged.
Fix the sharded checkpoint fill missing every parameter under PEFT: keys now drop the
base_model.model. prefix as well as .base_layer.
Also: startup timing probes, 0.5 s engine health poll.
|
Pushed 13306b7. Startup overlap now lives in the driver only, so no component takes another's handle.
Numbers (2x H200, full MiniMax-H3, H3 t2va recipe, warm page cache, driver start to the first weight sync):
Train init (122 s) is now fully hidden behind engine boot. The two runs were on different hosts and engine boot differed by 86 s, so the raw gap overstates it. Swapping in the faster boot for the serial run gives about 285 s vs 179 s, so about 106 s saved. One run each. The sync still fails on Modal ( |
Sets SGLANG_SKIP_P2P_CHECK=1 on the engines so sglang trusts the driver's P2P report instead of timing a copy between every GPU pair (about 21 to 28 s on a fresh container on 2x H200).
|
Pushed an opt-in 2x H200, full MiniMax-H3, H3 t2va recipe, warm page cache, driver start to the first weight sync,
About 18 s saved. The runs were on different hosts, so treat it as indicative. The P2P step it removes measured 21 to 28 s in the engine logs. If a machine reports P2P but it does not work, custom all-reduce could break, so it is worth one check on the target hardware. Things I tried that gave nothing:
Still not run: the first weight sync and train step (Modal blocks CUDA IPC). |
Drive the start-up order from one helper in placement_group.py (start_rollout_and_train) and leave the train actor and group as on main. Hand the engine server's args to its child as plain dicts instead of a filtered Namespace. Drop the scheduler prespawn path, which does nothing on the current sglang branch.
|
Pushed a cleanup so the start-up changes stay inside their components.
CPU tests: 496 passed, same 9 failures and 3 collection errors as before (H3 SFT encoder and weight bridge, not touched here). 2x H200 run with |
Cuts startup time to the first train step without changing any component's interface. Draft.
The startup order stays as on main (engines boot, then train init). The changes make each step cheaper:
--rollout-prespawn-schedulers(opt-in): start the sglang-d scheduler workers before the server process imports sglang, so both imports overlap. Needs sglang'sregister_prespawned_schedulers([diffusion] launch_server: accept pre-started scheduler workers OnePunchMonk/sglang#8, draft); without it the flag logs a warning and does nothing.Overlapping engine boot with train init gave the largest gain in the measurements, but it needs a hook in train init. That version is in OnePunchMonk#2 for reference. The full measurement history and experiment code are in OnePunchMonk#1.