Skip to content

feat(peft): expand_shared_outer export flag for shared-outer MoE LoRA - #5588

Merged
adityavavreNVDA merged 4 commits into
NVIDIA-NeMo:mainfrom
HollowMan6:expand_shared_outer
Aug 20, 2026
Merged

adityavavreNVDA merged 4 commits into
NVIDIA-NeMo:mainfrom
HollowMan6:expand_shared_outer

Conversation

@HollowMan6

@HollowMan6 HollowMan6 commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do ?

Related to #3958

Shared-outer MoE LoRA exports the shared adapter side as a single [1, ...] tensor under an expert-agnostic name (SGLang contract). vLLM's 2D pack_moe path for text MoE models expects per-expert 2D tensors, so it can't find the shared factor and crashes at lora.optimize() (lora_b is None). So this PR adds expand_shared_outer to the adapter export path. When set, the shared 2D factor is replicated under per-expert 2D names (reused, not cloned); training keeps the shared parameter. Default False preserves the existing layout.

Changelog

  • adds expand_shared_outer param with logics

GitHub Actions CI

See the CI section in the Contributing doc for how to trigger the CI. A Nvidia developer will need to approve and trigger the CI for external contributors.

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

If you haven't finished some of the above items you can still open "Draft" PR.

Additional Information

  • Related to # (issue)

✨ Presented to you with Mind Lab - A Lab for Experiential Intelligence.

Shared-outer MoE LoRA exports the shared adapter side as a single `[1, ...]`
tensor under an expert-agnostic name (SGLang contract). vLLM's 2D `pack_moe`
path for text MoE models expects per-expert 2D tensors, so it can't find the
shared factor and crashes at `lora.optimize()` (`lora_b is None`). So this PR adds
`expand_shared_outer` to the adapter export path. When set, the shared 2D
factor is replicated under per-expert 2D names (reused, not cloned); training
keeps the shared parameter. Default `False` preserves the existing layout.

Signed-off-by: Hollow Man <hollowman@opensuse.org>
Copilot AI lite review requested due to automatic review settings August 14, 2026 21:55
@copy-pr-bot

copy-pr-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

yaoyu-33
yaoyu-33 previously approved these changes Aug 14, 2026
@yaoyu-33 yaoyu-33 added area:peft Parameter-efficient fine-tuning (LoRA, adapters) feature New capabilities, enhancements, or enablement work needs-more-tests Requires additional L0 and L1 test coverage before merge ready-to-merge PR is approved, current, and only waiting for CI to pass before merge labels Aug 14, 2026
@kamran-nvidia

Copy link
Copy Markdown
Contributor

/ok to test 4ce1b2c

@kamran-nvidia

Copy link
Copy Markdown
Contributor

@HollowMan6 Please check the CI failures

Signed-off-by: Hollow Man <hollowman@opensuse.org>
@HollowMan6

Copy link
Copy Markdown
Contributor Author

@kamran-nvidia Fixed, also make expand_shared_outer configurable at more places and add more test cases

@HollowMan6
HollowMan6 requested a review from yaoyu-33 August 17, 2026 22:54
@kamran-nvidia

Copy link
Copy Markdown
Contributor

/ok to test 09f6355

@adityavavreNVDA
adityavavreNVDA merged commit a95a3da into NVIDIA-NeMo:main Aug 20, 2026
95 checks passed

This branch was previously deployed

2 inactive deployments
public — 09f63550 Deployed Aug 18, 2026 by copy-pr-bot[bot] via release / finalize / publish-docs #4701
test — 09f63550 Deployed Aug 17, 2026 by copy-pr-bot[bot] via cicd-wait-in-queue #20676
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:peft Parameter-efficient fine-tuning (LoRA, adapters) community-request feature New capabilities, enhancements, or enablement work needs-more-tests Requires additional L0 and L1 test coverage before merge ready-to-merge PR is approved, current, and only waiting for CI to pass before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants