-
Notifications
You must be signed in to change notification settings - Fork 389
[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
Conversation
There was a problem hiding this 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.
9b07cda
to
a708ebc
Compare
👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:
If CI fails, you can run linting and testing checks locally according Contributing and Testing. |
Signed-off-by: s30076806 <[email protected]>
a708ebc
to
ddb0641
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
"Expected quant_config to be an instance of AscendQuantConfig" | ||
if isinstance(self.self_attn.qkv_proj.quant_method.quant_method, | ||
AscendW8A8LinearMethod): | ||
self.input_layernorm = AddRMSNormW8A8Quant( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will use the torch.fx
rewriter to solve this kind of problem.
Please refer #2389
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?