Repository navigation
Conversation
… optimizations (vllm-project#23316)" This reverts commit 37ee863.
There was a problem hiding this comment.
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.
| @triton.jit | ||
| def _map_to_physical_kernel( |
There was a problem hiding this comment.
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.
| @triton.jit | |
| def _map_to_physical_kernel( | |
| @triton.jit(do_not_specialize=["numel"]) | |
| def _map_to_physical_kernel( |
References
- Avoid JIT specialization / recompilation risks from changing arguments. (link)
| 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 |
There was a problem hiding this comment.
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.
| 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) |
|
👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:
If CI fails, you can run linting and testing checks locally according Contributing and Testing. 🤖 How to trigger CI
Note Until the CI gate has run on a commit, the required |
Coverage
More info see: Summary |
|
Last updated: 2026-11-27 01:55 UTC+8 for commit ci-gate failed. Reason:
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 reverts commit 37ee863.
Why
Tertiary suspect for the Nightly-A3-560T (run 45850750880) failure on 2026-11-26 (
Qwen3.8-27B-w8a8crashed in profile run: MTP draft forward raisedKeyError: 'weight_scale'). The PR modifies the EPLB expert-mapping reapply path, includingpatch_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.