Repository navigation
Fix: Correct FusedMoE layer reference in auto_round quantization - #24818
Conversation
- Changed `layer.moe` to `layer` in AWQ MoE method - Changed `layer.moe` to `layer` in GPTQ MoE method - FusedMoE object doesn't have .moe attribute, should use layer directly This fixes AttributeError: 'FusedMoE' object has no attribute 'moe' when using "auto_round" quantization with FusedMoE layers." Signed-off-by: David-Wen <18927700430@163.com>
|
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run You ask your reviewers to trigger select CI tests on top of Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add If you have any questions, please reach out to us on Slack at https://slack.vllm.ai. 🚀 |
There was a problem hiding this comment.
Code Review
This pull request correctly identifies and fixes an AttributeError in auto_round.py for FusedMoE layers by removing the incorrect .moe attribute access. However, the fix introduces a new issue by passing the FusedMoE layer object directly to AWQMoEMethod and GPTQMarlinMoEMethod, which expect a FusedMoEConfig object according to their definitions and usage elsewhere in the codebase. My review includes suggestions to pass layer.moe_config instead, which ensures type correctness, improves code clarity, and maintains consistency with other parts of the vLLM framework.
|
The engine argument --kv-cache-dtype fp8 --calculate-kv-scales currently fails to work due to a conflict with Torch dynamo. Real Start command: |
yewentao256
left a comment
There was a problem hiding this comment.
Thanks for the fix! Could you also test on some of the other models to make sure this won't affect them?
Also, please also show the accuracy result using lm_eval
Okay, I will refine the information. |
|
Can confirm this changes work fine for |
Yes, I have confirmed that the model is runnable. I will submit the model testing data later. |
You can take a look at my updated model test results. |
I have added the test results of four models, including MMLU and GSM8K. |
yewentao256
left a comment
There was a problem hiding this comment.
LGTM, thanks for the work!
|
Can we merge this PR? |
mgoin
left a comment
There was a problem hiding this comment.
Doesn't this need to pass in layer.moe_config?
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Michael Goin <mgoin64@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Michael Goin <mgoin64@gmail.com>
I haven't tested the modification suggestions provided for Gemini Bot before, but after the recent testing, I confirmed that the modifications made to Gemini Bot are also usable. |
…m-project#24818) Signed-off-by: David-Wen <18927700430@163.com> Signed-off-by: Michael Goin <mgoin64@gmail.com> Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Co-authored-by: Michael Goin <mgoin64@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: charlifu <charlifu@amd.com>
) Signed-off-by: David-Wen <18927700430@163.com> Signed-off-by: Michael Goin <mgoin64@gmail.com> Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Co-authored-by: Michael Goin <mgoin64@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: yewentao256 <zhyanwentao@126.com>
…m-project#24818) Signed-off-by: David-Wen <18927700430@163.com> Signed-off-by: Michael Goin <mgoin64@gmail.com> Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Co-authored-by: Michael Goin <mgoin64@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…m-project#24818) Signed-off-by: David-Wen <18927700430@163.com> Signed-off-by: Michael Goin <mgoin64@gmail.com> Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Co-authored-by: Michael Goin <mgoin64@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…m-project#24818) Signed-off-by: David-Wen <18927700430@163.com> Signed-off-by: Michael Goin <mgoin64@gmail.com> Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Co-authored-by: Michael Goin <mgoin64@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…m-project#24818) Signed-off-by: David-Wen <18927700430@163.com> Signed-off-by: Michael Goin <mgoin64@gmail.com> Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Co-authored-by: Michael Goin <mgoin64@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…m-project#24818) Signed-off-by: David-Wen <18927700430@163.com> Signed-off-by: Michael Goin <mgoin64@gmail.com> Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Co-authored-by: Michael Goin <mgoin64@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: yewentao256 <zhyanwentao@126.com>
…m-project#24818) Signed-off-by: David-Wen <18927700430@163.com> Signed-off-by: Michael Goin <mgoin64@gmail.com> Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Co-authored-by: Michael Goin <mgoin64@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…m-project#24818) Signed-off-by: David-Wen <18927700430@163.com> Signed-off-by: Michael Goin <mgoin64@gmail.com> Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Co-authored-by: Michael Goin <mgoin64@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
layer.moetolayerin AWQ MoE methodlayer.moetolayerin GPTQ MoE methodThis fixes AttributeError: 'FusedMoE' object has no attribute 'moe' when using "auto_round" quantization with FusedMoE layers."
Purpose
To fix the issue #24803
Model:Qwen3-Next-80B-A3B-Instruct-int4-mixed AutoRound
Test Plan
Hardware: NVIDIA RTX PRO 6000 WorkStation 96G
vLLM version: v0.10.2(torch2.8+cu129)
Start Code:
export VLLM_ATTENTION_BACKEND=FLASHINFER vllm serve "/home/model/Qwen3-Next-80B-A3B-Instruct-AutoRound" --host 0.0.0.0 --port 3001 --gpu-memory-utilization 0.8 --served-model-name "qwen3" --quantization "auto-round" --dtype "bfloat16" --max-model-len 131072Test Result
Before:
info:
AttributeError: 'FusedMoE' object has no attribute 'moe' /root/miniconda3/envs/vllm/lib/python3.12/site-packages/vllm/model_executor/layers/quantization/auto_round.py", line 330After:
info:
Application startup completeModel Test
Qwen3-Next-80B-A3B-Instruct-AutoRound
GSM8K(limit 250)
MMLU(limit 250)
Qwen3-Coder-30B-A3B-Instruct-int4-AutoRound
GSM8K(limit 250)
MMLU(limit 250)
GLM-4.5-Air-AWQ-FP16Mix
GSM8K(limit 250)
Qwen3-32B-AWQ
GSM8K(limit 250)
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.