Skip to content

[CI] main2main vllm 0814 cdc4824 - #14131

Open
zhangxinyuehfad wants to merge 13 commits into
vllm-project:mainfrom
zhangxinyuehfad:zxy_main2main_0814
Open

[CI] main2main vllm 0814 cdc4824#14131
zhangxinyuehfad wants to merge 13 commits into
vllm-project:mainfrom
zhangxinyuehfad:zxy_main2main_0814

Conversation

@zhangxinyuehfad

@zhangxinyuehfad zhangxinyuehfad commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

What this PR does / why we need it?

The PR adapts vllm-ascend for compatibility with the latest vLLM main (commit cdc4824a).

Files Upstream vLLM change vllm-ascend adaptation
.github/vllm-main-verified.commit Updated verified main commit hash from 58d3918 to cdc4824a21
tests/e2e/pull_request/two_card/lora/test_qwen3moe_lora.py Added @wait_until_npu_memory_free() decorator to test_qwen3moe_lora_ep and test_qwen3moe_lora_multi_id_ep
tests/ut/kv_offload/test_native_cpu_offload.py vllm#49165OffloadingParallelConfig constructor added data_parallel_size and data_parallel_rank_local params Version-gated via vllm_version_is("0.27.1"): else branch adds data_parallel_size=1, data_parallel_rank_local=None to OffloadingParallelConfig
tests/ut/ops/test_routed_experts.py vllm#51838 — Removed is_internal_router branch from DeepseekV2MoE; RoutedExperts.expert_map reads quant_method.moe_kernel Sets routed_experts.quant_method = SimpleNamespace(moe_kernel=None) on mock when not 0.27.1
tests/ut/patch/platform/test_patch_structured_output.py vllm#51458_create_grammar passes stop_token_ids kwarg and reads sampling_params.all_stop_token_ids Version-gated FakeBackend.compile_grammar signature (0.27.1: no stop_token_ids; main: accepts **kwargs); make_request sets sampling_params.all_stop_token_ids = None on main
tests/ut/patch/worker/test_patch_mamba_utils_source.py vllm#49436 — Added TEMPORAL_TILES constexpr to postprocess_mamba_fused_kernel AST test refactored: _postprocess_kernels() recursively collects both version-gated kernel definitions; _selected_kernel_source() selects by version; main branch asserts TEMPORAL_TILES, tile_idx, if tile_idx == 0: present
tests/ut/spec_decode/test_extract_hidden_states_proposer.py vllm#51458 — Removed PIN_MEMORY from extract_hidden_states.py _no_pin_memory fixture version-gated: 0.27.1 patches PIN_MEMORY=False; main patches torch.zeros to strip pin_memory kwarg
vllm_ascend/_310p/fused_moe/grouped_topk_router.py vllm#51838 — main _forward_impl recomputes router_logits as fp32, which may be in FRACTAL_NZ format on 310P Version-gated: when not 0.27.1, casts router_logits to torch.float16 before npu_moe_gating_top_k_softmax (DT_FLOAT16 + ND required)
vllm_ascend/__init__.py Removed os.getenv("VLLM_VERSION") version gate from triton gluon/_aggregate stubs after rebase; stubs now applied unconditionally at module load
vllm_ascend/attention/dsa_v1.py vllm#49731 — upstream renamed block_size to storage_block_size in DSA metadata builder Changed self.block_size to self.storage_block_size in build_dspark_swa_indices call
vllm_ascend/models/deepseek_v4/model.py vllm#47808 — DSpark/EAGLE spec decode requires _mtp_hidden_buffer only for EAGLE/draft methods, not MTP-only _mtp_hidden_buffer allocation gated on get_pp_group().is_last_rank and needs_mtp_hidden_states (EAGLE or draft model, not MTP)
vllm_ascend/models/qwen3_dspark.py vllm#47808 — DSpark confidence-scheduled verification; upstream load_weights already manages confidence_head __init__ gates confidence_head creation with vllm_version_is("0.27.1"); load_weights on main delegates directly to super().load_weights(all_weights)
vllm_ascend/ops/fused_moe/fused_moe.py vllm#51838 — Removed is_internal_router branch from DeepseekV2MoE.forward, always passes router_logits=hidden_states is_internal_router property version-gated: 0.27.1 checks hasattr(gate, "weight_fp32"); main checks only self.gate is not None. Entire _forward_impl duplicated: main branch recomputes router_logits via gate even in no-shared-experts path, falls back to gate.weight.to(torch.float32) when weight_fp32 absent
vllm_ascend/ops/triton/mamba/postprocess.py vllm#49436 — Added TEMPORAL_TILES constexpr parameter Dual kernel definitions: 0.27.1 branch uses 2D grid, no TEMPORAL_TILES; main branch uses 3D grid, temporal copy partitioned across CTAs, conv state copies only on tile_idx == 0, num_accepted_tokens store split into nested ifs
vllm_ascend/patch/__init__.py Added documentation entries for new patch_vision.py (FusedInputNorm eps) and patch_distributed.py (GroupCoordinator/HCCL registry) patches
vllm_ascend/patch/platform/patch_kv_cache_coordinator.py vllm#50062get_kv_cache_coordinator added num_prefill_lookahead: int = 0 param; KVCacheCoordinator base class added self.num_reprefillable_tokens AscendHybridKVCacheCoordinator.__init__, _build_kv_cache_coordinator, get_kv_cache_coordinator all version-gated: main branch adds num_prefill_lookahead param and sets self.num_reprefillable_tokens
vllm_ascend/patch/platform/patch_vision.py vllm#51734 — upstream rewrote FusedInputNorm.forward to use multiply-add instead of F.batch_norm, removing the eps>0 requirement Module-level auto-patch gated on vllm_version_is("0.27.1"): replaces FusedInputNorm.forward to use eps=1e-5 instead of eps=0.0 for NPU F.batch_norm compatibility
vllm_ascend/patch/worker/patch_distributed.py vllm#47288 — upstream GroupCoordinator.__init__ added use_all2all: bool = False param Replaces GroupCoordinator with GroupCoordinatorPatch accepting use_all2all; uses HCCL PG registry for process group deduplication; wraps destroy_distributed_environment to clear registry
vllm_ascend/patch/worker/patch_qwen3_5.py vllm#50685 — Removed _all_gather_hidden_and_residual from qwen3_next; SP all-gather inlined into decoder layer Module-level import and monkey-patch gated with vllm_version_is("0.27.1"); qwen3_5_mtp_forward: 0.27.1 uses _all_gather_hidden_and_residual, main uses tensor_model_parallel_all_gather
vllm_ascend/worker/v2/aclgraph_utils.py vllm#47808 — DSpark confidence-scheduled verification added varlen_decode to CudaGraphManager ModelAclGraphManager.__init__ version-gated: main branch adds varlen_decode: bool = False parameter
vllm_ascend/worker/v2/input_batch.py vllm#47808InputBatch added max_query_len: int | None = None field seq_lens_np field version-gated: 0.27.1 has no default, main branch = None; make_dummy classmethod also version-gated: main branch adds max_query_len parameter
vllm_ascend/worker/v2/model_runner.py vllm#47808 + vllm#51865execute_model added context_len; prepare_inputs added batch_req_state/has_prefill; sort_batch_req_ids added draft_tokens; graph_manager_wrapper added varlen_decode execute_model: main passes context_len; prepare_inputs: fully duplicated, main accepts batch_req_state, passes has_prefill, updated sort_batch_req_ids signature; graph_manager_wrapper: main adds varlen_decode; module-level BatchReqState import gated on not vllm_version_is("0.27.1")

