Skip to content

Conversation

@Pr0Wh1teGivee
Copy link
Contributor

@Pr0Wh1teGivee Pr0Wh1teGivee commented Oct 25, 2025

What this PR does / why we need it?

  1. Replace init_routing_v2 with token_permute to optimize performance.

Note: This pr will be merged after switching ci to CANN 8.3

Does this PR introduce any user-facing change?

No

How was this patch tested?

e2e & ut

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 optimizes the MoE all-to-all operation by refactoring the token dispatching logic in TokenDispatcherWithAll2AllV. The change simplifies the _dispatch_postprocess method by replacing a complex routing function (npu_moe_init_routing_v2) with a more direct permutation function (npu_moe_token_permute) for the quantized path. It also unifies the code path for both quantized and non-quantized execution. This refactoring improves code clarity and is expected to enhance performance. The implementation appears correct and is a good improvement.

Signed-off-by: Pr0Wh1teGivee <[email protected]>
@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.

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.

1 participant