Skip to content

[WIP] Add explicit LinearExperts2D -> 3D MoE repack for HF-native saves - #3017

Open
GOavi101 wants to merge 2 commits into
vllm-project:mainfrom
GOavi101:feat/moe-explicit-repack
Open

[WIP] Add explicit LinearExperts2D -> 3D MoE repack for HF-native saves#3017
GOavi101 wants to merge 2 commits into
vllm-project:mainfrom
GOavi101:feat/moe-explicit-repack

Conversation

@GOavi101

@GOavi101 GOavi101 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Restore fused expert modules (weights + weight_* qparams) before save_pretrained so architectures like qwen3_vl_moe can reload without relying on transformers one-to-many WeightConverter support (#2699).

Restore fused expert modules (weights + weight_* qparams) before
save_pretrained so architectures like qwen3_vl_moe can reload without
relying on transformers one-to-many WeightConverter support (vllm-project#2699).

Signed-off-by: Avishek Goswami <avishek.goswami@ibm.com>
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Ignore keyword(s) in the title.

⛔ Ignored keywords (3)
  • WIP
  • DO NOT MERGE
  • DRAFT

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: fbd93405-a4e2-4eee-a70d-11035146b93d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mergify mergify Bot added the two-reviews When a PR requires two reviews label Aug 11, 2026
@mergify

mergify Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 2 of 2 protections blocking · waiting on 👀 reviews

Protection Waiting on
🔴 Require one maintainer review 👀 reviews
🔴 Require two reviews 👀 reviews

🔴 Require one maintainer review

Waiting for any of

  • approved-reviews-by=HDCharles
  • approved-reviews-by=brian-dellabetta
  • approved-reviews-by=dsikka
  • approved-reviews-by=kylesayrs
  • approved-reviews-by=yiliu30
This rule is failing.

All PRs must have at least one approving review from a maintainer before merging.

  • any of:
    • approved-reviews-by=HDCharles
    • approved-reviews-by=brian-dellabetta
    • approved-reviews-by=dsikka
    • approved-reviews-by=kylesayrs
    • approved-reviews-by=yiliu30
  • #changes-requested-reviews-by = 0

🔴 Require two reviews

Waiting for

  • #approved-reviews-by >= 2
This rule is failing.

PRs labelled "two-reviews" must have at least two approving reviews before merging.

  • #approved-reviews-by >= 2
  • #changes-requested-reviews-by = 0

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces a mechanism to repack linearized 2D experts back into native fused 3D expert modules, enabling compatibility with Hugging Face's native key layout during model saving. Key feedback includes ensuring the newly initialized fused module is moved to the correct device and dtype to prevent device mismatch errors, avoiding direct modifications to .data in favor of PyTorch's .copy_() for safer in-place copying, and validating quantization parameters across all experts rather than just the first to prevent silent failures.

Comment thread src/llmcompressor/modeling/moe/linear_experts.py
Comment thread src/llmcompressor/modeling/moe/linear_experts.py Outdated
Comment thread src/llmcompressor/modeling/moe/linear_experts.py Outdated
Comment thread src/llmcompressor/modeling/moe/linear_experts.py
Move fused experts to the linearized module device/dtype before packing,
use in-place copy_() instead of .data assignment, and require all experts
to have a qparam before packing it.

Signed-off-by: Avishek Goswami <avishek.goswami@ibm.com>
@github-actions

Copy link
Copy Markdown

👋 Hi! Thank you for contributing to llm-compressor. Please add the ready label when the PR is ready for review.

Note: This is required to complete the testing suite, please only add the label once the PR is code complete and local testing has been performed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

two-reviews When a PR requires two reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant