fix(lora): let a resumed disaggregated run reach the rollout engine - #2708
Open
Arist12 wants to merge 3 commits into
Open
fix(lora): let a resumed disaggregated run reach the rollout engine#2708Arist12 wants to merge 3 commits into
Arist12 wants to merge 3 commits into
Conversation
Resuming a disaggregated LoRA run with --lora-adapter-path fails in two places, so the save/resume pair only ever worked colocated. SGLang is asked to preload the adapter directory whenever the flag is set. The "dummy base load" escape hatch never fires, because nothing sets MILES_SGLANG_DUMMY_LOAD=1. A LoRA checkpoint does not always contain an adapter_config.json: the HF PEFT export is best-effort and Bridge declines some MoE adapter layouts, leaving only the Megatron-native shards that the trainer resumes from. The engine then aborts at startup on the missing file. Preload only a directory SGLang can read; the adapter still arrives through the weight sync that train.py and train_async.py both run before the first rollout, carrying its own config_dict. When the preload does succeed, the distributed updater starts with _lora_loaded=False and skips the unload, but its load is not an upsert, so SGLang rejects the duplicate adapter name on the first sync. Always attempt the unload and tolerate its absence, matching UpdateWeightFromTensor.
Arist12
requested review from
Shi-Dong,
Zhichenzzz,
fzyzcjy,
maocheng23,
yueming-yuan and
yushengsu-thu
as code owners
August 22, 2026 00:15
Use SGLang's existing upsert contract so fresh and preloaded adapters follow one path without failed unloads or repeated slot churn.
Use the mandatory initial trainer publish as the single startup path so partial PEFT exports and native-only checkpoints cannot diverge before the first rollout.
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.
Part of #2705.
Problem
A disaggregated LoRA run resumed with
--lora-adapter-pathcan fail before its first rollout: native-only checkpoints cannot be preloaded by SGLang, partial best-effort PEFT output can look preloadable, and a preloaded adapter collides with the mandatory initial publish.Change
Normal train drivers start resumed rollout engines from the base model and let the mandatory initial weight publish install the trainer's restored adapter. Publish single LoRA adapters with SGLang's existing
upsert=Truecontract so fresh startup and later refreshes use one path without unload churn.--debug-rollout-only, which skips the publish, remains a blocker before this PR is ready.Validation
384tensors each), optimizer, scheduler and global-dataset cursor fromiter_29; continued at rollout 30, completed two optimizer steps, savediter_30, and republished the trained adapter (grad_norm=0.0152, train/rollout abs diff0.0210-0.0237)iter_4anditer_14, restored288tensors plus optimizer/scheduler/data cursor, and completed throughiter_290.711 → 0.789, truncation0.211 → 0.078; train/rollout abs diff mean0.01265, max0.01419