Does this PR introduce any user-facing change?

How was this patch tested?

@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 tracked commit hash for the vllm main branch within the CI configuration. This ensures that the continuous integration environment remains aligned with the latest verified state of the repository.

Highlights

  • CI Commit Update: Updated the verified commit hash for the vllm main branch to b1b7520 to ensure CI synchronization.
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/** (1)
    • .github/workflows/pr_test.yaml
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

This pull request updates the verified vLLM commit hash in .github/vllm-main-verified.commit to b1b752042f622c692d5019c3ea122f2f7ee9d6ac. The reviewer provided a suggestion for the PR title and summary to align with the repository's style guide.

Comment thread .github/vllm-main-verified.commit Outdated
@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.

@zhangxinyuehfad zhangxinyuehfad changed the title [CI] main2main vllm 08012 b1b7520 [CI] main2main vllm 0812 b1b7520 Aug 12, 2026
@zhangxinyuehfad
zhangxinyuehfad force-pushed the zxy_main2main_0814 branch 2 times, most recently from 0c564e1 to dcdd284 Compare August 18, 2026 06:13
@zhangxinyuehfad zhangxinyuehfad changed the title [CI] main2main vllm 0812 b1b7520 [CI] main2main vllm 0814 cdc4824 Aug 18, 2026
@zhangxinyuehfad
zhangxinyuehfad force-pushed the zxy_main2main_0814 branch 3 times, most recently from 8c25f77 to 22d3a6b Compare August 19, 2026 11:05
@github-actions

Copy link
Copy Markdown
Contributor

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

@wangxiyuan wangxiyuan removed the ready label Aug 20, 2026
@zhangxinyuehfad zhangxinyuehfad added ready-all run all e2e test for pr and removed ready-all run all e2e test for pr labels Aug 21, 2026
@zhangxinyuehfad

zhangxinyuehfad commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator Author

/e2e tests/e2e/pull_request/four_card/_310p/test_moe_model_310p.py::test_qwen3_moe_tp2_w8a8
[Bot]: e2e command triggered. See workflow run for details.

@zhangxinyuehfad zhangxinyuehfad added the ready-all run all e2e test for pr label Aug 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

Signed-off-by: hfadzxy <starmoon_zhang@163.com>
vLLM #50685 removed _all_gather_hidden_and_residual from
�llm.model_executor.models.qwen3_next and inlined the
sequence-parallel all-gather/reduce-scatter logic into the decoder
layer, breaking the unconditional import at module load.

Gate the symbol import, the _ascend_all_gather_hidden_and_residual
monkey-patch, and the MTP gather path with �llm_version_is('0.27.1'):
- v0.27.1: keep the original monkey-patch behavior unchanged
- main: skip the removed helper and use the new upstream inline flow
  (	ensor_model_parallel_all_gather after norm)

Signed-off-by: hfadzxy <starmoon_zhang@163.com>
….1')

vLLM main (cdc4824a21) added max_query_len: int | None = None to the
InputBatch dataclass (vllm#47808), making the child
AscendInputBatch's non-default seq_lens_np field follow a default
argument, which raises TypeError at class definition time.

Use vllm_version_is('0.27.1') to conditionally give seq_lens_np a
default value on main only, satisfying Python dataclass field ordering
while keeping v0.27.1 behavior unchanged.

Signed-off-by: hfadzxy <starmoon_zhang@163.com>
… compat

vLLM main (cdc4824a21) added
um_prefill_lookahead: int = 0 to
get_kv_cache_coordinator (vllm#50062), breaking the patched function
in vllm-ascend which rejected the unexpected keyword argument.

Refactor into a shared _build_kv_cache_coordinator impl with

um_prefill_lookahead: int | None = None, and two version-specific
wrappers gated by �llm_version_is('0.27.1'):
- v0.27.1: signature without num_prefill_lookahead (not forwarded)
- main: signature with num_prefill_lookahead (forwarded to upstream)

Signed-off-by: hfadzxy <starmoon_zhang@163.com>
Adapt unit tests to vLLM main (cdc4824a21) while keeping v0.27.1
behavior, gated by vllm_version_is('0.27.1'):

- test_extract_hidden_states_proposer.py: vLLM #51458 removed PIN_MEMORY
  from extract_hidden_states.py; gate the patch to v0.27.1 only
- test_patch_structured_output.py: vLLM main's _create_grammar passes
  stop_token_ids kwarg and reads sampling_params.all_stop_token_ids;
  version-gate FakeBackend.compile_grammar signature and mock field
- test_routed_experts.py: vLLM main's RoutedExperts.expert_map reads
  quant_method.moe_kernel; version-gate the quant_method mock

Signed-off-by: hfadzxy <starmoon_zhang@163.com>
…LM main

Adapt vllm-ascend to vLLM main (cdc4824a21) while keeping v0.27.1
behavior, using vllm_version_is('0.27.1') gates.

Upstream breaks:
- vllm#47808 ([Spec Decode] DSpark confidence-scheduled verification)
  added context_len to execute_model, varlen_decode to CudaGraphManager,
  max_query_len to InputBatch.make_dummy, draft_tokens to
  sort_batch_req_ids, and confidence_head to Qwen3DSparkModel
- vllm#51865 ([Bugfix][MRV2] Require all requests to be decoding for
  uniform-decode dispatch) added batch_req_state to prepare_inputs and
  has_prefill to InputBatch

Changes:
- model_runner.py: execute_model accepts context_len; graph_manager_wrapper
  factory accepts varlen_decode; prepare_inputs accepts batch_req_state and
  passes has_prefill; sort_batch_req_ids passes draft_tokens
- aclgraph_utils.py: ModelAclGraphManager.__init__ accepts varlen_decode
- input_batch.py: AscendInputBatch.make_dummy accepts max_query_len
- qwen3_dspark.py: delegate confidence_head to upstream load_weights

Signed-off-by: hfadzxy <starmoon_zhang@163.com>
Upstream breaks:
- vllm#49436: added TEMPORAL_TILES constexpr to postprocess_mamba_fused_kernel
- vllm#51838: removed DeepseekV2MoE gate branch, always passes
  router_logits=hidden_states
- vllm#51458: removed PIN_MEMORY from extract_hidden_states.py

Changes:
- postprocess.py: single TEMPORAL_TILES-aware kernel, 3D grid tile_idx,
  split chained and into nested ifs, temporal copy tiling
- fused_moe.py: version-gate is_internal_router with vllm_version_is
- test_patch_mamba_utils_source.py: reflect single-kernel layout
- test_extract_hidden_states_proposer.py: version-gate PIN_MEMORY fixture
  and torch.zeros pin_memory patch for CPU UT

Signed-off-by: hfadzxy <starmoon_zhang@163.com>
vLLM main (cdc4824a21) added
um_prefill_lookahead to
get_kv_cache_coordinator and self.num_reprefillable_tokens to the
KVCacheCoordinator base class (vllm#50062). The upstream cache_blocks()
now reads self.num_reprefillable_tokens, but AscendHybridKVCacheCoordinator
overrides __init__ without calling super().__init__(), so the attribute
was never set and cache_blocks raised AttributeError.

Define version-specific AscendHybridKVCacheCoordinator.__init__ and
_build_kv_cache_coordinator gated by vllm_version_is('0.27.1'):
- v0.27.1: unchanged (upstream cache_blocks does not use the attribute)
- main: accept num_prefill_lookahead and set num_reprefillable_tokens

Signed-off-by: hfadzxy <starmoon_zhang@163.com>
…erts

vLLM main (cdc4824a21) removed the is_internal_router branch in both
DeepseekV2MoE.forward and Qwen3MoeSparseMoeBlock.forward (vllm#51838),
always passing router_logits=hidden_states. AscendMoERunner only
recomputed router_logits via the gate when ascend_shared_experts was
present; for models without shared experts (e.g. Qwen3-MoE) the wrong
shaped hidden_states was used as router_logits, producing invalid
topk_ids and EP all_to_all_single split-size mismatches.

Define version-specific _forward_impl gated by vllm_version_is('0.27.1'):
- v0.27.1: unchanged, no shared-expert path does not recompute
- main: recompute router_logits via gate in the shared-experts-None path
  too, falling back to gate.weight when weight_fp32 is absent

Signed-off-by: hfadzxy <starmoon_zhang@163.com>
Signed-off-by: hfadzxy <starmoon_zhang@163.com>
Upstream PR #51734 (dc5101fb1b, Aug 10) rewrote FusedInputNorm.forward
to use a broadcast multiply-add (x * weight + bias) instead of
F.batch_norm, removing the running_mean/running_var buffers. That commit
is included in the target 16cfe728, where the old patch crashed with
AttributeError: 'FusedInputNorm' object has no attribute 'running_mean'.

Gate install_patch() with vllm_version_is('0.27.1') so newer versions
use the upstream multiply-add forward as-is. On v0.27.1 FusedInputNorm
does not exist, so the import still fails gracefully under
contextlib.suppress.

Signed-off-by: hfadzxy <starmoon_zhang@163.com>
Signed-off-by: hfadzxy <starmoon_zhang@163.com>
@zhangxinyuehfad
zhangxinyuehfad force-pushed the zxy_main2main_0814 branch 4 times, most recently from 639b174 to 55f3eb6 Compare August 21, 2026 15:11
vLLM main (cdc4824a21, vllm#51838) removed the gate branch in
Qwen3MoeSparseMoeBlock.forward and always passes router_logits=hidden_states.
AscendMoERunner._forward_impl recomputes router_logits as fp32 via
F.linear(hidden_states_fp32, gate.weight.to(torch.float32)). On 310P the
gate weight is stored in NZ format, so the recomputed fp32 tensor may be
in a non-ND format, and npu_moe_gating_top_k_softmax fails with error
161002 (expected x(DT_FLOAT, ND)).

v0.27.1 passes bf16 router_logits directly and works, so only cast to
fp32 for non-0.27.1 versions to keep behavior compatible.

Signed-off-by: hfadzxy <starmoon_zhang@163.com>
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.

2 participants