Skip to content

Conversation

s-jiayang
Copy link
Contributor

@s-jiayang s-jiayang commented Aug 14, 2025

What this PR does / why we need it?

Integrate the arange operator to reduce the time spent and improve performance

Does this PR introduce any user-facing change?

No

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 refactors the creation of row_idx for MoE operations by centralizing the torch.arange call within the select_experts function. This improves code structure by removing redundant code from several expert fusion functions. The changes affect both unquantized and quantized MoE paths, and the necessary function signatures have been updated accordingly. I've found a critical syntax error in the w4a8 dynamic quantization path that needs to be fixed.

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.

@s-jiayang
Copy link
Contributor Author

I mentioned this pr very early, and has been verified locally, and no error is reported. In order to resolve the conflict of the previous integration, the pr was re-mentioned.

@s-jiayang s-jiayang force-pushed the remove_arange branch 2 times, most recently from a23e811 to c466592 Compare August 19, 2025 08:37
@s-jiayang s-jiayang force-pushed the remove_arange branch 5 times, most recently from 0cd1812 to 7da13fc Compare August 25, 2025 06:11
Copy link

codecov bot commented Aug 25, 2025

Codecov Report

❌ Patch coverage is 89.28571% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.96%. Comparing base (b3fdd78) to head (8c475f9).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
vllm_ascend/ops/common_fused_moe.py 0.00% 1 Missing ⚠️
vllm_ascend/quantization/w4a8_dynamic.py 0.00% 1 Missing ⚠️
vllm_ascend/quantization/w8a8_dynamic.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2373      +/-   ##
==========================================
+ Coverage   77.93%   77.96%   +0.02%     
==========================================
  Files         134      134              
  Lines       18504    18499       -5     
==========================================
+ Hits        14422    14423       +1     
+ Misses       4082     4076       -6     
Flag Coverage Δ
unittests 77.96% <89.28%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@wangxiyuan wangxiyuan merged commit 6a4ec18 into vllm-project:main Aug 27, 2025
36 of 39 checks passed
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