Skip to content

Conversation

lilinsiman
Copy link
Contributor

@lilinsiman lilinsiman commented Aug 13, 2025

[Bugfix]Support Qwen3-MOE on aclgraph mode in sizes capture and add new ut

What this PR does / why we need it?

This PR solves the problem of sizes capture and stream error caused by using ACLgraph on the Qwen3-30B MOE model.
Add new ut.

Does this PR introduce any user-facing change?

no

How was this patch tested?

ut

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.

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 addresses an issue with sizes capture for the Qwen3-MOE model in aclgraph mode and adds new unit tests to cover this scenario. The changes in vllm_ascend/utils.py adjust the calculation for maximum batch sizes based on the HCCL_OP_EXPANSION_MODE environment variable. My review focuses on improving the new tests for better isolation and enhancing the readability and maintainability of the calculation logic by addressing magic numbers and style issues. The proposed changes will make the tests more robust and the code easier to understand.

@lilinsiman lilinsiman force-pushed the main branch 4 times, most recently from 4414d64 to a84e9a6 Compare August 21, 2025 06:58
(num_hidden_layers + 1) / parallel_factor)
logger.info("Calculated maximum supported batch sizes for ACL graph: %s",
max_num_batch_sizes)
if envs.HCCL_OP_EXPANSION_MODE == 'AIV':
Copy link
Collaborator

Choose a reason for hiding this comment

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

@MengqingCao
Copy link
Collaborator

I think this also fix #2229

@@ -55,6 +55,9 @@
# Please make sure that the version is correct.
"SOC_VERSION":
lambda: os.getenv("SOC_VERSION", "ASCEND910B1"),
# location for orchestrated deployment of communication algorithms.
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is a env from HCCL, we should not add it in vllm-ascend. we can set it in docker file and mention it in doc.

Copy link

codecov bot commented Aug 22, 2025

Codecov Report

❌ Patch coverage is 62.50000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.32%. Comparing base (950c4b2) to head (6706000).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
vllm_ascend/utils.py 62.50% 3 Missing ⚠️

❌ Your patch status has failed because the patch coverage (62.50%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2352      +/-   ##
==========================================
- Coverage   78.33%   78.32%   -0.02%     
==========================================
  Files         132      132              
  Lines       17778    17783       +5     
==========================================
+ Hits        13926    13928       +2     
- Misses       3852     3855       +3     
Flag Coverage Δ
unittests 78.32% <62.50%> (-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.

@lilinsiman lilinsiman closed this Aug 25, 2025
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.

4 participants