Repository navigation
Add native routed expert LoRA slots and independent expert factors - #47
Merged
kailash109 merged 2 commits intoNov 17, 2026
Merged
Conversation
Native LoRA adapted Qwen3.5/3.6 MoE's attention, Gated DeltaNet and shared expert, but not its routed experts. The shared-outer grouped-expert spec Inkling and Kimi K3 use attaches to Megatron's grouped experts of any model; only how targets name the experts was theirs. GroupedExpertsSpec now names the expert leaves the converter gives (w1/w3/w2) and whether targets name one expert, and the adapters export under those leaves. PackedGroupedExpertsSpec covers HF models that pack their experts in experts.gate_up_proj and experts.down_proj, with gate_proj/up_proj/down_proj leaves, as Qwen3.5/3.6 MoE does. A spec without a fixed target layout gives the pattern its expert targets sit under, so the target check accepts them. --experts-shared-outer-loras and --expert-tensor-parallel-size 1 are required only once the targets reach the routed experts (a fixed layout always does), so attention-only Qwen3.5/3.6 MoE runs work as before.
This was referenced Nov 17, 2026
kailash109
marked this pull request as ready for review
November 17, 2026 22:12
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.
Native multi-LoRA previously rejected routed experts because slots assumed contiguous token ranges. Carry slot IDs through Megatron's all-to-all dispatcher and apply each adapter to its expert-major rows. Support independent factors per expert and the existing shared-outer layout, mask padded ranks along the correct 3-D tensor axes, and freeze shared router bias using the same helper as Bridge.
This is the first half of the split of #46. It contains the generic expert implementation and its gated/ungated tests, without Nemotron model registration, model provider, or checkpoint conversion. The separate Nemotron Nano PR #48 depends on this branch. Merge this PR first; then retarget #48 to
spindle-miles-v0.2.0. GPT-OSS is unchanged.Validation:
The Nano full-model score-repeatability failure from #46 is tracked on the separate Nano PR; it is not presented as a passing end-to-end result for this generic change. Generated results are excluded.
CI timing:
tests/fast-gpu/test_lora_native_experts.pyusesstage-b-2-gpu-h200,num_gpus=2,est_time=180as an upper bound. The development timing above was measured on Modal; registered CI runner timing remains unmeasured. No shared CI rerun has been requested.