Skip to content

[CI] main2main-0716 - #12133

Closed
zhao-stack wants to merge 25 commits into
vllm-project:mainfrom
zhao-stack:codex/m2m-0716-latest-main
Closed

[CI] main2main-0716#12133
zhao-stack wants to merge 25 commits into
vllm-project:mainfrom
zhao-stack:codex/m2m-0716-latest-main

Conversation

@zhao-stack

@zhao-stack zhao-stack commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

What this PR does / why we need it?

Upgrade baseline

  • Advance the verified vLLM main anchor from 85c09e9885e346ea1612da30ebff5a75f67d2350 to 915dffaa5f93f55b44c8ac630b472700d131e165. The complete upstream range is available in this 85c09e98...915dffaa comparison.
  • This branch was built on the July 14 main2main work at 382bbd51448b2f58c73b3e51d051bc352166ba91; the incremental July 14-to-16 range is available in this 382bbd51...915dffaa comparison. The first link above remains the authoritative full diff against the PR base.
  • Preserve the vLLM v0.24.0 release lane while adapting the main lane only where upstream changed a signature, return value, field, hashing rule, model protocol, or graph-capture interface.
  • The initial CI round changed only the verified commit ID. Follow-up production fixes are limited to failures traced to concrete upstream changes. The workflow changes are diagnostic-only and do not change runtime behavior.
  • The 30 changed files are documented below in PR file order. Each cohesive modification point links to the exact upstream PR diff when one exists and to the exact vllm-ascend PR diff line. Changes from #46384, #47782, #47867, #47006, #48261, #48390, and #48429 are in the cumulative 85c09e98...915dffaa range but precede the incremental 382bbd51...915dffaa range and were carried from PR11983. HunyuanVL #47872 and GDN #46998 predate 85c09e98 and are explicitly identified as inherited compatibility debt. #48549 is 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.commit
Change Upstream change Downstream adaptation Why it is needed
Update the verified main2main anchor This is not a one-to-one upstream PR. It represents the full 85c09e98...915dffaa upgrade window; the frozen target is 915dffaa. Set the verified anchor to 915dffaa. This file is the source of truth used by the PR workflow to install and test the vLLM main revision.
2. .github/workflows/pr_test.yaml
Change Upstream change Downstream adaptation Why it is needed
Keep both version-lane matrix jobs running after a failure No direct upstream code change; this is CI-only main2main diagnostics. Set strategy.fail-fast: false. A failure in main must not cancel the v0.24.0 lane, or vice versa, so the first diagnostic run exposes the complete lane-specific failure set.
3. .github/workflows/scripts/run_selected_tests.sh
Change Upstream change Downstream adaptation Why it is needed
Continue after an individual pytest target fails No direct upstream code change; this is CI-only main2main diagnostics. Record the target failure in overall_status instead of exiting immediately. The shard can execute every selected target and print one consolidated failure summary while still exiting non-zero at the end.
Continue after a batched pytest invocation fails No direct upstream code change; this is the batched counterpart of the same diagnostic policy. Record the batch status and defer the final exit. CPU/batched selections now expose all failures without masking the job result; the script still exits with overall_status after printing the summary.
4. tests/e2e/conftest.py
Change Upstream change Downstream adaptation Why it is needed
Remove swap_space from VllmRunner vLLM #48549 deletes the LLM compatibility shim that silently removed and warned about swap_space. Remove the helper parameter and stop forwarding it to LLM. The keyword is no longer consumed by LLM and reaches EngineArgs, which rejects it with TypeError; it was already deprecated and ignored, so removing it has no runtime semantic loss.
Remove swap_space from DPVllmRunner The same vLLM #48549 constructor cleanup affects the data-parallel helper. Remove the DP helper parameter and stop adding it to llm_kwargs. DPVllmRunner ultimately constructs the same upstream LLM, so it must follow the same cleaned constructor contract.
Supply only the native Hunyuan image token vLLM #47872 switches HunyuanVL to the native Transformers processor and lets the non-cached path wrap a raw image token only when no start/end wrapper is already present. It predates 85c09e98 and is inherited compatibility context. The direct main-lane contract change is vLLM #47867: Hunyuan _get_prompt_updates now owns the complete image_start + expanded image tokens + image_end replacement. #47867 is in the full 85c09e98...915dffaa range, precedes the incremental 382bbd51...915dffaa range, and was carried from PR11983. Pass only the raw <|hy_place▁holder▁no▁102|> image token, leaving wrapper construction and image-token expansion to the active vLLM lane. On the cached main path, prompt replacement matches only the raw 102. Keeping the legacy pre-wrapped 100 + 102 + 101 input would retain its outer 100/101 while inserting another complete sequence, producing 100 + (100 + 102×N + 101) + 101; a raw 102 becomes exactly 100 + 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.py
Change Upstream change Downstream adaptation Why it is needed
Make grouped-hash assertions version-aware vLLM #45939 changes the existing BlockHashListWithBlockSize view to reuse the terminal chained fine-grained hash, whose lookup uses the last chained fine-grained hash for each larger block. Import the lane helper and expect a custom grouped digest on v0.24.0 but the terminal chained hash on main. The release lane retains vllm-ascend's historical rehashing; main must mirror upstream's chained-hash semantics.
Cover main-lane grouped string hashes The same #45939 terminal-hash rule. Expect ['b', 'd'] on main before retaining the existing v0.24.0 digest assertions. This verifies the main implementation selects the final chained hash of each two-hash group for string hashes.
Cover main-lane grouped byte hashes The same #45939 terminal-hash rule. Expect [b'b', b'd'] on main before retaining the release digest/length assertions. This proves the same contract for the byte-hash form used by cache metadata.
6. tests/ut/distributed/ascend_store/test_coordinator.py
Change Upstream change Downstream adaptation Why it is needed
Make the fake manager version-aware vLLM #46384 changes both hash resolution and the manager return protocol on main. Import vllm_version_is. One fake must model the old v0.24.0 contract and the new main contract in the two CI lanes.
Resolve compressed-group hashes at manager level on main vLLM #46384 moves block-size hash resolution into each manager and reads block_pool.hash_block_size. Make the fake select the final chained fine-grained hash for each logical compressed block on main. The fake must exercise the same effective hash granularity as the real upstream-derived manager instead of receiving pre-grouped hashes.
Return the exact cache-hit length on main vLLM #46384 widens find_longest_cache_hit to return cached blocks plus the exact hit length and the full-attention implementation returns that pair. Keep the blocks-only return on v0.24.0 and return (computed, hit_length) on main. Main can report partial hits that cannot be reconstructed solely as len(blocks) * block_size; the release lane still expects the legacy shape.
Give the external block-pool test double its hash granularity The #46384 manager now reads block_pool.hash_block_size. Pass 128 in the compressed-hit test, effective-ratio test, and missing-group test. ExternalCachedBlockPool is a duck-typed BlockPool; every test construction must expose the attribute consumed by manager-level hash resolution.
7. tests/ut/distributed/ascend_store/test_pool_worker.py
Change Upstream change Downstream adaptation Why it is needed
Initialize the worker fixture's hash granularity This is the test-only companion to #46384's manager-level use of block_pool.hash_block_size, not an independent upstream API change. Set worker.hash_block_size = 128. The helper is instantiated with 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.py
Change Upstream change Downstream adaptation Why it is needed
Define the mocked model-config state used by logits initialization vLLM #48390 makes LogitsProcessor.__init__ read the active VllmConfig.model_config to derive head_dtype. Set mock_vllm_config.model_config = None. The unit test intentionally exercises the default/no-model-config path; an unconstrained MagicMock would synthesize a false head dtype.
Install and clean up the real current-config context #48390 both reads the active config during initialization and adds the _apply_head projection path. Enter set_current_vllm_config(...) and register its __exit__ with addCleanup. Patching only the defining module no longer reaches the accessor imported by upstream LogitsProcessor; using the supported context makes the config visible everywhere and prevents state leakage.
9. tests/ut/patch/platform/test_prefix_cache_cp_patches.py
Change Upstream change Downstream adaptation Why it is needed
Stop passing the removed num_prompt_tokens keyword vLLM #47782 replaces SlidingWindowManager.reachable_block_mask(..., num_prompt_tokens=...) with reachable_boundaries. Delete num_prompt_tokens=None from the direct unit-test call. The test covers LCM-aligned sparse-mask behavior and does not need a replay boundary; omitting the optional keyword works on v0.24.0 and avoids TypeError on main.
10. tests/ut/patch/worker/test_patch_qwen3_5_mtp.py
Change Upstream change Downstream adaptation Why it is needed
Model the non-sequence-parallel MTP layer contract explicitly vLLM #47006 adds use_attn_reduce_scatter_for_moe to Qwen3_5DecoderLayer, and vLLM #48429 makes the MTP forward path branch on it before gathering full tokens. Set the mocked second layer's flag to False. An unset MagicMock attribute is truthy and would spuriously exercise the sequence-parallel gather path. False matches this unit's intended ordinary TP path while the downstream patched forward mirrors the new upstream branch.
11. tests/ut/test_compressed_prefix_cache.py
Change Upstream change Downstream adaptation Why it is needed
Normalize compressed-manager hit results in both tests vLLM #46384 changes single-type find_longest_cache_hit from blocks-only to (blocks, exact_hit_length). Import the version helper, then normalize the result in the miss case and hit case. The assertions still compare the first group's blocks; only the release/main return envelope differs.
Normalize the hybrid-coordinator result vLLM #47782 expands the coordinator result to (blocks, hit_length, num_uncached_common_prefix_tokens) and returns the third value for hybrid caches. Unpack two values on v0.24.0 and three on main. The test intentionally verifies blocks and reconciled hit length; the new shared-prefix hint is not part of this assertion.
12. vllm_ascend/core/recompute_scheduler.py
Change Upstream change Downstream adaptation Why it is needed
Consume the version-specific computed-block result vLLM #47782 changes KVCacheManager.get_computed_blocks from a pair to a triple and returns shared_prefix_boundary. Import cast and vllm_version_is and unpack two values on v0.24.0 or three on main, storing the boundary on the request. The recompute scheduler copies this part of upstream scheduling and must preserve the sparse-retention boundary used for Marconi-style prefix reuse.
13. vllm_ascend/core/scheduler_profiling_chunk.py
Change Upstream change Downstream adaptation Why it is needed
Consume the version-specific computed-block result The same vLLM #47782 pair-to-triple change supplies the shared-prefix boundary. Import cast and vllm_version_is and apply the same two-lane unpacking. The profiling-chunk scheduler is another downstream copy of the scheduling path and must not lose the main-lane boundary hint.
14. vllm_ascend/core/single_type_kv_cache_manager.py
Change Upstream change Downstream adaptation Why it is needed
Adapt compressed-cache allocation arguments vLLM #46384 inserts num_local_computed_tokens into get_num_blocks_to_allocate. Accept both tokens arguments as optional and remap the old fifth positional argument on v0.24.0, then forward the correct version-specific signature after applying the compression ratio. The release lane's fifth argument is main-model tokens, while main requires both local-hit and main-model token counts.
Use manager-owned hash resolution on main vLLM #46384 moves raw/fine-grained hash resolution into the manager through block_pool.hash_block_size. Widen the return type and choose the release block size or main pool hash size when grouping compressed hashes. Main may resolve hits inside a physical block; pre-grouping at the coordinator would erase that granularity.
Return exact token hit length on main The new #46384 finder protocol carries exact token length. Compute the compressed logical hit length, return blocks-only on v0.24.0, and (blocks, hit_length) on main. A partial hit length cannot always be reconstructed as len(blocks) * block_size.
15. vllm_ascend/distributed/kv_transfer/kv_pool/ascend_store/config_data.py
Change Upstream change Downstream adaptation Why it is needed
Preserve upstream chained-hash identity on main vLLM #46384 moves raw/fine-grained hash resolution into each manager and constructs the grouped view only when needed at the manager boundary. Add the version boundary and select the last fine-grained chained hash for every larger block on main; retain the historical rehash on v0.24.0. AscendStore external keys must mirror the existing upstream BlockHashListWithBlockSize grouped 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.py
Change Upstream change Downstream adaptation Why it is needed
Expose hash granularity through the external pool #46384's manager now reads block_pool.hash_block_size. Add hash_block_size to the duck-typed ExternalCachedBlockPool and supply it in mask construction. External existence checks must satisfy the same pool contract as local cache lookup.
Let main managers resolve raw hashes vLLM #46384 removes coordinator pre-grouping before manager lookup. Return raw hashes on main and keep release-side pre-grouping. Pre-grouping would prevent main from finding fine-grained partial hits.
Carry exact hit lengths through single and hybrid lookup #46384 makes the finder return exact length and tracks lengths per group in the upstream fixed-point algorithm. Use the returned length for a single group, track it per group in hybrid lookup, and trim full blocks with cdiv. Token-level partial hits must retain the physical block covering the hit tail and must not be rounded down during reconciliation.
Normalize old and new manager return envelopes The #46384 manager protocol returns (blocks, hit_length). Keep the existing EAGLE keyword fallback, derive length from block count on v0.24.0, and use exact returned length on main. This isolates the return-shape difference at one helper while preserving existing EAGLE compatibility.
17. vllm_ascend/distributed/kv_transfer/kv_pool/ascend_store/pool_scheduler.py
Change Upstream change Downstream adaptation Why it is needed
Read the version-specific cache hash field vLLM #46384 renames the cache configuration field to prefix_match_unit. Read hash_block_size on v0.24.0 or prefix_match_unit on main, with the existing fallback to the smallest group block size. The scheduler derives the external-store key granularity from this upstream config object.
18. vllm_ascend/distributed/kv_transfer/kv_pool/ascend_store/pool_worker.py
Change Upstream change Downstream adaptation Why it is needed
Read the version-specific cache hash field vLLM #46384 renames the field to prefix_match_unit. Use hash_block_size on v0.24.0 or prefix_match_unit on main. Worker-side external key construction must use the same granularity as the scheduler.
Pass the granularity into external lookup The #46384 manager expects block_pool.hash_block_size. Construct ExternalCachedBlockPool with the worker's resolved hash block size. Manager-level lookup cannot resolve larger blocks correctly without the fine-grained hash size.
19. vllm_ascend/ops/gdn.py
Change Upstream change Downstream adaptation Why it is needed
Separate the common Ascend computation from the versioned public protocol vLLM #46998 removes the preallocated output parameter and makes GDN forward return a tensor. This protocol predates 85c09e98; the change here completes inherited downstream adaptation. Move the common NPU computation into _forward_ascend and make it return the projected tensor. One implementation can serve both public signatures without duplicating the NPU attention path.
Expose the correct forward contract in each lane The same #46998 tensor-return contract applies on main. Keep output-buffer/None behavior on v0.24.0 and return the tensor directly on main. The monkey-patched method must match the caller's exact argument and return protocol in both supported lanes.
20. vllm_ascend/ops/vocab_parallel_embedding.py
Change Upstream change Downstream adaptation Why it is needed
Preserve main-lane head_dtype projection semantics vLLM #48390 adds LogitsProcessor._apply_head to honor an fp32 head_dtype. Add a versioned _apply_head: direct quant-method application on v0.24.0 and delegation to upstream on main. Calling quant_method.apply directly on main bypasses the new dtype conversion and can produce logits with the wrong head dtype.
Route both Ascend projection paths through the helper Upstream #48390 routes _get_logits through _apply_head. Use the helper in the lmhead-TP path and ordinary path. Both custom Ascend paths must share the same release/main projection behavior.
21. vllm_ascend/patch/__init__.py
Change Upstream change Downstream adaptation Why it is needed
Update the Hunyuan compatibility-registration documentation to the current release lane No one-to-one upstream hunk; this is downstream documentation/version-lane maintenance. The historical context is vLLM #47872's native processor loader and vLLM #47867 removing the bundled processor registry. Replace the v0.23.0 references with v0.24.0 in both the lane description and compatibility strategy. The comments must describe the versions actually exercised by CI. There is no registration or runtime behavior change.
22. vllm_ascend/patch/hunyuan_vl_processor_compat.py
Change Upstream change Downstream adaptation Why it is needed
Install the main-lane loader even when no stale registry entry exists vLLM #47867 removes the old processor export and its lazy-registry entries; the loader protocol originates in vLLM #47872. Make stale-entry cleanup unconditional but remove the early return when cleanup is a no-op. Having nothing stale to delete is the expected main state after #47867; it must not prevent installation of the compatible Hunyuan processor loader.
23. vllm_ascend/patch/platform/patch_kv_cache_coordinator.py
Change Upstream change Downstream adaptation Why it is needed
Enable and preserve partial hash hits vLLM #46384 enables partial hits for aligned Mamba layouts and uses cdiv when trimming the covering physical block. Compute enable_partial_hash_hits and trim full-attention blocks with cdiv. A token hit can end inside an effective block; flooring would discard the physical block that covers the valid partial-hit tail.
Use raw hashes and exact manager hit lengths on main #46384 passes raw hashes to each manager and changes the finder to return (blocks, exact_hit_length) (Mamba implementation). Keep coordinator-side hash conversion only on v0.24.0 and consume blocks plus exact length on main. Main's manager owns fine-grained lookup; release retains the old pre-grouped, blocks-only protocol.
Track exact length per attention group #46384 tracks each group's token length during fixed-point reconciliation. Store hit_length_by_group, bound a reused full-attention result with that exact length, and update it with every manager result. Reconstructing length from block count destroys partial-hit precision and can make the fixed point accept the wrong prefix.
Return the main-lane uncached-common-prefix hint vLLM #47782 expands the hybrid coordinator result to three values and computes the new hint as the longest group hit minus the reconciled hit. Widen the return type, track the longest group hit, and return two values on v0.24.0 or the third hint on main. The schedulers in files 12 and 13 need the hint to retain a shared-prefix junction that a sparse group has not cached yet.
Mirror the new lookup protocol in per-group PD lookup There is no one-to-one upstream find_longest_cache_hit_per_group; it is an Ascend PD-disaggregation extension. Its manager protocol is driven by vLLM #46384. Apply release/main hash selection, exact per-group lengths, and cdiv trimming throughout the per-group implementation, including the finder call and final trim. The existing PD-specific rule that skips Mamba stays unchanged, but all remaining groups must obey the same exact-length contract as normal lookup.
24. vllm_ascend/patch/platform/patch_mamba_manager.py
Change Upstream change Downstream adaptation Why it is needed
Use the new upstream Mamba finder on main vLLM #46384 adds fine-grained Mamba lookup and returns (blocks, hit_length). Add the version boundary, delegate to upstream on main, and retain the existing blocks-only finder on v0.24.0. Reusing upstream avoids duplicating the new fine-grained state lookup while preserving the frozen release behavior.
Adapt Mamba allocation and external-hit detection #46384 adds num_local_computed_tokens to Mamba allocation. Accept and remap the two token counts by version, then base external-token detection on exact local-hit tokens. Counting blocks is insufficient for a partial local hit and can reserve the wrong extra block for synchronously loaded external KV.
25. vllm_ascend/patch/worker/patch_qwen3_5.py
Change Upstream change Downstream adaptation Why it is needed
Avoid a duplicate Qwen3Next gather under Ascend FlashComm vLLM #47006 introduces sequence-parallel reduce-scatter, the _all_gather_hidden_and_residual helper, and model-level gathers before non-RS layers. On main, wrap the helper so FlashComm leaves the sharded tensors for Ascend's patched linear layer to gather; delegate to upstream for non-FlashComm. FlashComm already owns this communication. Gathering first in the model and again in the column-parallel projection expanded the active-mask token dimension from 64 to 256 in TP4. This is the validated final fix carried from PR11983.
Restore full tokens before the final Qwen3.5 MTP norm vLLM #48429 saves the selected MTP layer and gathers after a reduce-scatter layer. Save mtp_layer and use the original upstream gather helper before final norm when the layer used MoE reduce-scatter. Final normalization requires the complete token set, regardless of the FlashComm wrapper used in the model-level transition.
Preserve upstream main's Qwen decoder state machine vLLM #47006 adds all-gather/reduce-scatter transitions to the decoder forward path. Apply the older Ascend Qwen3_5DecoderLayer.forward override only on v0.24.0. Overwriting main's new decoder method would remove its sequence-parallel state machine.
Install the private Ascend GDN helper on the patched upstream class vLLM #46998 is the historical tensor-return GDN contract; it predates 85c09e98. Patch _forward_ascend together with forward. The new version-specific forward method in file 19 calls this downstream helper; registering only forward would leave the upstream instance without the helper.
26. vllm_ascend/patch/worker/patch_v2/patch_eagle_speculator.py
Change Upstream change Downstream adaptation Why it is needed
Patch the unified speculative graph-manager symbol vLLM #48261 replaces the separate prefill/decode managers with one SpeculatorCudaGraphManager. Import EagleAclGraphManager and assign it to the single new upstream symbol. The two old class names no longer exist on main, so patch registration must follow the merged interface.
27. vllm_ascend/worker/v2/spec_decode/dflash/speculator.py
Change Upstream change Downstream adaptation Why it is needed
Forward target runner buffers and attention groups from DFlash vLLM #48261 extends DFlash set_attn with target_input_buffers and target_attn_groups. Match the new parameters and pass them unchanged to super().set_attn. Draft-prefill capture must rebuild metadata through the target runner's persistent buffers and builders; the existing Ascend int32 slot-mapping initialization remains unchanged.
28. vllm_ascend/worker/v2/spec_decode/dspark/speculator.py
Change Upstream change Downstream adaptation Why it is needed
Forward target runner buffers and attention groups from DSpark DSpark inherits the DFlash contract, so there is no independent upstream DSpark hunk. The source is vLLM #48261's DFlash signature and base storage of the target fields. Match and forward both new parameters. The inherited capture path needs the target buffers; the later Ascend int32 conversion stays unchanged.
29. vllm_ascend/worker/v2/spec_decode/eagle/aclgraph.py
Change Upstream change Downstream adaptation Why it is needed
Merge the two Ascend graph managers and remove AttentionStatePair vLLM #48261 unifies the manager class and stops returning attention-state pairs from generic capture. Import the new generic/unified types, delete the state-pair prefill class, and rename the remaining implementation to EagleAclGraphManager. The deleted upstream classes/types cannot be imported, and reusing prebuilt metadata is the stale-state bug fixed by #48261.
Use the unified superclass for prefill capture #48261 rebuilds metadata for every warmup and capture pass. Within the Ascend communicator/model-capture context, delegate prefill to the unified superclass. This preserves Ascend graph setup while adopting fresh target-runner metadata.
Adapt the Ascend decode factory to the new generic capture contract #48261 changes the factory to return only a callable and refreshes inputs inside every factory call (unified manager). Refresh inputs with the existing PIECEWISE skip_attn rule, return only the Ascend forward lambda, and invoke generic CudaGraphManager.capture. Decode retains its Ascend-specific forward signature but must no longer return or reuse stale attention-state objects.
30. vllm_ascend/worker/v2/spec_decode/eagle/speculator.py
Change Upstream change Downstream adaptation Why it is needed
Update imports and the set_attn contract vLLM #48261 removes AttentionStatePair from base capture and stores the target buffers/groups in set_attn. Replace the deleted import with InputBuffers and AttentionGroup, then accept and forward the two target-runner arguments. Eagle needs the same target-owned persistent buffers as the other speculators; existing Ascend backend collection remains unchanged.
Capture without a prebuilt attention-state map Upstream autoregressive capture becomes parameterless and passes target state into the unified manager. Change capture to take no attention-state argument and pass model state, target input buffers, block tables, target attention groups, and KV config to the prefill manager. Each capture descriptor now rebuilds metadata from the same persistent buffers used at runtime, eliminating stale shared-buffer contents.

Compatibility and review notes

  • Version gates are limited to real contract differences between vLLM v0.24.0 and 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.py is intentionally unchanged in the final PR. The temporary local-version normalization was reverted as over-broad; version checks keep their existing strict behavior.
  • The two workflow changes only improve main2main diagnostics. They preserve a non-zero job result while allowing every version lane and every selected target in a shard to finish.
  • The Qwen3Next FlashComm change is the final fix from PR11983, synchronized here after confirming the cause against vLLM #47006: the upstream model-level gather and Ascend's FlashComm-aware column-parallel gather were both executing. The wrapper skips only the first gather under FlashComm and preserves upstream behavior otherwise.
  • No other speculative fix was added for an unexplained CI failure. Every production change above is tied to an upstream contract or is explicitly labeled inherited compatibility debt/downstream-only logic.
  • All PR-file links above are anchored to head 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.

  • The verified main lane advances to vLLM 915dffaa.
  • The v0.24.0 release lane remains supported through narrowly scoped version gates.
  • Main adopts the new partial-prefix-cache, shared-prefix-retention, fp32 lm-head, Qwen sequence-parallel, and MRV2 speculative graph-capture contracts described above.
  • The removed swap_space test-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_space TypeError, 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 an xActiveMask length 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-tests passed, 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.0

  • vLLM main: vllm-project/vllm@915dffa

zhao-stack and others added 22 commits July 16, 2026 06:52
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>
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:‌‌

  • A PR should do only one thing, smaller PRs enable faster reviews.
  • Every PR should include unit tests and end-to-end tests ‌to ensure it works and is not broken by other future PRs.
  • Write the commit message by fulfilling the PR description to help reviewer and future developers understand.

If CI fails, you can run linting and testing checks locally according Contributing and Testing.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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

  • Dependency Update: Retargeted the vLLM main branch snapshot to the frozen July 16, 2026 version (commit 915dffaa5f93f55b44c8ac630b472700d131e165).
  • Version Compatibility: Introduced a vllm_version_is utility to implement conditional logic for v0.24.0 compatibility across various components.
  • API Refactoring: Updated set_attn signatures and refactored EagleAclGraphManager to align with upstream vLLM changes.
  • Cache Coordinator Updates: Modified ExternalCachedBlockPool and cache coordinator logic to support new hash-size resolution patterns.
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
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/pr_test.yaml
    • .github/workflows/scripts/run_selected_tests.sh
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

Suggested PR Title:

[Attention][Feature] Support compatibility with vLLM 0.24.0 and older versions

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

Comment thread vllm_ascend/utils.py Outdated
Comment on lines +592 to +594
vllm_public_version = Version(Version(vllm_version).public)
target_public_version = Version(Version(target_vllm_version).public)
return vllm_public_version == target_public_version

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

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.

Suggested change
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:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

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.

Suggested change
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):

shenzhao added 3 commits July 16, 2026 12:08
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>
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@zhao-stack zhao-stack closed this Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant