[CI] main2main-0716 - #12133
Conversation
Signed-off-by: zhao-stack <2020265299@qq.com>
Signed-off-by: zhao-stack <2020265299@qq.com>
Signed-off-by: zhao-stack <2020265299@qq.com>
Signed-off-by: zhao-stack <2020265299@qq.com>
Signed-off-by: zhao-stack <2020265299@qq.com>
Signed-off-by: shenzhao <shenzhao9@huawei.com>
Signed-off-by: shenzhao <shenzhao9@huawei.com>
Signed-off-by: shenzhao <shenzhao9@huawei.com>
Signed-off-by: shenzhao <shenzhao9@huawei.com>
Adapt the Ascend Eagle, DFlash, and DSpark integrations to the vLLM #48261 unified speculative graph manager, fresh capture metadata, argument-free capture, and extended set_attn protocol. Upstream-Commit: 26587f9519e22a5c4549ead7595ad9ca3229c4fd Signed-off-by: shenzhao <shenzhao9@huawei.com>
Signed-off-by: shenzhao <shenzhao9@huawei.com>
Preserve the production portion of the CI-observed vLLM #46998 output protocol adaptation and install the required Ascend forward helper. Keep the v0.24.0 release output-buffer contract while returning tensors on the frozen main target. Signed-off-by: shenzhao <shenzhao9@huawei.com>
Preserve the CI-observed main2main prompt adaptation after vLLM began wrapping the native image token with start and end markers. Avoid duplicating the wrapper in the existing Hunyuan E2E input. Signed-off-by: shenzhao <shenzhao9@huawei.com>
Signed-off-by: shenzhao <shenzhao9@huawei.com>
Signed-off-by: shenzhao <shenzhao9@huawei.com>
Signed-off-by: shenzhao <shenzhao9@huawei.com>
Signed-off-by: shenzhao <shenzhao9@huawei.com>
Align the main lane with vLLM #47006 and #48429 while preserving the v0.24.0 decoder wrapper. Signed-off-by: shenzhao <shenzhao9@huawei.com>
Signed-off-by: zhao-stack <2020265299@qq.com>
Signed-off-by: zhao-stack <2020265299@qq.com>
Signed-off-by: zhao-stack <2020265299@qq.com>
Signed-off-by: shenzhao <shenzhao9@huawei.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. |
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 updates the vLLM dependency snapshot to a specific frozen state from July 16, 2026. To maintain compatibility with both older versions and the new v0.24.0 release, extensive conditional logic has been added throughout the codebase. These changes ensure that the Ascend-specific optimizations, such as KV cache management and speculative decoding, remain functional while adapting to upstream API shifts. 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. Ignored Files
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] Support compatibility with vLLM 0.24.0 and older versionsSuggested PR Summary:
### What this PR does / why we need it?
This pull request introduces compatibility support for both vLLM version 0.24.0 and older versions across various modules, including KV cache management, coordinators, operators, and speculators. It updates version-checking utilities, refactors speculator attention setups, and adjusts tests to handle version-specific API signatures and return types.
Additionally, two feedback items are provided:
1. In `vllm_ascend/utils.py`, using `.public` on the `Version` object retains pre-release/dev tags, which can break version-specific compatibility checks on development snapshots. It is recommended to use `.base_version` instead.
2. In `vllm_ascend/patch/worker/patch_qwen3_5.py`, accessing `mtp_layer.use_attn_reduce_scatter_for_moe` directly can raise an `AttributeError` if the attribute is missing. It is safer to use `getattr` with a default value.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
The changes are covered by updating existing unit tests in `tests/ut/` and end-to-end tests in `tests/e2e/` to handle version-specific behavior.| vllm_public_version = Version(Version(vllm_version).public) | ||
| target_public_version = Version(Version(target_vllm_version).public) | ||
| return vllm_public_version == target_public_version |
There was a problem hiding this comment.
Using .public on the Version object retains pre-release/dev tags (e.g., 0.24.0.dev160 vs 0.24.0), which causes vllm_version_is("0.24.0") to return False on development snapshots. This will break version-specific compatibility paths and lead to runtime errors. Using .base_version instead will correctly match the release version regardless of dev/pre-release tags.
| vllm_public_version = Version(Version(vllm_version).public) | |
| target_public_version = Version(Version(target_vllm_version).public) | |
| return vllm_public_version == target_public_version | |
| vllm_base_version = Version(vllm_version).base_version | |
| target_base_version = Version(target_vllm_version).base_version | |
| return vllm_base_version == target_base_version |
| } | ||
| ) | ||
|
|
||
| if not _IS_VLLM_RELEASE and mtp_layer.use_attn_reduce_scatter_for_moe: |
There was a problem hiding this comment.
Accessing mtp_layer.use_attn_reduce_scatter_for_moe directly can raise an AttributeError if the attribute is missing on the layer object (e.g., in mock environments or different upstream versions). Using getattr with a default value of False is safer and prevents potential runtime crashes.
| if not _IS_VLLM_RELEASE and mtp_layer.use_attn_reduce_scatter_for_moe: | |
| if not _IS_VLLM_RELEASE and getattr(mtp_layer, "use_attn_reduce_scatter_for_moe", False): |
vLLM #48549 removed LLM's compatibility shim for the deprecated and ignored swap_space keyword. Stop forwarding it from VllmRunner and DPVllmRunner. Signed-off-by: shenzhao <shenzhao9@huawei.com>
Signed-off-by: shenzhao <shenzhao9@huawei.com> (cherry picked from commit 68f7c48)
Signed-off-by: shenzhao <shenzhao9@huawei.com>
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
What this PR does / why we need it?
Upgrade baseline
85c09e9885e346ea1612da30ebff5a75f67d2350to915dffaa5f93f55b44c8ac630b472700d131e165. The complete upstream range is available in this85c09e98...915dffaacomparison.382bbd51448b2f58c73b3e51d051bc352166ba91; the incremental July 14-to-16 range is available in this382bbd51...915dffaacomparison. The first link above remains the authoritative full diff against the PR base.v0.24.0release lane while adapting the main lane only where upstream changed a signature, return value, field, hashing rule, model protocol, or graph-capture interface.#46384,#47782,#47867,#47006,#48261,#48390, and#48429are in the cumulative85c09e98...915dffaarange but precede the incremental382bbd51...915dffaarange and were carried from PR11983. HunyuanVL#47872and GDN#46998predate85c09e98and are explicitly identified as inherited compatibility debt.#48549is the only upstream change in the July 14-to-16 increment that directly required a new downstream code change in this PR.Changes by file
1.
.github/vllm-main-verified.commit85c09e98...915dffaaupgrade window; the frozen target is915dffaa.915dffaa.2.
.github/workflows/pr_test.yamlstrategy.fail-fast: false.3.
.github/workflows/scripts/run_selected_tests.shoverall_statusinstead of exiting immediately.overall_statusafter printing the summary.4.
tests/e2e/conftest.pyswap_spacefromVllmRunnerLLMcompatibility shim that silently removed and warned aboutswap_space.LLM.LLMand reachesEngineArgs, which rejects it withTypeError; it was already deprecated and ignored, so removing it has no runtime semantic loss.swap_spacefromDPVllmRunnerllm_kwargs.DPVllmRunnerultimately constructs the same upstreamLLM, so it must follow the same cleaned constructor contract.85c09e98and is inherited compatibility context. The direct main-lane contract change is vLLM #47867: Hunyuan_get_prompt_updatesnow owns the completeimage_start + expanded image tokens + image_endreplacement. #47867 is in the full85c09e98...915dffaarange, precedes the incremental382bbd51...915dffaarange, and was carried from PR11983.<|hy_place▁holder▁no▁102|>image token, leaving wrapper construction and image-token expansion to the active vLLM lane.102. Keeping the legacy pre-wrapped100 + 102 + 101input would retain its outer100/101while inserting another complete sequence, producing100 + (100 + 102×N + 101) + 101; a raw102becomes exactly100 + 102×N + 101. #47872 itself does not re-wrap an already wrapped direct-path prompt because it checks that the wrapper is absent; the duplicate-wrapper risk comes from #47867's cached-path replacement acting on legacy pre-wrapped input.5.
tests/ut/distributed/ascend_store/test_config_data.pyBlockHashListWithBlockSizeview to reuse the terminal chained fine-grained hash, whose lookup uses the last chained fine-grained hash for each larger block.['b', 'd']on main before retaining the existing v0.24.0 digest assertions.[b'b', b'd']on main before retaining the release digest/length assertions.6.
tests/ut/distributed/ascend_store/test_coordinator.pyvllm_version_is.block_pool.hash_block_size.find_longest_cache_hitto return cached blocks plus the exact hit length and the full-attention implementation returns that pair.(computed, hit_length)on main.len(blocks) * block_size; the release lane still expects the legacy shape.block_pool.hash_block_size.128in the compressed-hit test, effective-ratio test, and missing-group test.ExternalCachedBlockPoolis a duck-typedBlockPool; every test construction must expose the attribute consumed by manager-level hash resolution.7.
tests/ut/distributed/ascend_store/test_pool_worker.pyblock_pool.hash_block_size, not an independent upstream API change.worker.hash_block_size = 128.object.__new__; the test must initialize the attribute that production normally derives from configuration before external-cache lookup.8.
tests/ut/ops/test_vocab_parallel_embedding.pyLogitsProcessor.__init__read the activeVllmConfig.model_configto derivehead_dtype.mock_vllm_config.model_config = None.MagicMockwould synthesize a false head dtype._apply_headprojection path.set_current_vllm_config(...)and register its__exit__withaddCleanup.LogitsProcessor; using the supported context makes the config visible everywhere and prevents state leakage.9.
tests/ut/patch/platform/test_prefix_cache_cp_patches.pynum_prompt_tokenskeywordSlidingWindowManager.reachable_block_mask(..., num_prompt_tokens=...)withreachable_boundaries.num_prompt_tokens=Nonefrom the direct unit-test call.TypeErroron main.10.
tests/ut/patch/worker/test_patch_qwen3_5_mtp.pyuse_attn_reduce_scatter_for_moetoQwen3_5DecoderLayer, and vLLM #48429 makes the MTP forward path branch on it before gathering full tokens.False.MagicMockattribute is truthy and would spuriously exercise the sequence-parallel gather path.Falsematches this unit's intended ordinary TP path while the downstream patched forward mirrors the new upstream branch.11.
tests/ut/test_compressed_prefix_cache.pyfind_longest_cache_hitfrom blocks-only to(blocks, exact_hit_length).(blocks, hit_length, num_uncached_common_prefix_tokens)and returns the third value for hybrid caches.12.
vllm_ascend/core/recompute_scheduler.pyKVCacheManager.get_computed_blocksfrom a pair to a triple and returnsshared_prefix_boundary.castandvllm_version_isand unpack two values on v0.24.0 or three on main, storing the boundary on the request.13.
vllm_ascend/core/scheduler_profiling_chunk.pycastandvllm_version_isand apply the same two-lane unpacking.14.
vllm_ascend/core/single_type_kv_cache_manager.pynum_local_computed_tokensintoget_num_blocks_to_allocate.block_pool.hash_block_size.(blocks, hit_length)on main.len(blocks) * block_size.15.
vllm_ascend/distributed/kv_transfer/kv_pool/ascend_store/config_data.pyBlockHashListWithBlockSizegrouped view instead of inventing a different digest after hash resolution moved into the manager.16.
vllm_ascend/distributed/kv_transfer/kv_pool/ascend_store/coordinator.pyblock_pool.hash_block_size.hash_block_sizeto the duck-typedExternalCachedBlockPooland supply it in mask construction.cdiv.(blocks, hit_length).17.
vllm_ascend/distributed/kv_transfer/kv_pool/ascend_store/pool_scheduler.pyprefix_match_unit.hash_block_sizeon v0.24.0 orprefix_match_uniton main, with the existing fallback to the smallest group block size.18.
vllm_ascend/distributed/kv_transfer/kv_pool/ascend_store/pool_worker.pyprefix_match_unit.hash_block_sizeon v0.24.0 orprefix_match_uniton main.block_pool.hash_block_size.ExternalCachedBlockPoolwith the worker's resolved hash block size.19.
vllm_ascend/ops/gdn.pyoutputparameter and makes GDNforwardreturn a tensor. This protocol predates85c09e98; the change here completes inherited downstream adaptation._forward_ascendand make it return the projected tensor.Nonebehavior on v0.24.0 and return the tensor directly on main.20.
vllm_ascend/ops/vocab_parallel_embedding.pyhead_dtypeprojection semanticsLogitsProcessor._apply_headto honor an fp32head_dtype._apply_head: direct quant-method application on v0.24.0 and delegation to upstream on main.quant_method.applydirectly on main bypasses the new dtype conversion and can produce logits with the wrong head dtype._get_logitsthrough_apply_head.21.
vllm_ascend/patch/__init__.py22.
vllm_ascend/patch/hunyuan_vl_processor_compat.py23.
vllm_ascend/patch/platform/patch_kv_cache_coordinator.pycdivwhen trimming the covering physical block.enable_partial_hash_hitsand trim full-attention blocks withcdiv.(blocks, exact_hit_length)(Mamba implementation).hit_length_by_group, bound a reused full-attention result with that exact length, and update it with every manager result.find_longest_cache_hit_per_group; it is an Ascend PD-disaggregation extension. Its manager protocol is driven by vLLM #46384.cdivtrimming throughout the per-group implementation, including the finder call and final trim.24.
vllm_ascend/patch/platform/patch_mamba_manager.py(blocks, hit_length).num_local_computed_tokensto Mamba allocation.25.
vllm_ascend/patch/worker/patch_qwen3_5.py_all_gather_hidden_and_residualhelper, and model-level gathers before non-RS layers.mtp_layerand use the original upstream gather helper before final norm when the layer used MoE reduce-scatter.Qwen3_5DecoderLayer.forwardoverride only on v0.24.0.85c09e98._forward_ascendtogether withforward.forwardmethod in file 19 calls this downstream helper; registering onlyforwardwould leave the upstream instance without the helper.26.
vllm_ascend/patch/worker/patch_v2/patch_eagle_speculator.pySpeculatorCudaGraphManager.EagleAclGraphManagerand assign it to the single new upstream symbol.27.
vllm_ascend/worker/v2/spec_decode/dflash/speculator.pyset_attnwithtarget_input_buffersandtarget_attn_groups.super().set_attn.28.
vllm_ascend/worker/v2/spec_decode/dspark/speculator.py29.
vllm_ascend/worker/v2/spec_decode/eagle/aclgraph.pyAttentionStatePairEagleAclGraphManager.skip_attnrule, return only the Ascend forward lambda, and invoke genericCudaGraphManager.capture.30.
vllm_ascend/worker/v2/spec_decode/eagle/speculator.pyset_attncontractAttentionStatePairfrom base capture and stores the target buffers/groups inset_attn.InputBuffersandAttentionGroup, then accept and forward the two target-runner arguments.captureto take no attention-state argument and pass model state, target input buffers, block tables, target attention groups, and KV config to the prefill manager.Compatibility and review notes
v0.24.0and the verified main commit: cache-manager arguments and return values, hash-field ownership, GDN/logits protocols, Qwen sequence-parallel behavior, and MRV2 speculative graph capture.vllm_ascend/utils.pyis intentionally unchanged in the final PR. The temporary local-version normalization was reverted as over-broad; version checks keep their existing strict behavior.ab30476da06c9f89fd32f1925f77369e96ba35fe. If code is pushed again, the head reference and shifted PR Files line anchors should be refreshed.Does this PR introduce any user-facing change?
Yes. This is a vLLM compatibility update, not a new Ascend public API.
915dffaa.v0.24.0release lane remains supported through narrowly scoped version gates.swap_spacetest-helper argument had already been deprecated and ignored upstream, so its removal does not change engine memory behavior.How was this patch tested?
The first anchor-only CI run exposed the complete initial failure set: 13 leaf failures were the
swap_spaceTypeError, plus the aggregate CI gate. No production change beyond the anchor was included in that round.After removing the obsolete argument, CI run 29470650579 completed with 28 successful jobs, two failed jobs, and two skipped jobs. The only leaf failure was
test_qwen3_next_w8a8dynamic_distributed_mp_flash_comm_tp4, where duplicate gathering produced anxActiveMasklength of 64 against an input length of 256.The same failure was reproduced on PR11983, and PR11983 run 29469977963 passed after the FlashComm-aware gather fix; the Qwen3Next target reported three passing tests.
Final-head validation is E2E run 29492227987.
lint-and-select-testspassed, including pre-commit, mypy, coverage-configuration validation, and test selection. The device matrix was still running when this description was updated; no full-matrix success is claimed yet.vLLM version:
v0.24.0vLLM main: vllm-project/vllm@915dffa