Skip to content

Conversation

@menogrey
Copy link
Contributor

@menogrey menogrey commented Nov 20, 2025

What this PR does / why we need it?

Add AWQ quantization in vllm-ascend. Most of the code refer to sglang implement: sgl-project/sglang#10158 , and new quantization adaptation refer to compressed tensor: #4036 .

Does this PR introduce any user-facing change?

How was this patch tested?

@menogrey menogrey marked this pull request as draft November 20, 2025 13:12
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 support for AWQ quantization in vllm-ascend. The changes are well-structured, adding the necessary configurations and Ascend-specific implementations for AWQ, including linear and MoE layers. A key improvement is the added robustness in AscendRMSNorm to handle different quantization configurations without crashing. My review has identified a couple of redundant function calls within the new npu_fused_experts function that should be removed to improve performance.

# gmm1: gate_up_proj
hidden_states, pertoken_scale = torch_npu.npu_dynamic_quant(hidden_states)
if not use_wna16:
hidden_states, pertoken_scale = torch_npu.npu_dynamic_quant(hidden_states)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The call to torch_npu.npu_dynamic_quant() on this line is redundant, as it's already been called unconditionally on line 79. This duplicate call is unnecessary and negatively impacts performance. It should be removed. A similar issue is present on line 108.

hidden_states = torch_npu.npu_swiglu(hidden_states)
hidden_states, pertoken_scale = torch_npu.npu_dynamic_quant(hidden_states)
if not use_wna16:
hidden_states, pertoken_scale = torch_npu.npu_dynamic_quant(hidden_states)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Similar to the issue on line 81, this call to torch_npu.npu_dynamic_quant() is redundant because it was already called on line 106. Please remove this unnecessary duplicate call to avoid performance degradation.

@github-actions
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.

@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@MengqingCao
Copy link
Collaborator

@paulyu12 this pr implement AWQ quantization, and now it is under testing, just at you to take a look

@menogrey
Copy link
Contributor Author

Validation on this issue #4378

@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@wangxiyuan
Copy link
Collaborator

Please rebase to main now.

Signed-off-by: menogrey <1299267905@qq.com>
DeepSeek-V3.1-AWQ.

Signed-off-by: menogrey <1299267905@qq.com>
Signed-off-by: menogrey <1299267905@qq.com>
Signed-off-by: menogrey <1299267905@qq.com>
Signed-off-by: menogrey <1299267905@qq.com>
Signed-off-by: menogrey <1299267905@qq.com>
Signed-off-by: menogrey <1299267905@qq.com>
Signed-off-by: menogrey <1299267905@qq.com>
Signed-off-by: menogrey <1299267905@qq.com>
Signed-off-by: menogrey <1299267905@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants