Skip to content

[Qwen-moe] use npu_add_rms_norm_quant operator #2362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

s30076806
Copy link

@s30076806 s30076806 commented Aug 14, 2025

What this PR does / why we need it?

This PR the npu_add_rms_norm_quant operator is enabled

Does this PR introduce any user-facing change?

How was this patch tested?

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

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 an optimization for Qwen-MoE models on Ascend NPUs by utilizing the npu_add_rms_norm_quant fused operator. The changes are controlled by a new environment variable USE_ADD_RMSNORM_QUANT. The implementation correctly adds a conditional path to use this new operator when applicable.

However, I've identified a critical issue in the implementation of AddRMSNormW8A8Quant where the eps value from the model configuration is ignored due to an incorrect call to the superclass constructor. This will cause the layer to use a default epsilon, potentially leading to numerical inconsistencies and incorrect model outputs. Please see the detailed comment for the fix.

Copy link

👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:‌‌

  • A PR should do only one thing, smaller PRs enable faster reviews.
  • Every PR should include unit tests and end-to-end tests ‌to ensure it works and is not broken by other future PRs.
  • Write the commit message by fulfilling the PR description to help reviewer and future developers understand.

If CI fails, you can run linting and testing checks locally according Contributing and Testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants