Skip to content

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

Open
HollowMan6 wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
HollowMan6:expand_shared_outer
Open

feat(peft): expand_shared_outer export flag for shared-outer MoE LoRA#5588
HollowMan6 wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
HollowMan6:expand_shared_outer

Conversation

@HollowMan6

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)

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 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
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.

3 participants