[sglang-miles] Warn instead of silently dropping one-sided MoE expert LoRA targets - #32376
Merged
yushengsu-thu merged 1 commit intoJul 25, 2026
Conversation
yushengsu-thu
requested review from
Fridge003,
Ying1123,
jybsuper and
lifuhuang
as code owners
July 25, 2026 03:21
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Collaborator
Author
|
Verified on an 8x H200 devbox with this branch editable-installed:
The wrap/skip decision itself is unchanged by this PR — the two reachable states (both expert projections targeted → |
… LoRA targets A FusedMoE layer is only wrapped when both gate_up_proj and down_proj are in the target modules, because the MoE-LoRA hooks inject a delta after gate_up and after down together. When only one of them was targeted the layer stayed unwrapped with no diagnostic, so an adapter carrying expert weights for the targeted projection had them loaded into the memory pool and then never applied — a serving/training mismatch with no symptom. Emit a one-shot warning naming the module and the missing projection. Adapters that only train the dense or shared-expert MLP keep working, so this stays a warning rather than a startup error. Also drop the redundant target-module re-check in update_lora_info: a FusedMoEWithLoRA only exists when init_lora_modules already found both projections targeted.
yushengsu-thu
force-pushed
the
moe-lora-one-sided-targets
branch
from
July 25, 2026 18:45
70cbe21 to
f552db9
Compare
This was referenced Jul 25, 2026
yushengsu-thu
merged commit Jul 25, 2026
da05e95
into
sgl-project:sglang-miles
69 of 79 checks passed
2 tasks
yueming-yuan
pushed a commit
that referenced
this pull request
Jul 29, 2026
… LoRA targets (#32376) Carried onto v0.5.16. The target-module gate is kept as-is: v0.5.16 added an is_shared_fused_moe arm to the FusedMoEWithLoRA branch, and dropping the redundant re-check there (as the original commit did) would let a shared-MoE module through unchecked, which is beyond this fix's intent.
yueming-yuan
pushed a commit
that referenced
this pull request
Aug 25, 2026
…E expert LoRA targets (#32376)
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
A
FusedMoElayer is only wrapped with LoRA when bothgate_up_projanddown_projare in the target modules, because the MoE-LoRA hooks inject the two deltas together. Targeting only one left the layer unwrapped with no diagnostic: the adapter's expert weights for the targeted projection were loaded into the memory pool but never applied. For RL rollouts that means the serving policy silently diverges from the trained one.Modifications
update_lora_info— aFusedMoEWithLoRAonly exists wheninit_lora_modulesalready found both projections targeted.No behavioural change beyond the log line; no accuracy or performance impact.
Checklist
🤖 Generated with Claude Code
CI States
Latest PR Test (Base): ❌ Run #30170262739
Latest PR Test (Extra): ❌ Run #30170262678