[BugFix]Added the store_kv_block_metadata ascendC operator - #11865
Conversation
Signed-off-by: ZT-AIA <1028681969@qq.com>
|
👋 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. Tip 💡 Consider Linking a Related Issue or RFCYour PR title contains the [BugFix] tag, indicating a bug fix or new feature. Linking a related issue or RFC in the PR description is strongly encouraged — it gives reviewers helpful context and speeds up the review. You can use any of these keywords:
🙏 Thanks for helping us keep the project well-organized! |
Signed-off-by: ZT-AIA <1028681969@qq.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces the store_kv_block_metadata AscendC operator to offload metadata generation from the host to the device. By performing this operation on the GPU, the PR eliminates the need for slot_mapping_cpu transfers, reducing host-device synchronization overhead and simplifying the attention metadata pipeline. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
Suggested PR Title:
[Attention][Feature] Implement StoreKvBlockMetadata operator on AICPUSuggested PR Summary:
### What this PR does / why we need it?
This pull request introduces a new AICPU operator `StoreKvBlockMetadata` to compute grouping metadata (such as `group_len`, `group_key_idx`, and `group_key_cache_idx`) directly on the device, replacing the previous host-side `store_kv_block_pre` logic. This eliminates the need for host-to-device memory copies of slot mapping lists, improving performance. Additionally, it updates the `store_kv_block` operator tiling and kernel logic to use signed integers for group lengths and indices.
However, several critical issues were identified during the review:
- In `store_kv_block.h`, direct scalar access via `GetValue(idx)` on `GlobalTensor` is not supported in Ascend C and will cause compilation errors or severe performance degradation.
- In `store_kv_block_metadata_aicpu.cpp`, there are missing bounds checks on `idxGroups` against `outCapacity` and a lack of verification for output tensor capacities, which could lead to out-of-bounds memory writes.
- In `model_runner_v1.py` and `llm_base_proposer.py`, slicing the metadata tensors with `[:num_reqs_padded]` or `[:num_reqs]` instead of token-level counts is a critical bug since speculative decoding and batching process multiple tokens per request.
- In `store_kv_block_tiling.cpp`, `params.coreNum` is used but not defined in the `StoreKVBlockParams` struct, causing compilation failure.
- Direct inclusion of a `.cpp` file (`store_kv_block_metadata_torch_adpt.cpp`) in `torch_binding.cpp` is non-standard.
### Does this PR introduce _any_ user-facing change?
No, this is an internal optimization for Ascend NPU attention metadata processing.
### How was this patch tested?
The patch was tested using the updated end-to-end test `test_store_kv_block.py` and unit tests in `test_sfa_v1.py`.| if( groupLenGt.GetValue(idx)<= 0 || groupKeyIdxGt.GetValue(idx)<0 || groupKeyCacheIdxGt.GetValue(idx)<0){ | ||
| continue; | ||
| } |
There was a problem hiding this comment.
In Ascend C, GlobalTensor does not support direct scalar access via GetValue(idx). Attempting to compile this will result in a compilation error. Even if supported by some emulators, performing direct global memory reads inside a loop on the AI Core is extremely inefficient and will severely degrade performance. To resolve this, allocate a small LocalTensor in the Unified Buffer (UB), copy the metadata tensors from Global Memory to UB using DataCopy before the loop, and then access them locally.
|
|
||
| int32_t blockId = cacheSlot / blockSize_; | ||
|
|
||
| // Record group start: source index and destination cache index | ||
| groupKeyIdxData[idxGroups] = idxSlotmap; | ||
| groupKeyCacheIdxData[idxGroups] = cacheSlot; |
There was a problem hiding this comment.
There is no bounds check on idxGroups against outCapacity before writing to groupKeyIdxData and groupKeyCacheIdxData. If the number of groups exceeds outCapacity, this will cause an out-of-bounds memory write (buffer overflow), leading to crashes or security vulnerabilities. Add a bounds check to prevent this.
if (idxGroups >= outCapacity) {
KERNEL_LOG_ERROR("idxGroups %d exceeds outCapacity %ld", idxGroups, outCapacity);
return false;
}
int32_t blockId = cacheSlot / blockSize_;
// Record group start: source index and destination cache index
groupKeyIdxData[idxGroups] = idxSlotmap;
groupKeyCacheIdxData[idxGroups] = cacheSlot;| group_len = self.group_len.gpu[:num_reqs_padded], | ||
| group_key_idx = self.group_key_idx.gpu[:num_reqs_padded], | ||
| group_key_cache_idx = self.group_key_cache_idx.gpu[:num_reqs_padded], |
There was a problem hiding this comment.
Slicing self.group_len, self.group_key_idx, and self.group_key_cache_idx with [:num_reqs_padded] is a critical bug. These metadata tensors need to hold grouping information for all tokens in the batch, so they must be sliced with [:num_tokens_padded] (the number of tokens), not [:num_reqs_padded] (the number of requests). Slicing with num_reqs_padded will make the tensors far too small, causing the operator to fail or write out of bounds.
| group_len = self.group_len.gpu[:num_reqs_padded], | |
| group_key_idx = self.group_key_idx.gpu[:num_reqs_padded], | |
| group_key_cache_idx = self.group_key_cache_idx.gpu[:num_reqs_padded], | |
| group_len = self.group_len.gpu[:num_tokens_padded], | |
| group_key_idx = self.group_key_idx.gpu[:num_tokens_padded], | |
| group_key_cache_idx = self.group_key_cache_idx.gpu[:num_tokens_padded], |
| tilingData.set_typeByte(params.typeByte); | ||
| tilingData.set_tokenSize(params.tokenSize); | ||
| tilingData.set_corePerNum(params.corepernum); | ||
| if (params.coretail < params.coreNum) tilingData.set_coreTail(params.coretail); |
There was a problem hiding this comment.
The variable params.coreNum is used here, but coreNum is not a member of the StoreKVBlockParams struct. This will cause a compilation failure. Please use the correct local variable or platform API to retrieve the core count.
| if (params.coretail < params.coreNum) tilingData.set_coreTail(params.coretail); | |
| if (params.coretail < coreNum) tilingData.set_coreTail(params.coretail); |
| if (slotMapping_ == nullptr || slotMapping_->GetData() == nullptr) { | ||
| KERNEL_LOG_ERROR("slot_mapping is empty"); | ||
| return false; | ||
| } | ||
| if (groupLen_ == nullptr || groupLen_->GetData() == nullptr || | ||
| groupKeyIdx_ == nullptr || groupKeyIdx_->GetData() == nullptr || | ||
| groupKeyCacheIdx_ == nullptr || groupKeyCacheIdx_->GetData() == nullptr) { | ||
| KERNEL_LOG_ERROR("input tensor is empty"); | ||
| return false; | ||
| } | ||
|
|
||
| int32_t *slotMappingData = static_cast<int32_t *>(slotMapping_->GetData()); | ||
| int32_t *groupLenData = static_cast<int32_t *>(groupLen_->GetData()); | ||
| int32_t *groupKeyIdxData = static_cast<int32_t *>(groupKeyIdx_->GetData()); | ||
| int32_t *groupKeyCacheIdxData = static_cast<int32_t *>(groupKeyCacheIdx_->GetData()); | ||
|
|
||
| // total elements in slot_mapping (1-D tensor) | ||
| int64_t slotMappingLen = slotMapping_->GetTensorShape()->GetDimSize(0); | ||
|
|
||
| // total capacity of output tensors (1-D, same shape as input) | ||
| int64_t outCapacity = groupLen_->GetTensorShape()->GetDimSize(0); |
There was a problem hiding this comment.
The kernel does not verify that the output tensors groupKeyIdx_ and groupKeyCacheIdx_ have the same capacity as groupLen_ (or at least outCapacity). If they are smaller, the subsequent memset and writes will overflow. Also, using GetTensorShape()->GetShapeSize() is more robust than GetDimSize(0) to handle any potential shape variations.
if (slotMapping_ == nullptr || slotMapping_->GetData() == nullptr) {
KERNEL_LOG_ERROR("slot_mapping is empty");
return false;
}
if (groupLen_ == nullptr || groupLen_->GetData() == nullptr ||
groupKeyIdx_ == nullptr || groupKeyIdx_->GetData() == nullptr ||
groupKeyCacheIdx_ == nullptr || groupKeyCacheIdx_->GetData() == nullptr) {
KERNEL_LOG_ERROR("input tensor is empty");
return false;
}
int32_t *slotMappingData = static_cast<int32_t *>(slotMapping_->GetData());
int32_t *groupLenData = static_cast<int32_t *>(groupLen_->GetData());
int32_t *groupKeyIdxData = static_cast<int32_t *>(groupKeyIdx_->GetData());
int32_t *groupKeyCacheIdxData = static_cast<int32_t *>(groupKeyCacheIdx_->GetData());
// total elements in slot_mapping
int64_t slotMappingLen = slotMapping_->GetTensorShape()->GetShapeSize();
// total capacity of output tensors
int64_t outCapacity = groupLen_->GetTensorShape()->GetShapeSize();
int64_t keyIdxCapacity = groupKeyIdx_->GetTensorShape()->GetShapeSize();
int64_t keyCacheIdxCapacity = groupKeyCacheIdx_->GetTensorShape()->GetShapeSize();
if (keyIdxCapacity < outCapacity || keyCacheIdxCapacity < outCapacity) {
KERNEL_LOG_ERROR("Output tensors capacity mismatch: groupLen %ld, groupKeyIdx %ld, groupKeyCacheIdx %ld",
outCapacity, keyIdxCapacity, keyCacheIdxCapacity);
return false;
}| group_len=self.runner.group_len.gpu[:num_reqs], | ||
| group_key_idx=self.runner.group_key_idx.gpu[:num_reqs], | ||
| group_key_cache_idx=self.runner.group_key_cache_idx.gpu[:num_reqs], |
| #ifndef STORE_KV_BLOCK_METADATA_TORCH_ADPT_H | ||
| #define STORE_KV_BLOCK_METADATA_TORCH_ADPT_H |
Signed-off-by: ZT-AIA <1028681969@qq.com>
Signed-off-by: ZT-AIA <1028681969@qq.com>
commit 32c22bb93d0d41808d4669b437247bfeea1cfb26
Author: Qiu <qiuchunshuo@huawei.com>
Date: Sun Jul 12 18:33:41 2026 +0800
[Test] remove DeepSeek-V3.2-W8A8-DCP-replicated-indexer from nightly config (#11874)
remove DeepSeek-V3.2-W8A8-DCP-replicated-indexer from nightly config
before C8 sfa adapted.
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
Signed-off-by: QiuChunshuo <qiuchunshuo@huawei.com>
commit d19628a1b292cba1ef33593a6446d3777f28574e
Author: ZT-AIA <1028681969@qq.com>
Date: Sun Jul 12 00:17:21 2026 +0800
[BugFix]Added the store_kv_block_metadata ascendC operator (#11865)
1. The operator obtains data from slot_mapping.cpu instead of
slot_mapping.gpu. This is because slot_mapping.cpu!=slot_mapping.gpu is
transmitted to sfa_v1.
2. Therefore, the `cpu_slotmapping` variable is deleted. It is not used
as a placeholder in other places and can be deleted after being checked
with the FO.
3. To adapt to aclgraph, the tensor address of the input parameter
store_kv_block_metadata is fixed.
No
test
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: ZT-AIA <1028681969@qq.com>
commit 3f3493ed9392570421fa320294fdb18758cd8334
Author: Wang Kunpeng <1289706727@qq.com>
Date: Sat Jul 11 22:39:19 2026 +0800
[Misc] Fix issues related to graph fusion (#11776)
1. The `enable_npugraph_ex` parameter has been moved to
`ascend_compilation_config`, and the invalid description and
configuration have been removed.
2. Currently, the qwen3-32b-w4a4 weight does not support
`fuse_norm_quant`. Through code interception, w4a4 does not perform this
operator fusion.
no
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: wangkunpeng <1289706727@qq.com>
commit 8a78b63c9e730862491e9f628f8111e985e3421c
Author: Qiu <qiuchunshuo@huawei.com>
Date: Sat Jul 11 21:15:17 2026 +0800
[Test](nightly): reduce max out len to 4096 in DeepSeek-V3.2-W8A8-DCP.yaml (#11857)
Fix error max out len in DeepSeek-V3.2-W8A8-DCP.yaml.
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
Signed-off-by: QiuChunshuo <qiuchunshuo@huawei.com>
commit 76a03fbe0ba2c72c38845d607a3028a9cbe340ab
Author: chen-commits <85173575+chen-commits@users.noreply.github.com>
Date: Sat Jul 11 19:47:48 2026 +0800
[Test][Feature] Add E2E Weekly Single Node Engine Function Test Robot (#11852)
This pull request introduces a new end-to-end (E2E) weekly single-node
engine function test suite (`engine_func_test_robot`) to validate chat
template keyword arguments, thinking/enable_thinking behaviors, and
multi-modal capabilities.
No.
This PR adds new E2E tests under
`tests/e2e/weekly/single_node/engine_func_test_robot/tests/` to verify
chat template arguments and thinking tags.
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
Signed-off-by: chen-commits <1636718796@qq.com>
Signed-off-by: chen <1636718796@qq.com>
commit 911ea2fca2477c2b3c19fa8d96607388eb991a26
Author: recky-c <ruiqicheng510@gmail.com>
Date: Sat Jul 11 19:43:57 2026 +0800
[BugFix][PCP] Fix inclusive MTP decode attention mask for interleave (#11849)
`k_upper` counted local KV tokens with `pos < P` (exclusive). That drops
the query's own KV on the owning rank, and can leave `k_upper < 0`,
which disables the row mask via `(k_upper >= 0)`.
In practice, PCP+MTP single-request generation looked fine for the first
~100 tokens, then started looping/repeating.
This PR counts local KV with `pos <= P` by using `inclusive_positions =
positions + 1` before the interleave `base/remainder` formula, restoring
inclusive causal behavior. For `interleave_size=1`, this matches the
pre-#11492 formula `(P - rank) // cp_size`.
No API change. Fixes incorrect PCP+MTP decode attention masking that
could cause repetitive/looping output.
- Updated the UT reference in `tests/ut/worker/test_pcp_manager.py` to
inclusive causal semantics
- Added `test_mtp_mask_interleave1_matches_legacy_inclusive_formula`
against the legacy inclusive formula
- Formula check: `interleave_size=1` matches legacy; owning-rank
`k_upper` no longer goes negative
- Manual: PCP+MTP curl reproduction (pre-fix looping after ~100 tokens /
post-fix expected normal)
AI assistance was used to diagnose and implement this fix.
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: recky-c <ruiqicheng510@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
commit 3e34542d65d11ba62b96adad5bd765b3388e22ec
Author: wangxiyuan <wangxiyuan1007@gmail.com>
Date: Sat Jul 11 17:56:27 2026 +0800
[Test] Add model and coverage marker for e2e test (#11838)
This pull request replaces the static markdown-based E2E coverage
generator with an interactive, self-contained HTML coverage report
generator (`generate_coverage_html.py`). It registers new pytest markers
(`e2e_model` and `e2e_coverage`) in `pyproject.toml` and annotates
several E2E tests with these markers to capture dimensions like
architecture, features, parallelization, deployment, hardware,
quantization, and graph mode.
Feedback on the review comments: Two critical issues were identified in
the HTML generator script regarding string escaping in Python string
literals representing JavaScript code. Specifically, the literal null
byte `\\x00` and the backslash `\\` in the header label need proper
escaping to prevent browser rendering and file encoding issues.
No, this is an internal testing and developer tooling improvement.
The patch can be tested by running the new script: `python
tests/e2e/generate_coverage_html.py` to verify the generated
`coverage.html` file.
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
commit 88c2c87d0c405f4963de2de75ce1f54bf9654046
Author: JIACHENG XU <56331162+Spicy-Stick@users.noreply.github.com>
Date: Sat Jul 11 16:18:14 2026 +0800
[Bugfix] Add error log, eplb not support w4a8mxfp (#11835)
Error Handling: Added an explicit check to raise a RuntimeError when the
quantization type is set to W4A8MXFP, as it is currently unsupported by
EPLB.
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
Signed-off-by: Spicy-Stick <873805887@qq.com>
Signed-off-by: xujc <xujc@sh-stt.com>
commit f932d3404f0674aafc25522956e31b84de7709c4
Author: lcfenglinwan <lcfenglin@qq.com>
Date: Sat Jul 11 16:14:09 2026 +0800
[BugFix]Fix hc_pre ops issue (#11825)
This PR fixes a critical out-of-bounds memory access in the
`HcPreMKSplitCorePart2` kernel by correctly using `curRowFactor` instead
of `tilingData->stage2RowFactor` when copying input data `xGm` to
`xLocal`.
Additionally, it addresses a potential data corruption/misalignment bug
when `curDFactor` is not aligned to the 32-byte boundary (e.g., when
`dFactor_` is not a multiple of 16/32).
No.
Tested with operator unit tests and CI.
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
Signed-off-by: lcfenglinwan <lcfenglin@qq.com>
commit 26523e21b2252106b2a6d6876da02d66b7959478
Author: vllm-ascend-ci <vllmcibot@gmail.com>
Date: Sat Jul 11 15:50:39 2026 +0800
[CI] Auto-update estimated test times in test_config.yaml (#11837)
This PR was auto-generated by the **Update estimated test times**
[workflow](https://github.com/vllm-project/vllm-ascend/actions/runs/29087369120).
It updates the `estimated_times` values in
`.github/workflows/scripts/test_config.yaml` based on actual elapsed
times collected from CI workflow runs.
- Each test job uploads its elapsed time as a `timing-data-*` artifact
upon completion.
- The workflow aggregates all collected timing artifacts across jobs.
- For each test, the **median** elapsed time is computed to reduce
outlier impact.
- A **10% safety buffer** is applied and the result is rounded to the
nearest 10 seconds.
- [ ] Verify that updated `estimated_time` values are within a
reasonable range.
- [ ] Confirm no test entries are missing or unexpectedly removed.
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
commit 95eaa6a4cf73fb73a63ae069675ccbd92ff6c391
Author: vllm-ascend-ci <vllmcibot@gmail.com>
Date: Sat Jul 11 15:50:16 2026 +0800
[Doc] Translated Doc files 2026-07-10 (#11798)
Translated **5** file(s):
-
<code>/home/runner/_work/vllm-ascend/vllm-ascend/docs/source/locale/zh_CN/LC_MESSAGES/developer_guide/Design_Documents/balance_schedule_refactor.po</code>
-
<code>/home/runner/_work/vllm-ascend/vllm-ascend/docs/source/locale/zh_CN/LC_MESSAGES/tutorials/models/Gemma4.po</code>
-
<code>/home/runner/_work/vllm-ascend/vllm-ascend/docs/source/locale/zh_CN/LC_MESSAGES/tutorials/models/Qwen3.5-397B-A17B.po</code>
-
<code>/home/runner/_work/vllm-ascend/vllm-ascend/docs/source/locale/zh_CN/LC_MESSAGES/user_guide/configuration/additional_config.po</code>
-
<code>/home/runner/_work/vllm-ascend/vllm-ascend/docs/source/locale/zh_CN/LC_MESSAGES/user_guide/feature_guide/short_request_first.po</code>
---
[Workflow
run](https://github.com/vllm-project/vllm-ascend/actions/runs/29068180760)
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
Signed-off-by: wangxiyuan <wangxiyuan@users.noreply.github.com>
Co-authored-by: wangxiyuan <wangxiyuan@users.noreply.github.com>
commit 95b994cf44452bdf1ea17439c9b01b06f3d3f442
Author: wenjun91 <wuwenjun6@huawei.com>
Date: Sat Jul 11 15:28:22 2026 +0800
[CI]modify the execution time of weekly pipeline at 10:00 sunday (#11847)
modify the execution time of weekly pipeline at 10:00 sunday
no
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: wenjun91 <wuwenjun6@huawei.com>
commit 587ac6aa8920881a4276ee6cea30c33392424e9e
Author: ZYang6263 <50876451+ZYang6263@users.noreply.github.com>
Date: Sat Jul 11 14:20:05 2026 +0800
[Feature][Refactor] Support SFA C8 on A3 with unified packed KV cache layout (#11228)
This PR adds SFA sparse C8 support for A3 and refactors the KV cache
layout to share the same packed/merged representation used by the sparse
C8 path. Before this change, SFA KV quantization used a separate switch
and could allocate KV cache as separate tensors such as `(k, v,
indexer_k, indexer_scale)`, while A5 sparse C8 used a merged CKV-style
layout. After this change, `enable_sparse_c8` becomes the single switch
for SFA KV cache quantization, and sparse C8 layers use a packed layout:
layers with indexer change from `(k, v, indexer_k, indexer_scale)` to
`(ckv, indexer_k, indexer_scale)`, while layers without indexer change
from allocating an unnecessary indexer cache to only allocating the
required KV tensors, e.g. `(ckv)` for sparse C8 packed KV or `(k, v)`
for non-C8 sparse layers. This removes the SFA-specific KV quant switch
and aligns A3/A5 sparse C8 cache handling under one layout model.
In a single-node A3 deployment of GLM-5 W8A8, C8 provides a KV cache
size of 122,309, approximately 1.62× that of C16 at 75,600.
| KV Cache 类型 | KV Cache Size |
|---|---:|
| SFA C16 | 75,600 |
| SFA C8 | 122,309 |
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: ZYang6263 <zy626375@gmail.com>
Signed-off-by: ZYang6263 <50876451+ZYang6263@users.noreply.github.com>
commit 2f8934ae30228d1b6874a7d41bbf9d23c0e77544
Author: leijie <12832442+leijie-ww@users.noreply.github.com>
Date: Sat Jul 11 11:44:54 2026 +0800
[BugFix] Fix Qwen3.x KV cache binding for multiple layers (#11470)
This PR fixes incomplete KV cache binding in the Qwen3 Next MTP patch.
`bind_kv_cache` groups layer names by `extract_layer_index()`. In some
Qwen3.x / Qwen3 Next MTP cases, multiple layer names can map to the same
layer index. The previous implementation only appended `layer_names[0]`
to `runner_kv_caches`, so KV cache entries for the remaining layer names
under the same index were not added to the ModelRunner KV cache list.
This PR appends all layer names in each sorted layer-index group,
keeping `runner_kv_caches` consistent with `kv_caches` and
`forward_context`.
No API or CLI change.
This fixes model initialization / inference behavior for affected
Qwen3.x / Qwen3 Next MTP models where multiple attention layer names
share the same extracted layer index.
Added a unit test to cover the case where multiple layer names map to
the same layer index and verify that all KV cache entries are appended
to `runner_kv_caches`.
Test command:
```bash
pytest -sv tests/ut/patch/worker/test_patch_qwen3_next_mtp.py
INFO 07-07 00:54:46 [__init__.py:44] Available plugins for group vllm.platform_plugins:
INFO 07-07 00:54:46 [__init__.py:46] - ascend -> vllm_ascend:register
INFO 07-07 00:54:46 [__init__.py:49] All plugins in this group will be loaded. Set `VLLM_PLUGINS` to control which plugins to load.
INFO 07-07 00:54:46 [__init__.py:238] Platform plugin ascend is activated
INFO 07-07 00:54:46 [platform.py:61] [vllm-ascend] - Breakable cudagraph is force disabled on Ascend because DeepSeek V4 PIECEWISE cudagraph is not supported yet.
`Qwen2VLImageProcessorFast` is deprecated. The `Fast` suffix for image processors has been removed; use `Qwen2VLImageProcessor` instead.
================================================================================================ test session starts =================================================================================================
platform linux -- Python 3.11.10, pytest-8.3.2, pluggy-1.6.0 -- /usr/local/python3.11.10/bin/python3.11
cachedir: .pytest_cache
rootdir: /home/l00656382/code_b050_main/vllm-ascend
configfile: pyproject.toml
plugins: xdist-3.6.1, anyio-4.13.0
collected 1 item
tests/ut/patch/worker/test_patch_qwen3_next_mtp.py::TestQwen3NextMTPBindKvCache::test_bind_kv_cache_appends_all_layers_with_same_layer_index PASSED
================================================================================================== warnings summary ==================================================================================================
../../../../usr/local/python3.11.10/lib/python3.11/site-packages/torch/jit/_script.py:362: 14 warnings
/usr/local/python3.11.10/lib/python3.11/site-packages/torch/jit/_script.py:362: DeprecationWarning: `torch.jit.script_method` is deprecated. Please switch to `torch.compile` or `torch.export`.
warnings.warn(
../../../../usr/local/python3.11.10/lib/python3.11/site-packages/opentelemetry/util/_importlib_metadata.py:32
/usr/local/python3.11.10/lib/python3.11/site-packages/opentelemetry/util/_importlib_metadata.py:32: DeprecationWarning: SelectableGroups dict interface is deprecated. Use select.
return EntryPoints(ep for group_eps in eps.values() for ep in group_eps)
<frozen importlib._bootstrap>:241
<frozen importlib._bootstrap>:241: DeprecationWarning: builtin type SwigPyPacked has no __module__ attribute
<frozen importlib._bootstrap>:241
<frozen importlib._bootstrap>:241: DeprecationWarning: builtin type SwigPyObject has no __module__ attribute
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================================================================================== 1 passed, 17 warnings in 0.02s ===========================================================================================
sys:1: DeprecationWarning: builtin type swigvarlink has no __module__ attribute
```
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: leijie-ww <leijie-ww@noreply.gitcode.com>
Co-authored-by: leijie-ww <leijie-ww@noreply.gitcode.com>
commit b9acec8bc4318f04e425800e265a3a904f6bc82f
Author: zhaochuang <zhchuang163@163.com>
Date: Sat Jul 11 10:20:54 2026 +0800
[BugFix][Worker] Reset slot_mapping to pad id for dummy graph capture (#11774)
Clear stale slot_mapping for all kv cache groups during
dummy/graph-capture runs, where slot_mapping is not populated via
_prepare_inputs(), to avoid graph capture reading uninitialized values.
No.
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: zhaochuang001 <zhchuang163@163.com>
commit 71e0921d5f38c1fbe4e80c822576578df460a1f3
Author: zhenwenqi2024 <155598497+zhenwenqi2024@users.noreply.github.com>
Date: Sat Jul 11 10:19:18 2026 +0800
[Performance] Vectorize local seq len computation in SFAMetadataBuilder (#11762)
Replace the per-request Python loop that computed local query/key
lengths with on-device vectorized ops (clamp, cumsum, torch.where).
The loop issued 2 `.item()` NPU->CPU syncs per request (2 * num_reqs
syncs/step); the new path is fully on-device with zero syncs.
Behavior is preserved: each request's [global_start, global_end) range
is clipped to the local [local_start, local_end_with_pad) slice and
accumulated into actual_seq_lengths_query / actual_seq_lengths_key.
the profiling before is:
<img width="1033" height="877" alt="image"
src="https://github.com/user-attachments/assets/f5f257a0-c2fb-481e-8310-1f4db68a1206"
/>
the profiling after is :
<img width="669" height="592" alt="image"
src="https://github.com/user-attachments/assets/bf119c1b-f5e6-4844-948f-74ac9431ab32"
/>
NO
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
Signed-off-by: zhenwenqi2024 <zhenwenqi_2022@qq.com>
commit 7169e47f4a0ee3b04f47e7a149d74435e5f9fe6f
Author: leolee <83689697+li1how@users.noreply.github.com>
Date: Sat Jul 11 10:02:19 2026 +0800
[Performance][Attention] Optimize PCP FA restore and output merge (#11586)
commit dbcbf025a15ffbe33ca3a481924d6799a212efdc
Author: Wang Yixuan <88923622+hust17yixuan@users.noreply.github.com>
Date: Fri Jul 10 22:35:03 2026 +0800
[BugFix]Fix fused_infer_attention ops contiguous err (#11790)
The fused_infer_attention ops doesn't support make the input contiguous
automatic, so we need to make the some input tensor contiguous in
framework, which is also need in Ascend950 hardware
No
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
Signed-off-by: hust17yixuan <303660421@qq.com>
commit 8752431f04f119b83b9bbd2d8205b2352c6fe4b5
Author: zouyida2052 <zouyida2002@gmail.com>
Date: Fri Jul 10 19:44:29 2026 +0800
[Feature] Support Ascend 950 CPU binding with topo clusters (#11717)
- Add Ascend 950 CPU binding based on topo affinity and CPU clusters.
- Bind Ascend 950 UVB polling threads and skip IRQ/ACL/release binding
for Ascend 950.
- Refactor CPU binding helpers and update UT/docs/log descriptions.
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: zouyida2052 <zouyida2002@gmail.com>
commit f572051a811943ca46dd5ec4771e7bc116838260
Author: AJF-cmd <wangruiqing6@h-partners.com>
Date: Fri Jul 10 19:03:52 2026 +0800
[Test] Update weekly configs in Qwen3.5-27B-w8a8-A3 (#11806)
Update weekly configs in Qwen3.5-27B-w8a8-A3
No.
Validated via E2E test suite.
- vLLM version:
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: AJF-cmd <wangruiqing6@h-partners.com>
commit 4db2dbd77f7583d119c8a81ecae3fdc9b82963d9
Author: guxin108 <1252896542@qq.com>
Date: Fri Jul 10 18:52:56 2026 +0800
[CI] add cases in weekly_config.yaml (#11827)
add cases in weekly_config.yaml
no
run the cases weekly
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: guxin108 <1252896542@qq.com>
commit 1180747b6e17bd70fc33e50e9d755eaa822adb01
Author: SHUAI YANG <shuaiyang047@163.com>
Date: Fri Jul 10 18:51:15 2026 +0800
[Doc][310P] Add Atlas 200I Pro page cache cleanup tip (#11795)
Adds a Host Page Cache Cleanup (Recommended) section to the Atlas 200I
Pro deployment guide in the 310P docs. It recommends running sync and
echo 3 > /proc/sys/vm/drop_caches on the host before starting vllm serve
when host memory is tight, to release page caches and reduce OOM risk
during model loading. Users should check available memory (e.g. with
free -h) and decide based on their environment.
No
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: YangShuai52 <shuaiyang047@163.com>
commit af672dd6e83812ea7c32e048cf94b8089c690e56
Author: Qi Mao <maomaoyu870@gmail.com>
Date: Fri Jul 10 05:44:56 2026 -0500
[Attention][Misc] Replace PA KV cache operators (#11713)
- Replace `_npu_reshape_and_cache` call sites with
`torch_npu.npu_scatter_pa_kv_cache` for ND PA cache writes, using
`cache_mode="Norm"`.
- Replace `torch_npu.atb.npu_paged_cache_load` call sites with
`torch_npu.npu_gather_pa_kv_cache` and `seq_offset`.
- Route the SFA CP KV write path through
`DeviceOperator.reshape_and_cache` and update related mocks/tests.
- Add a single-op coverage case for `slot_mapping == 0` and
`slot_mapping == -1` behavior on `npu_scatter_pa_kv_cache`.
- Keep individual call sites free of layout handling; normalize scatter
inputs and gather `seq_lens` centrally in `BaseDeviceAdaptor` because
the PA operators reject non-contiguous views.
- Add regression coverage for non-contiguous scatter inputs and sliced
`seq_lens` tensors.
- Local: `python -m compileall -q vllm_ascend tests/ut/conftest.py
tests/e2e/nightly/single_node/ops/singlecard_ops/test_transpose_kv_cache_by_block.py
tests/e2e/nightly/single_node/ops/singlecard_ops/test_pa_kv_cache_ops.py`
- Local: `uvx ruff check vllm_ascend/device/device_op.py
tests/ut/device/test_device_op.py`
- Local: `git diff --check origin/main...HEAD`
- Local: `rg -n "_npu_reshape_and_cache\(|npu_paged_cache_load\("
vllm_ascend tests -g "*.py"` returned no target-call matches.
- Remote A3 container on `80.5.17.106`, image
`vllm-ascend:dev-26.1.0.day20260707-800I-A3-py311-Ubuntu24.04-lts-aarch64`:
PA scatter/gather Norm single-op validation passed.
- Remote A3 container: old `_npu_reshape_and_cache` and new
`npu_scatter_pa_kv_cache(cache_mode="Norm")` produced identical cache
results for `slot_mapping=[0, -1, 3]` and `slot_mapping=[-1, -1]`.
- Remote A3 container after removing call-site data-tensor layout
conversions: `python -m unittest
tests.e2e.nightly.single_node.ops.singlecard_ops.test_pa_kv_cache_ops
-v` passed.
- Remote A3 container after removing call-site data-tensor layout
conversions: targeted A2/MLA tests passed (`9 passed`).
- e2e pytest collection in the container is blocked by missing
`modelscope`; the new single-op test was run directly with `unittest` to
avoid that unrelated conftest dependency.
- Direct unittest execution of `test_transpose_kv_cache_by_block.py`
requires the local `vllm_ascend_C` extension to be built; this
source-tree container did not have that extension registered.
- The local macOS environment does not provide `torch_npu`, so the new
device-adaptor UT is delegated to CI.
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
Signed-off-by: maoxx241 <maomaoyu870@gmail.com>
commit accfe253e3b4ac39b80c94e6ddb4b192cb13eaa9
Author: guxin108 <1252896542@qq.com>
Date: Fri Jul 10 17:50:51 2026 +0800
[CI] add Deepseekv4-flash-w8a8-PD.yaml and modify Kimi-k2.5-w4a8-16k-1k-TPOT50.yaml (#11734)
we add weekly cases :Deepseekv4-flash-w8a8-PD.yaml and modify
Kimi-k2.5-w4a8-16k-1k-TPOT50.yaml
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: guxin108 <1252896542@qq.com>
commit acc5c1d689d8e9b7ba93a020b27c912405b353fc
Author: Qiu <qiuchunshuo@huawei.com>
Date: Fri Jul 10 17:45:07 2026 +0800
[BugFix][Worker] Fix PP PCP hidden state restore (#11401)
This PR fixes PP + PCP execution when a non-last pipeline-parallel rank
returns `IntermediateTensors` from the model forward path.
The PCP post-processing path previously always called
`pcp_manager.get_restore_hidden_states(hidden_states)` whenever
`pcp_size > 1`. In PP execution, non-last pipeline stages can produce
`IntermediateTensors` instead of a plain hidden-state tensor. Passing
that object through the PCP restore tensor path is invalid, so this
change skips PCP hidden-state restoration when `hidden_states` is
already `IntermediateTensors`.
This keeps the restore behavior for tensor hidden states unchanged while
allowing intermediate pipeline outputs to continue through the existing
PP return path.
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: QiuChunshuo <qiuchunshuo@huawei.com>
commit d183f00db71c0d303f5d0d035c1d3b35425d9d1f
Author: jack <QwertyJack@users.noreply.github.com>
Date: Fri Jul 10 17:35:09 2026 +0800
[BugFix] Guard mixed structured output backends (#11589)
Fixes #11588.
This PR adds a vllm-ascend guard for V1 structured outputs when
`backend=auto` resolves different requests to different backends in the
same engine lifetime. V1 structured outputs use one engine-level backend
manager. In the reported failure sequence, the first schema initialized
`xgrammar`, and a later schema resolved to `guidance`; the later request
could still reach the initialized `xgrammar` backend and crash during
grammar compilation.
This PR:
- Records the first resolved structured-output backend on
`StructuredOutputsConfig`.
- Rejects later requests that resolve to a different backend with
`VLLMValidationError` before grammar compilation.
- Adds a fallback guard in `StructuredOutputManager.grammar_init` for
requests that bypass API-side validation.
- Supports both active vLLM `_validate_structured_outputs` signatures
used by CI validation refs.
- Adds focused unit coverage for mixed-backend rejection, same-backend
success paths, and subclassed backend instances.
Related upstream context: this overlaps with
https://github.com/vllm-project/vllm/issues/43920. The shared root cause
is the V1 single-backend-per-engine invariant combined with per-request
`backend=auto` fallback and uncaught grammar compilation exceptions. The
most relevant upstream fix candidate is
https://github.com/vllm-project/vllm/pull/44401, but this PR
intentionally keeps the vllm-ascend fix narrower by rejecting mixed
backend transitions before grammar compilation.
Yes. Requests that resolve to a structured-output backend different from
the backend already initialized by the engine now fail with a clear
validation error instead of surfacing as a server-side grammar
compilation crash / HTTP 500. Requests that continue using the same
backend are unchanged.
- Added unit tests in
`tests/ut/patch/platform/test_patch_structured_output.py` for
mixed-backend rejection, same-backend success paths,
failed-first-validation behavior, and subclassed backend detection.
- Ran local checks:
- `python -m py_compile
vllm_ascend/patch/platform/patch_structured_output.py
tests/ut/patch/platform/test_patch_structured_output.py`
- `ruff check vllm_ascend/patch/platform/patch_structured_output.py
tests/ut/patch/platform/test_patch_structured_output.py`
- `ruff format --check
vllm_ascend/patch/platform/patch_structured_output.py
tests/ut/patch/platform/test_patch_structured_output.py`
- `PYTHONPATH=<vllm-src>:<vllm-ascend-src> python -m pytest -q
tests/ut/patch/platform/test_patch_structured_output.py` -> `7 passed`
- Checked the updated GitHub Actions run for this PR:
`lint-and-select-tests` passed, and the CPU selected tests that
previously failed with `_validate_structured_outputs` signature
mismatches passed for both `1f486d96a17303ce8db8e02be39545b2be338446`
and `v0.23.0`.
- Validated with a real-weight live service using
`/models/DeepSeek-V4-Flash-w8a8-mtp-0507`, TP4/DP4/EP, ACLGraph, async
scheduling, MTP1 eager via `--speculative-config`,
`max_model_len=133120`, and `max_num_seqs=16`:
- unpatched: the user repro case `items=[]` returned HTTP 500 and logged
xgrammar `items must be a boolean or an object` from EngineCore;
- patched: the same case returned HTTP 400 with the mixed-backend
validation message;
- patched: `/v1/models` and `/health` stayed HTTP 200 after the rejected
request;
- patched: the full user repro loop did not reproduce a server-side 500.
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: QwertyJack <7554089+QwertyJack@users.noreply.github.com>
Co-authored-by: QwertyJack <7554089+QwertyJack@users.noreply.github.com>
commit fd41862cd9fd38c89f2f982e65d80f98401fd918
Author: Wangbei25 <wangbei41@huawei.com>
Date: Fri Jul 10 17:10:18 2026 +0800
[Test] Modify perf baseline of Qwen3.5-397B-A17B-w4a8-mtp-A2.yaml (#11789)
Modify perf baseline of Qwen3.5-397B-A17B-w4a8-mtp-A2.yaml
None
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
Signed-off-by: WangBei25 <wangbei41@huawei.com>
commit c2dba854393845ec247cabde2b6d948056cd64a9
Author: jiangyunfan1 <jiangyunfan1@h-partners.com>
Date: Fri Jul 10 16:53:08 2026 +0800
[Test]Update upstream cases to v0.23.0 (#11682)
This PR updates upstream cases to v0.23.0, we need it to test them
weekly.
No
by running the test
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
Signed-off-by: jiangyunfan1 <jiangyunfan1@h-partners.com>
commit 7d953ad85b0f807e0ffaae9a7e30cfd861f821c1
Author: Ting Hu <suluner_2011@163.com>
Date: Fri Jul 10 16:38:27 2026 +0800
[Misc] Standardize the naming convention for QuantType enum. (#11694)
Standardize the naming convention for QuanType enum.
No
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: Suluner <suluner2011@gmail.com>
commit 2eed9aa2709a9a7a2885cb1602dc5223c9b02861
Author: drslark <96540755+drslark@users.noreply.github.com>
Date: Fri Jul 10 16:36:15 2026 +0800
[Doc] Correct the interpretation of `dflash` (#11787)
Current interpretation of `dflash` is inaccurate.
This pr corrects it.
N/A
N/A
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
Signed-off-by: drslark <slarksblood@qq.com>
commit 5fd5abed512b30db7d8ad15e73c2e618942a9c8d
Author: starmountain1997 <77533802+starmountain1997@users.noreply.github.com>
Date: Fri Jul 10 15:55:53 2026 +0800
[CI] Remove aime2025 accuracy benchmark (#11794)
Remove the `acc_aime2025` accuracy benchmark from the DeepSeek-V3.2 W8A8
dual-node E2E test config. This benchmark is not part of the required
accuracy validation suite for this setup.
No.
CI.
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
Signed-off-by: guozr <guozr1997@hotmail.com>
Co-authored-by: guozr <guozr1997@hotmail.com>
commit 99975ea8cd7d46e4469c57fd01a719d1ae27e038
Author: Tian-Fantasea <tt553093031@gmail.com>
Date: Fri Jul 10 15:35:48 2026 +0800
[CI] Add wangzhishenghw into ALLOWED_USERS (#11809)
Add a name to the list of contributor authorized to comment
"/wait-feedback".
No.
Already tested.
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
Signed-off-by: Tian-Fantasea <Tian-Fantasea@noreply.gitcode.com>
Co-authored-by: Tian-Fantasea <Tian-Fantasea@noreply.gitcode.com>
commit 9a0c066f05446e2d439683c7ba64d7b4f2ad2cf5
Author: wyc1999 <76724714+wangyichao1999@users.noreply.github.com>
Date: Fri Jul 10 15:21:55 2026 +0800
[BugFix]Fix bug #11395 for step3p5 (_pad_query_start_loc_for_fia new parameter adaptation) (#11405)
Fix #11395: In commit #11062, _pad_query_start_loc_for_fia added a new
parameter but step3p5 was not adapted.
Does not involve any other model code; adapts to the upstream function's
parameter change.
Step3.5 Flash model, 8× Ascend NPU, TP=8, FC1+FC2+MTP all enabled. After
the fix, both PD disaggregated and PD colocated deployments start
correctly and pass random dataset benchmark stress testing (batch
1–128).
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: wangyichao1999 <1543089729@qq.com>
commit 83b987712b31917fb1aabc5a905d8925324b3add
Author: wyc1999 <76724714+wangyichao1999@users.noreply.github.com>
Date: Fri Jul 10 15:20:54 2026 +0800
[BugFix] Skip FlashComm1/2 For ViT (#10941)
Fix VIT crash when enabling FC1/FC2 on Ascend NPU for VL models (e.g.
Step3p7):
vLLM precomputes inputs_embeds outside forward_context for multimodal
models, causing VIT layers to be incorrectly routed by FC1/FC2 dispatch
to context-dependent ops. Since the context is not yet set, _EXTRA_CTX
is empty and FC1/FC2 flags are unavailable → crash.
Add "vision_model" not in prefix guards on three dispatch paths:
- SP column-parallel dispatch (SequenceColumnParallelOp)
- SP row-parallel dispatch (SequenceRowParallelOp)
- FlashComm2 row-parallel dispatch (Flashcomm2OProjRowParallelOp)
No user-facing changes. VL models crashed on startup with FC1/FC2
enabled before the fix; after the fix they run correctly.Text-only
models are unaffected (their prefixes do not contain vision_model).
Step3p7 VL model, 8× Ascend NPU, TP=8, FC1+FC2+MTP all enabled. Before
the fix, the VIT forward phase crashed. After the fix, both PD
disaggregated and PD colocated deployments start correctly and pass
stress testing.
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
Signed-off-by: wangyichao1999 <1543089729@qq.com>
commit 73998d1d896738780f6b9a104123065b5edbff89
Author: Xiaoshuang Wang <1790571317@qq.com>
Date: Fri Jul 10 14:59:21 2026 +0800
[Feature][MRV2] Collapse Eagle decode draft into a single ACL graph capture (#11461)
Previously, each speculative decode step was captured as a separate
graph. This change captures all N-1 draft steps in one unified graph.
This pr also solve the acceptance of FULL Graph.
N/A
**MRV1:**
```
Prompt: 'Who are you?', Generated text: ' What do you do? What do you want to achieve?\nI am a 25-year-old entrepreneur'
--------------------------------------------------
total_num_output_tokens: 20
num_drafts: 13
num_draft_tokens: 26
num_accepted_tokens: 6
mean acceptance length: 1.46
--------------------------------------------------
acceptance at token 0: 0.38
acceptance at token 1: 0.08
acceptance at token 2: 0.00
acceptance at token 3: 0.00
acceptance at token 4: 0.00
acceptance at token 5: 0.00
```
**MRV2:**
```
Prompt: 'Who are you?', Generated text: ' What do you do? What do you want to achieve?\nI am a 25-year-old entrepreneur'
--------------------------------------------------
total_num_output_tokens: 20
num_drafts: 13
num_draft_tokens: 26
num_accepted_tokens: 6
mean acceptance length: 1.46
--------------------------------------------------
acceptance at token 0: 0.38
acceptance at token 1: 0.08
acceptance at token 2: 0.00
acceptance at token 3: 0.00
acceptance at token 4: 0.00
acceptance at token 5: 0.00
```
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: wxsIcey <1790571317@qq.com>
commit 8129beaaff504b7f473980eab954f13b32f44675
Author: SHUAI YANG <shuaiyang047@163.com>
Date: Fri Jul 10 14:26:15 2026 +0800
[BugFix][310P] Fix sdma error caused by asynchronous copy (#11678)
Race Condition Fix: Implemented a blocking host-to-device (H2D) copy in
the rotary position embedding calculation to prevent race conditions
during subsequent indexing on 310P devices.
Model Patching: Updated the Qwen3_VisionTransformer to use the new
rot_pos_emb_310 method specifically for RC devices.
No
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: YangShuai52 <shuaiyang047@163.com>
commit a5a4297ea4eaa279c0c2e9cfb5a3815d552836d6
Author: SHUAI YANG <shuaiyang047@163.com>
Date: Fri Jul 10 14:21:47 2026 +0800
[BugFix][310P] Rollback RC's modification matmul (#11704)
Rollback of RC-specific logic: Removed the conditional branching for RC
devices in the matrix multiplication path within the chunk gated delta
rule implementation.
Code simplification: Standardized the matrix multiplication operation by
removing the redundant RC-specific implementation, reverting to the
unified code path.
No
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: YangShuai52 <shuaiyang047@163.com>
commit abfb0e59f0b8ef7e84b5e903e8a28adaf7394684
Author: boes129 <92016430+boes129@users.noreply.github.com>
Date: Fri Jul 10 14:07:39 2026 +0800
[Feature] Add triton swiglustep kernel for SwigluStep activation (#11467)
Fuses silu+clamp+mul into a single 1D-grid row-loop triton kernel,
following the same launch pattern as swiglu_quant.py / rope.py
(grid=(num_vectorcore,), per-row loop) to minimize host launch overhead.
Numerically equivalent to SwigluStepAndMul.forward_native:
silu-then-clamp on the gate half, +/-limit clamp on the up half.
NPU vector core requires N%16==0 for 32B UB alignment (bf16/fp16);
asserted up front. Real MoE shapes (Step-3.7 N=1280) satisfy this.
Adds a triton kernel for `SwigluStepAndMul`, fusing `silu + clamp + mul`
into a single launch. Uses the same 1D-grid launch pattern as the
existing `swiglu_quant.py` and `rope.py` triton kernels, keeping host
launch overhead minimal.
**Precision**
| shape | bf16 maxdiff | fp16 maxdiff |
| ------------- | ------------ | ------------ |
| (16, 32) | 1.56e-02 | 9.77e-04 |
| (200, 320) | 3.12e-02 | 7.81e-03 |
| (1024,) | 1.56e-02 | 1.95e-03 |
| (8192, 2560) | 6.25e-02 | 7.81e-03 |
| (65536, 2560) | 6.25e-02 | 7.81e-03 |
| (2, 64, 256) | 3.12e-02 | 3.91e-03 |
**Operator-level bench**
| shape | phase | mode | 910B fus(us) | 910B fn/fus | 910C fus(us) |
910C fn/fus |
| ------------- | ------- | ----- | ------------ | ----------- |
------------ | ----------- |
| (64, 1280) | decode | graph | 13.6 | **3.12×** | 22.8 | **2.17×** |
| (512, 1280) | decode | graph | 22.2 | **2.91×** | 24.7 | **2.97×** |
| (2048, 1280) | decode | graph | 53.6 | **2.59×** | 51.5 | **3.07×** |
| (4096, 1280) | prefill | eager | 171.1 | **1.30×** | 77.4 | **2.91×**
|
| (8192, 1280) | prefill | eager | 170.5 | **2.45×** | 138.2 | **2.95×**
|
| (65536, 1280) | prefill | eager | 1642.9 | **2.36×** | 1340.1 |
**2.85×** |
no
24/24 precision cases pass: random bf16/fp16 across shapes, limit sweep,
boundary values (incl. ±inf, nan), golden `+100/-100 → -49.0`.
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
Signed-off-by: boes129 <1198231666@qq.com>
commit 6cd692a8038cc0e8e8c2cd285244b46893f0c715
Author: Qiu <qiuchunshuo@huawei.com>
Date: Fri Jul 10 12:43:14 2026 +0800
[Feature][SFA] Support DCP with replicate-indexer for SFA (#11443)
This PR adds SFA DCP replicate-indexer support for SFA models.
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: nwpu-zxr <zhouxuerong2@huawei.com>
Signed-off-by: QiuChunshuo <qiuchunshuo@huawei.com>
Signed-off-by: QiuChunshuo <chunshuoq@gmail.com>
Co-authored-by: nwpu-zxr <zhouxuerong2@huawei.com>
commit 4ad76e0e92118707d3586459f4b16ac82bb34e6d
Author: Csrayz <33659823+Csrayz@users.noreply.github.com>
Date: Fri Jul 10 11:00:15 2026 +0800
[BugFix][Prefix Caching][DSv4] Align SlidingWindowManager scheduler block size with LCM block size (#11383)
When validated against an agent-scenario dataset, the prefix-cache hit
rate improved rising from 33% to 86%.
The root cause is a unit ambiguity in `AscendHybridKVCacheCoordinator`'s
SWA alignment logic. Since Ascend's `block_size` semantics refer to the
number of **physical slots** rather than the number of tokens (tracked
in vllm-ascend RFC #10517), the `alignment_tokens` value flowing into
`SlidingWindowManager.reachable_block_mask` and
`SlidingWindowManager.find_longest_cache_hit` was previously expressed
in mixed units of `token / max(compression_ratio)`. This produced wrong
block counts when dividing `alignment_tokens` by per-block token
capacity.
This PR unifies the `alignment_tokens` unit across all SWA computations:
the value is now the actual `lcm_block_size` computed by the coordinator
(`self.lcm_block_size` in `verify_and_split_kv_cache_groups()`), and
every SWA manager receives this value as its `scheduler_block_size`. As
a result, `window_size`, `block_size`, and `alignment_tokens` are
uniformly expressed in actual token counts inside both
`reachable_block_mask` and `find_longest_cache_hit`, and the SWA module
maintains consistent unit semantics end-to-end.
No. Behavior is gated by the existing upstream env
`VLLM_PREFIX_CACHE_RETENTION_INTERVAL` (vLLM PR #43447). When unset,
`reachable_block_mask` returns the dense default and no SWA block
selection changes. When set, the WRITE/READ paths now use the same
alignment granularity instead of the previous mixed-unit one.
Validated in DeepSeek-V4 Flash (mtp=1):
- **Prefix-cache hit rate** on an agent-scenario dataset: 33%(main) →
86%(this pr)
- **SWA block cache occupation**:
- groups 2 and 3: full retention → 9/256
- group 4: 1/4 → 1/512
- group 5: full retention → 1/32
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: Csrayz <33659823+Csrayz@users.noreply.github.com>
commit ce6752a194a581ef6ada2c54e2b9b07c26ea67d2
Author: Qi Mao <maomaoyu870@gmail.com>
Date: Thu Jul 9 21:37:59 2026 -0500
[BugFix][Ops] Preserve symbolic shapes in kv quant sparse flash attention meta (#11778)
Fix the post-merge symbolic-shape CI regression from #11626.
`npu_kv_quant_sparse_flash_attention_meta` used concrete `.size()`
values, `SmallVector<int64_t>`, and `at::empty()` for tensor-derived
output shapes. This patch preserves symbolic dimensions end-to-end with
`sym_size()`, `c10::SymDimVector`, and `at::empty_symint()`, matching
the adjacent sparse-flash-attention meta implementation.
The operator kernel and runtime output contract are unchanged.
Root cause: #11626's original CI completed before #11345 added the
symbolic-meta check to `main`. #11626 then merged after #11345, so a
later full pre-commit run on top of main correctly detected the meta
implementation.
No. This only fixes meta-dispatch symbolic-shape handling for the
existing internal custom op.
- `python tools/check_symbolic_meta.py csrc/torch_binding_meta.cpp`
- `git diff --check`
- `uvx --from pre-commit==4.0.1 pre-commit run --hook-stage manual
--files csrc/torch_binding_meta.cpp`
Also ran the full manual pre-commit suite. All checks relevant to this
change passed; the suite still reports pre-existing actionlint findings
in unrelated `.github/workflows/` files.
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
Signed-off-by: maoxx241 <maomaoyu870@gmail.com>
commit 254121657e7640d183d39b5d724a24fb279c4001
Author: XUE TONGYAO <xuetongyao2001@gmail.com>
Date: Fri Jul 10 10:04:03 2026 +0800
[feature] Support Gemma4 ModelSlim quantization (#11575)
This PR adds ModelSlim W8A8_DYNAMIC quantization support for Gemma4 /
Gemma4 text models.
For Gemma4 full-attention `k_eq_v` layers, the ModelSlim quant
description contains `q_proj` and `k_proj`, but does not contain a
dedicated `v_proj` entry. The model loader duplicates `k_proj` into
`v_proj` at load time, while the Ascend ModelSlim packed `qkv_proj`
lookup previously required all `q_proj` / `k_proj` / `v_proj` quant
entries to exist. As a result, loading a Gemma4 quantized checkpoint
could fail with `KeyError` on the missing `v_proj.weight` quant
description key.
This PR handles only that known missing-`v_proj` case when both `q_proj`
and `k_proj` quant entries are present, so other malformed packed quant
descriptions still keep the original failure behavior.
This PR also adds Gemma4-scoped ModelSlim mapping for MoE expert layers.
vLLM routes the FusedMoE module through a `.moe.experts` prefix, while
the ModelSlim quant description keeps the checkpoint-style `.experts`
naming. The added prefix mapping is scoped to `gemma4` / `gemma4_text`,
avoiding a global `.experts` rewrite that could affect other model
types.
Related issue/RFC: N/A.
No. This only extends ModelSlim quantization config handling for Gemma4
quantized checkpoints. Existing non-Gemma4 logic is preserved, and
missing packed shards still raise as before except for the Gemma4
`k_eq_v` missing-`v_proj` layout described above.
- `python3 -m ruff check vllm_ascend/quantization/modelslim_config.py
tests/ut/quantization/test_modelslim_config.py`
- `python3 -m ruff format --check
vllm_ascend/quantization/modelslim_config.py
tests/ut/quantization/test_modelslim_config.py`
- `python3 -m py_compile vllm_ascend/quantization/modelslim_config.py
tests/ut/quantization/test_modelslim_config.py`
- `git diff --check`
Unit coverage was added for:
- Gemma4 `k_eq_v` missing-`v_proj` handling.
- Preserving the existing error behavior for other missing packed
shards.
- Gemma4 MoE expert prefix mapping.
- Keeping the MoE expert prefix adaptation scoped to Gemma4 / Gemma4
text.
Not run locally:
- `python3 -m pytest tests/ut/quantization/test_modelslim_config.py -q`,
because the current local Python environment is missing `torch`.
Base references used during development:
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: 0moyi0-2024 <0moyi0-2024@users.noreply.github.com>
Signed-off-by: xuetongyao <xuetongyao2001@gmail.com>
Co-authored-by: 0moyi0-2024 <0moyi0-2024@users.noreply.github.com>
commit cc348a087aaee1e5bccf0c3260f57336984f30c8
Author: wyc1999 <76724714+wangyichao1999@users.noreply.github.com>
Date: Fri Jul 10 09:57:38 2026 +0800
[Feature] Adapt FlashComm1 SP for Step3.5 (#9597)
Adapt FlashComm1 (SP) in vllm-ascend for the Step3.5 model with two
fixes in `linear_op.py`:
**1. Add `share_expert` prefix matching (3 places)**
Step3.5 names its shared expert weights with `share_expert` (no trailing
's'), but the original code only matches `shared_expert` /
`shared_experts`. This causes shared_expert layers to incorrectly
participate in SP column/row parallel ops. Added `share_expert` matching
in `_get_column_parallel_op`, `_get_row_parallel_op`, and
`get_parallel_op`.
**2.Add "g_proj" to SP column-parallel**
Add "g_proj" to SP column-parallel dispatch prefixes for Step3p5
attention gate projection. Without this, the g_proj layer falls through
to None and does not participate in sequence parallelism, causing a
shape mismatch at the residual addition.
No.
Tested on Ascend 910B with Step3.5 Flash model (MoE, W8A8, TP=8).
Verified that shared_expert layers are correctly skipped and `g_proj`
participates in SP column-parallel
dispatch. Model runs without errors when
`VLLM_ASCEND_ENABLE_FLASHCOMM1=1`.
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: wangyichao1999 <1543089729@qq.com>
Co-authored-by: earthmanylf <yulinfeng2@huawei.com>
commit eb0ce34e98ea66d83482d1573283fb98afa93b83
Author: 0moyi0 <39132733+0moyi0-2024@users.noreply.github.com>
Date: Fri Jul 10 09:55:37 2026 +0800
[BugFix][FusedMoE] Use model activation instead of SwiGLU in quantized MoE MLP (in-branch variant) (#11732)
`quant_apply_mlp` hardcoded SwiGLU: every quantized MoE layer ran
through the fused SwiGLU+quant NPU ops
(`npu_grouped_matmul_swiglu_quant` / `npu_dequant_swiglu_quant` /
`npu_swiglu`) regardless of the model's configured activation. Models
that use GELU (e.g. Gemma4, `activation='gelu_tanh'`) therefore ran the
wrong activation in their quantized experts, while the float path
(`unquant_apply_mlp`) already dispatched correctly — causing a large
accuracy drop.
This PR adds GELU handling at the existing non-fused activation dispatch
sites (W4A16 antiquant and W8A8/W4A8 int-quant) and guards the fused
SwiGLU+quant sub-branches (`use_w4a8_per_channel_gmm_swiglu`,
`_custom_gmm_swiglu_enabled`, `use_gmm_swiglu_quant_fusion`, and the MC2
entry) with `and not is_gelu_activation`, so GELU activations fall
through to the non-fused `GMM -> GELU -> (re)quant -> GMM2` path. GELU
reuses the existing GMM1/GMM2 calls (no duplication); SwiGLU models keep
their original fused paths unchanged.
This is the **in-branch/guard variant** — minimal diff (+16/-4), reuses
existing GMM calls. It is an alternative to #11609 (early-return
variant, +84/-0, fully isolated). Correctness is equivalent; the two
differ in tradeoff: this one touches 4 existing branch conditions
(smaller diff) while #11609 is pure addition (zero impact on existing
SwiGLU logic, larger diff).
No API change. Quantized MoE models using GELU (e.g. Gemma4) now use the
correct activation instead of SwiGLU — an accuracy fix.
Unit tests: `tests/ut/ops/test_moe_mlp_gelu.py` (12 tests, all NPU ops
mocked, run on CPU):
- W8A8/W4A8 int-quant: gelu_tanh vs gelu (approximate tanh/none) math,
dequant GMM1 form, requant + GMM2 wiring, scale_bias handling (bias
propagation, group_list_type 0->1), w1_scale dtype cast.
- W4A16 antiquant layout: antiquant GMM1 -> gelu*up -> antiquant GMM2,
no requant.
- **Guard coverage**: fusion-on + GELU must skip
`npu_grouped_matmul_swiglu_quant`; MC2 + GELU must skip the MC2 fused
branch (`npu_dequant_swiglu_quant`). Both tests fail if the `and not
is_gelu_activation` guards are removed.
- No-impact: silu / swiglustep / swigluoai do not enter the GELU path;
`unified_apply_mlp` forwards `gelu_tanh` to `quant_apply_mlp`.
- Existing `tests/ut/ops/test_moe_mlp.py` still passes (8 tests).
Manual testing on A5 (Ascend 950PR) with `gemma-4-26b-a4b-it-w8a8`
(W8A8_DYNAMIC, gelu_tanh), TP=4: GPQA Diamond (198q) improved from
0.5404 (SwiGLU) to 0.7121 (GELU).
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: 0moyi0-2024 <1261320835@qq.com>
commit 2352a42ff8c4fa6d49da234b670781001135b0a7
Author: Zhichao Chen <35361287+czc-unac@users.noreply.github.com>
Date: Fri Jul 10 09:46:32 2026 +0800
[CI] Resources for ubuntu-latest are tight and need to be replaced with self-hosted runners (#11465)
Resources for ubuntu-latest are tight and need to be replaced with
self-hosted runners
`label_doctest.yml` is tested by running relative jobs。
Test link:
https://github.com/vllm-project/vllm-ascend/actions/runs/29008757671/job/86086785084?pr=11719
`schedule_release_code_and_wheel.yml` is tested by running relative
jobs。
Test link:
https://github.com/vllm-project/vllm-ascend/actions/runs/29008757671/job/86086785190?pr=11719
`schedule_vllm_e2e_test.yaml` is tested by running relative acitons。
Test link:
https://github.com/vllm-project/vllm-ascend/actions/runs/28990040754/job/86027616190?pr=11617
`schedule_nightly_test_a3.yaml` and `schedule_weekly_test_a3.yaml` is
tested by running relative acitons and jobs。
Test link:
https://github.com/vllm-project/vllm-ascend/actions/runs/29008757671/job/86086785095?pr=11719
https://github.com/vllm-project/vllm-ascend/actions/runs/29008757671/job/86086903470?pr=11719
https://github.com/vllm-project/vllm-ascend/actions/runs/28990040754/job/86027616206?pr=11617
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: Chen zhichao <chenzhichao33@h-partners.com>
Co-authored-by: Chen zhichao <chenzhichao33@h-partners.com>
commit e22a6bf06da688a4246b2b8a9f62db858d4309e2
Author: Wang Yixuan <88923622+hust17yixuan@users.noreply.github.com>
Date: Fri Jul 10 09:46:22 2026 +0800
[BugFix] w4a4mxfp quant_matmul shape error (#11573)
The w4a4mxfp quantization is broken by #11068, the .contiguous()
operation will cause the mismatch in the quant_matmul ops and it is also
redundant in #11068 function.
No
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
---------
Signed-off-by: hust17yixuan <303660421@qq.com>
commit 064fb9a7dc17639975e343c4a81bab4f75c51f36
Author: Li Zimeng <immengzi@outlook.com>
Date: Fri Jul 10 09:35:11 2026 +0800
[Feature][Scheduler] Add ShortRequestFirst scheduling (#11576)
This PR adds a default-off `ShortRequestFirst` scheduling policy to
reduce prefill head-of-line blocking under mixed prompt-length
workloads.
Under the default FCFS-style waiting behavior, a long prefill request at
the front of the queue can delay shorter prefills behind it and increase
their TTFT. This change introduces a length-aware waiting queue for the
recompute scheduler so shorter prefills can be admitted earlier while
still preserving bounded fairness for long requests.
The main changes are:
- add `additional_config["short_request_first_config"]` with:
- `enabled`: turns the policy on or off
- `threshold`: defines the short/long prompt-token boundary
- `long_max_wait_ms`: bounds long-request starvation by allowing aged
long requests to bypass waiting short requests after the configured max
wait
- add a `ShortRequestFirstRequestQueue` with three lanes:
- `immediate`: requests that must stay ahead of length-based ordering
- `short`: requests with `num_prompt_tokens <= threshold`
- `long`: requests with `num_prompt_tokens > threshold`
- keep scheduler-critical requests ahead of the length-based queues:
- immediate requests
- recovery / requeue requests from recompute scheduling
- wire the policy into `RecomputeScheduler` when
`short_request_first_config.enabled=true`
- validate and document the new user-facing config and behavior
This design is intentionally additive and conservative:
- it is opt-in and default-off
- it only changes waiting-queue admission order for prefill requests
- it keeps recovery traffic ahead of normal short/long prioritization
- it provides a starvation bound for long requests instead of allowing
short requests to dominate indefinitely
Yes.
This PR adds a new user-facing scheduling option in
`additional_config["short_request_first_config"]` for Ascend users
running with the recompute scheduler. When enabled, short prefill
requests may be scheduled ahead of longer waiting prefills, which can
improve TTFT for short prompts under mixed prompt-length traffic.
It also adds user documentation describing:
- when to use `ShortRequestFirst`
- the meaning of `enabled`, `threshold`, and `long_max_wait_ms`
- the expected scheduling behavior and fairness tradeoffs
Added and updated unit tests for config parsing, queue behavior,
scheduler integration, and scheduler-visible ordering behavior:
- `tests/ut/test_ascend_config.py`
- validates `short_request_first_config` defaults, overrides, and
invalid values
- `tests/ut/core/test_short_request_first_scheduler.py`
- validates short/long classification
- validates dispatch priority across `immediate`, `short`, and `long`
- validates `long_max_wait_ms` aging / starvation-bound behavior
- `tests/ut/core/test_short_request_first_scheduler_mixin.py`
- validates recompute recovery requests are routed to the immediate lane
- validates non-recovery requests still follow length-based
classification
- `tests/ut/core/test_recompute_scheduler_short_request_first.py`
- validates `RecomputeScheduler` wiring when the feature is enabled
- validates scheduling order and long-request promotion behavior in
scheduler flow
Also updated the user docs in:
- `docs/source/user_guide/configuration/additional_config.md`
- `docs/source/user_guide/feature_guide/short_request_first.md`
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
Signed-off-by: immengzi <immengzi@outlook.com>
commit 8d808fdde1f704402a95662a3357bbecfe053fa6
Author: fangrongcan <60131170+Eric-dot@users.noreply.github.com>
Date: Fri Jul 10 09:29:59 2026 +0800
[Ascend950][Bugfix]Fix allgatherEP MXFPW4A8 quantization (#11663)
This PR fixes the allgatherEP W4A8_MXFP4 quantization path on Ascend
950.
For `torch.float8_e4m3fn` inputs, the previous logic cast `topk_weights`
to the same dtype as the hidden states. However, routing weights should
not be forced to float8 for the downstream fused experts kernel. This PR
skips the float8 cast for `topk_weights` and enables the bf16-compatible
MXFP execution mode when the input dtype is `torch.float8_e4m3fn`.
This is needed to make W4A8_MXFP4 MoE inference work correctly with
allgatherEP quantization on Ascend 950.
- vLLM version: v0.23.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/1f486d96a17303ce8db8e02be39545b2be338446
Signed-off-by: fangrongcan <17343701736@163.com>
commit 432743d8393ec5b2725ac7ae6dacccf32992d2e1
Author: Qi Mao <maomaoyu870@gmail.com>
Date: Thu Jul 9 20:24:53 2026 -0500
[BugFix][Ops] Move GDN conv1d metadata to device tensors (#11161)
Related RFC issue: Refs #11723
This PR moves the metadata inputs used by Ascend GDN
`npu_causal_conv1d_custom` from host materialized arguments to optional
device tensors. The goal is to remove hidden host synchronization in GDN
+ async scheduling + MTP paths, especially for cache indices,
accepted-token counts, query start locations, and initial-state flags.
Key changes:
- Changes `query_start_loc_opt`, `cache_indices_opt`,
`initial_state_mode_opt`, and `num_accepted_tokens_opt` to optional
Tensor inputs in the Python schema and C++ binding.
- Removes `ValueDepend` and per-element host reads for these metadata
inputs in the AscendC op host path.
- Lets the AscendC kernels read dtype-native metadata directly on
device: `query_start_loc` supports int32/int64, `cache_indices` and
`num_accepted_tokens` support int32/int64, and `initial_state_mode`
supports bool/int32/int64.
- Keeps GDN metadata dtype-native at the Python boundary, avoiding
runtime casts from upstream int32/bool metadata.
- Keeps GDN cache indices on the upstream device block-table path, so
async MTP no longer depends on CPU block-table or CPU seq-len correction
for conv1d cache index construction.
- Aligns chunked-prefill metadata with the vLLM community fields from
the current vllm-ascend verified main commit
(`b9a7cd464c9ae9b1b450f8982b76d7be4de73724`), including
`prefill_query_start_loc`, `prefill_state_indices`, and
`prefill_has_initial_state`.
- Uses one common GDN conv1d device-metadata path for A2/A3/A5/310P. The
old conv1d graph-param update hook, host-argument compatibility path,
and 310P buffer-replay monkeypatch are removed.
- Fixes FULL_DECODE_ONLY + MTP GDN spec conv1d metadata to keep request
granularity for `query_start_loc`, `state_indices`, and
`num_accepted_tokens` instead of padding those tensors to token
granularity.
- Simplifies `gdn_attn_builder.py` by replacing the custom chunk-meta
pool/shape/fill path with existing FLA helper construction, and removes
the now-unused `gdn_chunk_meta` Triton helper and standalone nightly
coverage entry.
No. This is an internal Ascend GDN/custom-op metadata path change.
Current PR head `6b7f65bb3` local checks:
- `git diff --check`
- `python -m py_compile vllm_ascend/ops/gdn.py
vllm_ascend/ops/gdn_attn_builder.py vllm_ascend/_310p/ops/fla/gdn_310.py
vllm_ascend/_310p/ops/gdn_attn_builder_310.py
vllm_ascend/patch/worker/patch_idex_310.py`
Latest post-rebase remote/NPU validation at current PR head `6b7f65bb3`
with vLLM `v0.23.0`:
- Rebuilt custom ops from the current PR checkout and generated
`_build_info.py` on A5, 310P, and A3. `build_ext --inplace`, `build_py`,
and the focused `py_compile` check above all completed successfully on
each platform.
- A5, Qwen3.6 35B A3B W8A8 MXFP8, TP=2, async scheduling + MTP, 40
semantic GPQA-style p…
…ect#11865) ### What this PR does / why we need it? 1. The operator obtains data from slot_mapping.cpu instead of slot_mapping.gpu. This is because slot_mapping.cpu!=slot_mapping.gpu is transmitted to sfa_v1. 2. Therefore, the `cpu_slotmapping` variable is deleted. It is not used as a placeholder in other places and can be deleted after being checked with the FO. 3. To adapt to aclgraph, the tensor address of the input parameter store_kv_block_metadata is fixed. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? test - vLLM version: v0.23.0 - vLLM main: vllm-project/vllm@1f486d9 --------- Signed-off-by: ZT-AIA <1028681969@qq.com>
…ect#11865) ### What this PR does / why we need it? 1. The operator obtains data from slot_mapping.cpu instead of slot_mapping.gpu. This is because slot_mapping.cpu!=slot_mapping.gpu is transmitted to sfa_v1. 2. Therefore, the `cpu_slotmapping` variable is deleted. It is not used as a placeholder in other places and can be deleted after being checked with the FO. 3. To adapt to aclgraph, the tensor address of the input parameter store_kv_block_metadata is fixed. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? test - vLLM version: v0.23.0 - vLLM main: vllm-project/vllm@1f486d9 --------- Signed-off-by: ZT-AIA <1028681969@qq.com>
…ect#11865) ### What this PR does / why we need it? 1. The operator obtains data from slot_mapping.cpu instead of slot_mapping.gpu. This is because slot_mapping.cpu!=slot_mapping.gpu is transmitted to sfa_v1. 2. Therefore, the `cpu_slotmapping` variable is deleted. It is not used as a placeholder in other places and can be deleted after being checked with the FO. 3. To adapt to aclgraph, the tensor address of the input parameter store_kv_block_metadata is fixed. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? test - vLLM version: v0.23.0 - vLLM main: vllm-project/vllm@1f486d9 --------- Signed-off-by: ZT-AIA <1028681969@qq.com>
…ect#11865) ### What this PR does / why we need it? 1. The operator obtains data from slot_mapping.cpu instead of slot_mapping.gpu. This is because slot_mapping.cpu!=slot_mapping.gpu is transmitted to sfa_v1. 2. Therefore, the `cpu_slotmapping` variable is deleted. It is not used as a placeholder in other places and can be deleted after being checked with the FO. 3. To adapt to aclgraph, the tensor address of the input parameter store_kv_block_metadata is fixed. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? test - vLLM version: v0.23.0 - vLLM main: vllm-project/vllm@1f486d9 --------- Signed-off-by: ZT-AIA <1028681969@qq.com>
What this PR does / why we need it?
cpu_slotmappingvariable is deleted. It is not used as a placeholder in other places and can be deleted after being checked with the FO.Does this PR introduce any user-facing change?
No
How was this patch tested?
test