[sglang-miles] Allow load_lora_adapter_from_distributed under dp attention - #32421
Merged
yushengsu-thu merged 1 commit intoJul 26, 2026
Conversation
…ntion load_lora_adapter_from_distributed was the only LoRA update endpoint still asserting dp_size == 1: load_lora_adapter, load_lora_adapter_from_tensors and unload were all relaxed to "dp_size == 1 or dp attention enabled", as was update_weights_from_distributed for base weights. All four LoRA routes share update_lora_adapter_communicator, and the weight-update NCCL group covers every dp-attention rank, so the stale assert blocked the one route that supports upsert — the disaggregated RL weight-sync path — on any dp-attention serving config (GLM-5.2's standard recipe among them). Colocate single-LoRA runs never hit it because they load from tensors. Verified by a GLM-5.2_5layer multi-LoRA e2e (2 engines, dp-attention ep=dp=2): both DP ranks of both engines receive the initial load and the per-step upserts (3 rounds, all 200 OK) and the run completes 3 training steps end-to-end. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
yushengsu-thu
requested review from
Ying1123,
hnyls2002,
merrymercy and
xiezhq-hermann
as code owners
July 26, 2026 04:32
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
This was referenced Jul 26, 2026
Merged
yushengsu-thu
merged commit Jul 26, 2026
d218d6c
into
sgl-project:sglang-miles
69 of 79 checks passed
5 tasks
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
load_lora_adapter_from_distributedwas the only LoRA update endpoint still assertingdp_size == 1. Its three siblings —load_lora_adapter,load_lora_adapter_from_tensors,unload_lora_adapter— were all relaxed todp_size == 1 or dp attention must be enabled, as wasupdate_weights_from_distributedfor base weights.The stale assert blocked the one route that supports upsert (the disaggregated RL weight-sync path) on every dp-attention serving config — GLM-5.2's standard recipe (
--enable-dp-attention --dp-size Nwith NSA attention) among them. Colocate single-LoRA runs never hit it because they load adapters from tensors; disaggregated multi-LoRA dies at the first slot load.Modifications
Relax the assert to match the sibling endpoints:
dp_size == 1 or enable_dp_attention. All four LoRA routes shareupdate_lora_adapter_communicatorfor the tokenizer→scheduler broadcast, and the weight-update NCCL group already covers every dp-attention rank (the same topologyupdate_weights_from_distributedrelies on), so no other change is needed.Accuracy Test
Verified by a GLM-5.2_5layer multi-LoRA e2e (miles, disaggregated 4 train + 4 rollout GPUs, 2 engines with dp-attention
ep=dp=2): both DP ranks of both engines receive the initial slot load and the per-step upserts (3 rounds, all200 OK), and the run completes 3 training steps end-to-end with correct rollouts.Benchmarking and Profiling
No performance impact — one assert condition at the endpoint entry.
Checklist
test_lora_upsert.pycontinues to cover the dp_size=1 path.🤖 Generated with Claude Code
CI States
Latest PR Test (Base): ❌ Run #30187943315
Latest PR Test (Extra): ❌ Run #30187943137