Skip to content

Revert "[Performance][EPLB] Reapply expert mapping and load recording optimizations (#23316)" - #23456

Open
LQDLove wants to merge 1 commit into
vllm-project:mainfrom
LQDLove:revert-pr-23316
Open

LQDLove wants to merge 1 commit into
vllm-project:mainfrom
LQDLove:revert-pr-23316

Conversation

@LQDLove

@LQDLove LQDLove commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

This reverts commit 37ee863.

Why

Tertiary suspect for the Nightly-A3-560T (run 45850750880) failure on 2026-11-26 (Qwen3.8-27B-w8a8 crashed in profile run: MTP draft forward raised KeyError: 'weight_scale'). The PR modifies the EPLB expert-mapping reapply path, including patch_fused_moe.py.

Low confidence - reverted as part of a bisect set together with the reverts of #22969 / #23195 / #23075. The primary suspect for this failure remains the CANN base-image bump #23362, which is not reverted here.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 simplifies the EPLB mapping and expert-load kernels by removing the JIT warmup wrapper, dynamic block sizing, and associated tests and documentation. However, the feedback identifies two critical issues: first, removing the do_not_specialize decorator argument for numel in the mapping kernel introduces a severe JIT recompilation risk as token counts vary dynamically; second, removing the type casting in the expert token recording kernel can cause compilation failures or undefined behavior on Ascend NPU when there is a type mismatch between the expert tokens and the load view.

Comment on lines +8 to 9
@triton.jit
def _map_to_physical_kernel(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Removing do_not_specialize=["numel"] from the @triton.jit decorator introduces a severe JIT recompilation risk. Since numel (the total number of active tokens multiplied by top-k) varies dynamically across different inference steps (e.g., during prefill or with variable batch sizes in decode), Triton will recompile this kernel frequently at runtime. This will cause significant latency spikes and violate the repository style guide regarding JIT specialization/recompilation risks.

Suggested change
@triton.jit
def _map_to_physical_kernel(
@triton.jit(do_not_specialize=["numel"])
def _map_to_physical_kernel(
References
  1. Avoid JIT specialization / recompilation risks from changing arguments. (link)

Comment on lines 51 to 56
if group_list_type == 1:
local_load = current
else:
previous_offset = tl.maximum(offsets - 1, 0)
previous = tl.load(expert_tokens_ptr + previous_offset, mask=mask & (offsets > 0), other=0)
if previous.dtype.primitive_bitwidth > expert_load_ptr.dtype.element_ty.primitive_bitwidth:
previous = previous.to(expert_load_ptr.dtype.element_ty)
local_load = current - previous

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

When expert_tokens is int64 and expert_load_view is int32 (which is a common configuration, e.g., in Qwen3-30B-A3B W8A8 workloads), local_load will be int64 while previous_load is int32. Adding them results in an int64 tensor, and attempting to store it back into the int32 pointer expert_load_ptr can cause compilation failures or undefined behavior on Ascend NPU due to type mismatch. Casting local_load to the destination pointer's element type before addition and storage ensures correctness and compatibility.

Suggested change
if group_list_type == 1:
local_load = current
else:
previous_offset = tl.maximum(offsets - 1, 0)
previous = tl.load(expert_tokens_ptr + previous_offset, mask=mask & (offsets > 0), other=0)
if previous.dtype.primitive_bitwidth > expert_load_ptr.dtype.element_ty.primitive_bitwidth:
previous = previous.to(expert_load_ptr.dtype.element_ty)
local_load = current - previous
if group_list_type == 1:
local_load = current
else:
previous_offset = tl.maximum(offsets - 1, 0)
previous = tl.load(expert_tokens_ptr + previous_offset, mask=mask & (offsets > 0), other=0)
local_load = current - previous
local_load = local_load.to(expert_load_ptr.dtype.element_ty)

@github-actions github-actions Bot added documentation Improvements or additions to documentation module:tests module:ops labels Nov 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

👋 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.

🤖 How to trigger CI

CI runs automatically when the PR is opened or reopened. Pushing a new commit no longer re-runs the E2E CI (to save NPU runner resources), so use the comment commands below when needed. They are available to the PR author and users with triage permission or above:

  • /run — run the full PR CI gate on the latest commit.
  • /rerun — re-run the failed CI jobs (e.g. after a flaky failure).
  • /e2e — run selected E2E tests instead of the full gate.
  • /nightly / /presmoke / /weekly — run the corresponding large-scale tests (triage permission or above; blocked during the nightly maintenance window).
  • /cancel — cancel a running CI on this PR.

Note

Until the CI gate has run on a commit, the required ci-gate check stays pending and the PR cannot merge — remember to comment /run after pushing.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage

Total Coverage Diff Coverage
Total 158711 lines N/A
Missing 45035 lines N/A
Coverage 72% N/A

More info see: Summary

@github-actions

Copy link
Copy Markdown
Contributor

Last updated: 2026-11-27 01:55 UTC+8 for commit 3c816fe.

ci-gate failed. Reason:

CODEOWNERS approval gate failed: at least one changed file has no approval from its owner(s). Open the 'CODEOWNERS' steps above to see which files are missing approvals and who can approve.
This PR touches source code (src=true, ci_pipeline=false), so precision/full tests are required before merge. Fix: a maintainer adds the 'ready-precise' label; the workflow reruns automatically once the label is added.

See the workflow run for full logs. This comment is updated in place on each new failure and marked as passed once the gate passes (it is kept for history, not deleted).

Missing owner approvals. Every changed file needs one approval from its CODEOWNERS owner(s):

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation module:ops module:tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant