[Bugfix] Check batch-invariance support for every attention backend by yifanFengg · Pull Request #60271 · vllm-project/vllm · GitHub
Skip to content

[Bugfix] Check batch-invariance support for every attention backend - #60271

Merged
yewentao256 merged 3 commits into
vllm-project:mainfrom
yifanFengg:bugfix/batch-invariant-reject-custom-attn
Oct 8, 2026
Merged

yewentao256 merged 3 commits into
vllm-project:mainfrom
yifanFengg:bugfix/batch-invariant-reject-custom-attn

Conversation

@yifanFengg

@yifanFengg yifanFengg commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Overview

With VLLM_BATCH_INVARIANT=1, the attention selector refuses backends that do not declare supports_batch_invariance() ("VLLM batch_invariant mode is not supported for ..."). Models that select their own attention backend never go through the selector, so they start anyway and silently return batch-dependent output. This PR applies the same check to every attention layer when the attention groups are built.

Claims

  • MiniMaxAI/MiniMax-M3 starts in batch-invariant mode on main and the determinism tests report violations (for example 32 of 32 prompts). With this PR the engine refuses to start with the existing error message.
  • Models on the standard backends are unaffected: the determinism tests still pass for Qwen/Qwen3-235B-A22B-Thinking-2507-FP8 (GB300), Qwen/Qwen3-1.7B and deepseek-ai/DeepSeek-V2-Lite-Chat (A10). Every model on the tested list in docs/features/batch_invariance.md uses a standard backend.
  • New unit test for the check.

Validation

GB300 runs: 4x NVIDIA GB300 (SM 10.3), main at 182247257f versus that commit plus this PR's source change. A10 runs: 2x NVIDIA A10 (SM 8.6), main at d09ff77637 plus this PR's source change. One pytest process per test. The blocks are copied from the logs without editing.

1. main: MiniMax-M3 runs in batch-invariant mode and is not batch invariant (tensor-parallel 4)

VLLM_BATCH_INVARIANT=1 VLLM_TEST_MODEL=MiniMaxAI/MiniMax-M3 VLLM_TP_SIZE=4 VLLM_TEST_TP_SIZE=4 VLLM_GPU_MEMORY_UTILIZATION=0.9 python -m pytest -v "tests/v1/determinism/test_batch_invariance.py::test_v1_generation_is_deterministic_across_batch_sizes_with_needle[default-FLASH_ATTN]"
E               Failed: Nondeterministic outputs detected: 5 failed out of 5 trials (max_batch_size=128).
================== 1 failed, 32 warnings in 532.70s (0:08:52) ==================

VLLM_BATCH_INVARIANT=1 VLLM_TEST_MODEL=MiniMaxAI/MiniMax-M3 VLLM_TP_SIZE=4 VLLM_TEST_TP_SIZE=4 VLLM_GPU_MEMORY_UTILIZATION=0.9 python -m pytest -v "tests/v1/determinism/test_batch_invariance.py::test_logprobs_bitwise_batch_invariance_bs1_vs_bsN[16-16-FLASH_ATTN]"
E           Failed: Batch invariance violated in 32/32 prompts. See output above for details.
================== 1 failed, 32 warnings in 116.67s (0:01:56) ==================

2. This PR: the engine refuses to start for MiniMax-M3 in batch-invariant mode

VLLM_BATCH_INVARIANT=1 VLLM_TEST_MODEL=MiniMaxAI/MiniMax-M3 VLLM_TP_SIZE=4 VLLM_TEST_TP_SIZE=4 VLLM_GPU_MEMORY_UTILIZATION=0.9 python -m pytest -v "tests/v1/determinism/test_batch_invariance.py::test_simple_generation[FLASH_ATTN]"
(Worker_TP2 pid=2792149) ERROR 10-06 05:23:45 [multiproc_executor.py:1058] RuntimeError: VLLM batch_invariant mode is not supported for MINIMAX_M3_SPARSE_INDEXER.
================== 1 failed, 32 warnings in 73.05s (0:01:13) ===================

3. This PR: models on the standard backends still pass

# GB300, tensor-parallel 2: VLLM_BATCH_INVARIANT=1 VLLM_TEST_MODEL=Qwen/Qwen3-235B-A22B-Thinking-2507-FP8 VLLM_TP_SIZE=2 VLLM_TEST_TP_SIZE=2 VLLM_GPU_MEMORY_UTILIZATION=0.9
tests/v1/determinism/test_batch_invariance.py::test_simple_generation[FLASH_ATTN] PASSED
================== 1 passed, 16 warnings in 131.31s (0:02:11) ==================
tests/v1/determinism/test_batch_invariance.py::test_v1_generation_is_deterministic_across_batch_sizes_with_needle[default-FLASH_ATTN] PASSED
================== 1 passed, 16 warnings in 197.04s (0:03:17) ==================
# A10: VLLM_BATCH_INVARIANT=1 VLLM_TEST_MODEL=Qwen/Qwen3-1.7B
tests/v1/determinism/test_batch_invariance.py::test_v1_generation_is_deterministic_across_batch_sizes_with_needle[default-FLASH_ATTN] PASSED
================== 1 passed, 17 warnings in 113.06s (0:01:53) ==================
tests/v1/determinism/test_batch_invariance.py::test_simple_generation[TRITON_ATTN] PASSED
======================= 1 passed, 17 warnings in 53.84s ========================
tests/v1/determinism/test_batch_invariance.py::test_simple_generation[FLEX_ATTENTION] PASSED
======================= 1 passed, 17 warnings in 27.90s ========================
# A10, tensor-parallel 2: VLLM_BATCH_INVARIANT=1 VLLM_TEST_MODEL=deepseek-ai/DeepSeek-V2-Lite-Chat
tests/v1/determinism/test_batch_invariance.py::test_simple_generation[TRITON_MLA] PASSED
======================= 1 passed, 17 warnings in 29.12s ========================

4. New unit test (without and with the source change)

python -m pytest -v tests/v1/worker/test_gpu_model_runner_v2.py::test_init_attn_backend_checks_custom_backend_batch_invariance
# main + only the new test
E       Failed: DID NOT RAISE RuntimeError
FAILED tests/v1/worker/test_gpu_model_runner_v2.py::test_init_attn_backend_checks_custom_backend_batch_invariance[False]
=================== 1 failed, 1 passed, 14 warnings in 1.08s ===================
# this PR
======================== 2 passed, 14 warnings in 1.08s ========================

lm_eval and vllm bench serve comparisons are not included because the change is a start-up check only: no kernel or request path is touched, and for the affected model the "after" state is that the engine does not start.

Details

Root cause. supports_batch_invariance() is enforced in vllm/v1/attention/selector.py. Attention layers that set their backend themselves (the model packages under vllm/models/, for example MiniMax-M3's sparse attention and indexer) are not created through the selector, and none of those backends declares support, so batch-invariant mode was accepted for them without any guarantee. I found this by running the determinism suite on MiniMax-M3: it fails on main, and still fails with #59985 applied, so it is not the router issue fixed there.

Change. init_attn_backend already visits the backend of every attention layer; it now raises the selector's error for a backend that does not declare support when VLLM_BATCH_INVARIANT is set. Backends that do support it only need to override supports_batch_invariance().

Trade-offs and limitations.

  • Models with self-selected backends (MiniMax-M3, DeepSeek-V4, Kimi-K3 and similar) now fail fast in batch-invariant mode instead of starting. None of them is on the tested list, and for the one I could test the mode did not hold.
  • Only the Model Runner V2 path is changed; the equivalent loop in the V1 runner is left as is, given its deprecation.
  • This does not make MiniMax-M3 batch invariant; it makes the lack of support explicit.

Pull Request Checklist
  • I used vLLM's /pr-checklist skill. (Mandatory for agents, optional for humans).

  • AI assistance was used during the creation of this PR.

  • Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.

  • Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.

  • Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.

  • Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.

🤖 Generated with Claude Code

With VLLM_BATCH_INVARIANT=1 the attention selector refuses backends
that do not declare supports_batch_invariance(). Models that select
their own attention backend bypass the selector, so they started
anyway and silently returned batch-dependent output (seen with
MiniMaxAI/MiniMax-M3).

Apply the same check to the backend of every attention layer when the
attention groups are built.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: yifanFengg <evanfengff@gmail.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@mergify mergify Bot added mrv2 Model Runner V2 specific bug Something isn't working labels Oct 6, 2026

@yewentao256 yewentao256 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the work!

Comment thread tests/v1/worker/test_gpu_model_runner_v2.py Outdated
Comment thread vllm/v1/worker/gpu/attn_utils.py Outdated
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: yifanFengg <evanfengff@gmail.com>
@yifanFengg

Copy link
Copy Markdown
Contributor Author

@yewentao256 yewentao256 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks for the work!

@yewentao256 yewentao256 added the ready ONLY add when PR is ready to merge/full CI is needed label Oct 7, 2026
@yewentao256

Copy link
Copy Markdown
Member

/ci run

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

✅ @yifanFengg, CI is now available for this PR.

  • /ci run starts upstream CI; /amd-ci run starts AMD CI only.
  • Your branch must contain every commit currently on its upstream target branch. Merge or rebase onto the latest target branch, then rerun the command. Append --allow-stale to a run command to test an outdated branch at your own risk.
  • /ci retry retries failed jobs in the CI build for the current PR head. If the current head has no CI build, it starts a new CI build for the current head containing only jobs that failed in the latest earlier CI build for this PR.
  • /amd-ci retry retries failed jobs in AMD CI for the current PR head. Use /amd-ci run when the current head has no AMD CI build.
  • /ci cancel cancels scheduled or running CI builds for this PR branch; /amd-ci cancel does the same for AMD CI only.

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

❌ This PR is 101 commits behind upstream main. Your branch must contain every commit currently on upstream main. No new CI build was started. Merge or rebase onto the latest main, then rerun /ci run. To test this branch at your own risk, use /ci run --allow-stale.

@yewentao256

Copy link
Copy Markdown
Member

/ci run

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #93433 for commit 12da8951c813.

@vllm-agent

Copy link
Copy Markdown
Collaborator

CI selector (shadow): 127 test steps (163 jobs) instead of 68 (84 jobs)

Shadow mode: this changes nothing about what CI runs. It shows what the evidence-based selector would pick for this PR, next to today's rules. How it works.

Feedback welcome: reply here if it would skip a step this change needs, or runs something unrelated.

steps (jobs) Today's rules Selector Would skip Would add
NVIDIA, CPU and others 68 (84) 127 (163) 16 (24) 75 (103)
AMD mirrors 62 (75) 115 (147) 10 (13) 63 (85)
Selector would run (127)
  • amd-kernels-mi355
  • amd-lm-eval-small-models-harness
  • amd-qwen3-next-mtp-async-eplb-accuracy
  • async-engine-inputs-utils-worker
  • basic-correctness ×2
  • basic-correctness-cpu-offload
  • basic-correctness-cumem
  • basic-correctness-prefetch-offload
  • basic-correctness-sleep-mode
  • basic-models-tests-extra-initialization ×14
  • basic-models-tests-other
  • batch-invariance-b200
  • batch-invariance-h100
  • benchmarks-cli-test
  • cpu-multimodal-config
  • cpu-spec-decode-tests
  • crosslayer-kv-layout-distributed-nixlconnector-pd-accuracy-tests-4-gpus
  • cudagraph
  • distributed-compile-comm-4-gpus
  • distributed-compile-rpc-tests-2-gpus
  • distributed-dp-tests-2-gpus
  • distributed-dp-tests-4-gpus
  • distributed-flashinfer-nixlconnector-pd-accuracy-4-gpus
  • distributed-model-tests-2-gpus ×3
  • distributed-mooncakeconnector-pd-accuracy-4-gpus
  • distributed-nixlconnector-pd-accuracy-4-gpus
  • distributed-tests-8xh100
  • distributed-torchrun-examples-4-gpus
  • distributed-torchrun-shutdown-tests-2-gpus
  • dp-ep-distributed-nixlconnector-pd-accuracy-tests-4-gpus
  • e2e-core-1-gpu
  • e2e-core-large-memory
  • e2e-scheduling-1-gpu
  • e2e-scheduling-accuracy-1-gpu
  • elastic-ep-scaling-test
  • engine
  • engine-1-gpu
  • entrypoints-integration-api-server ×4
  • entrypoints-integration-api-server-generate
  • entrypoints-integration-api-server-openai-chat_completion
  • entrypoints-integration-api-server-openai-completion
  • entrypoints-integration-llm
  • entrypoints-integration-multimodal
  • entrypoints-integration-pooling
  • entrypoints-integration-responses-api
  • entrypoints-integration-speech_to_text
  • entrypoints-unit-tests
  • examples
  • extract-hidden-states-integration
  • extract-hidden-states-integration-2-gpus
  • fault-tolerance-e2e-2xh100
  • fusion-e2e-config-sweep-h100
  • fusion-e2e-quick-h100
  • fusion-e2e-tp2-ar-rms-config-sweep-h100
  • fusion-e2e-tp2-ar-rms-dynamo-partition-amd
  • fusion-e2e-tp2-ar-rms-inductor-partition-amd
  • fusion-e2e-tp2-b200
  • fusion-e2e-tp2-quick-h100
  • hybrid-ssm-nixlconnector-pd-accuracy-tests-4-gpus
  • hybrid-ssm-nixlconnector-pd-prefix-cache-2-gpus
  • kernels-b200 ×3
  • kernels-deepgemm-test-h100
  • kernels-root-misc-test-b200
  • kimi-k3-prefix-cache-4xb200 ×2
  • kv-offload-large
  • kv-offload-medium
  • kv-offload-small
  • language-models-tests-extra-standard ×2
  • language-models-tests-granite-l4-compatibility
  • language-models-tests-hybrid ×2
  • language-models-tests-standard
  • lm-eval-dspark-watermark-2xh100
  • lm-eval-small-models
  • lm-eval-turboquant-k3v4nc
  • lm-eval-turboquant-k8v4
  • lm-eval-turboquant-t3nc
  • lm-eval-turboquant-t4nc
  • lm-eval-watermarking
  • lora ×4
  • lora-tp-distributed ×4
  • metrics-tracing-2-gpus
  • model-executor
  • mooncake-ec-tcp-e2e-2-gpus
  • mrcr-eval-small-models
  • multi-modal-accuracy-eval-small-models
  • multi-modal-models-standard-1-qwen2
  • multi-modal-models-standard-2-qwen3-gemma
  • multi-modal-models-standard-3-llava-qwen2-vl
  • multi-modal-models-standard-4-other-whisper
  • multiconnector-nixl-offloading-pd-accuracy-2-gpus
  • multiconnector-nixl-offloading-pd-edge-cases-2-gpus
  • nixlconnector-pd-edge-cases-2-gpus
  • openai-api-correctness
  • pipeline-context-parallelism-4-gpus
  • plugin-tests-2-gpus
  • push-nixlconnector-pp-prefill-pd-accuracy-4-gpus
  • pytorch-compilation-dynamic-shapes
  • pytorch-compilation-unit-tests
  • pytorch-compilation-unit-tests-h100
  • pytorch-fullgraph-cudagraph-l4-compatibility
  • pytorch-fullgraph-test
  • quantized-moe-test-b200
  • rayexecutorv2-4-gpus
  • regression
  • replayssm-e2e
  • rust-frontend-core-correctness
  • rust-frontend-distributed
  • rust-frontend-openai-coverage
  • rust-frontend-serve-admin-coverage
  • rust-frontend-tool-use
  • samplers-multimodal-beam-search
  • samplers-test
  • scale-out-ec-e2e-2-gpus
  • sharded-rdt-weight-transfer
  • spec-decode-draft-model ×4
  • spec-decode-eagle-1-deepseek-qwen
  • spec-decode-eagle-2-llama3-qwen-vl-other
  • spec-decode-mtp-deepseek-mimo
  • spec-decode-mtp-gemma4
  • spec-decode-mtp-qwen3-5
  • spec-decode-speculators
  • v1-core
  • v1-executor-worker
  • v1-kv-connectors ×4
  • v1-metrics-lmeval
  • v1-sample
  • v1-spec-decode
Would skip (today's rules run them) (16)
  • ascend-npu-test
  • basic-models-test-other-cpu
  • basic-models-tests-initialization
  • cpu-language-generation-and-pooling-model-tests ×3
  • cpu-params-env-tokenizers-parser
  • cpu-reasoning-renderers
  • cpu-tool-parsers
  • kernels-fla-ops-test-b200
  • kernels-mhc-test-b200
  • multi-modal-processor ×4
  • multi-modal-processor-cpu ×4
  • pytorch-compilation-passes-unit-tests
  • rl-entrypoints-tests
  • v1-kv-offload
  • v1-logits-oracle
  • v1-others-cpu
Would add (today's rules do not run them) (75)
  • amd-kernels-mi355 (Python record)
  • amd-lm-eval-small-models-harness (Python record)
  • amd-qwen3-next-mtp-async-eplb-accuracy (Python record)
  • basic-models-tests-extra-initialization ×14 (Python record)
  • batch-invariance-b200 (Python record)
  • batch-invariance-h100 (Python record)
  • cpu-spec-decode-tests (code map)
  • crosslayer-kv-layout-distributed-nixlconnector-pd-accuracy-tests-4-gpus (Python record)
  • cudagraph (Python record)
  • distributed-compile-comm-4-gpus (Python record)
  • distributed-dp-tests-4-gpus (Python record)
  • distributed-flashinfer-nixlconnector-pd-accuracy-4-gpus (Python record)
  • distributed-model-tests-2-gpus ×3 (Python record)
  • distributed-mooncakeconnector-pd-accuracy-4-gpus (Python record)
  • distributed-nixlconnector-pd-accuracy-4-gpus (Python record)
  • distributed-tests-8xh100 (Python record)
  • distributed-torchrun-examples-4-gpus (Python record)
  • dp-ep-distributed-nixlconnector-pd-accuracy-tests-4-gpus (Python record)
  • elastic-ep-scaling-test (Python record)
  • engine (Python record)
  • engine-1-gpu (Python record)
  • entrypoints-unit-tests (Python record)
  • examples (Python record)
  • extract-hidden-states-integration (Python record)
  • extract-hidden-states-integration-2-gpus (Python record)
  • fusion-e2e-config-sweep-h100 (Python record)
  • fusion-e2e-quick-h100 (Python record)
  • fusion-e2e-tp2-ar-rms-config-sweep-h100 (Python record)
  • fusion-e2e-tp2-ar-rms-dynamo-partition-amd (Python record)
  • fusion-e2e-tp2-ar-rms-inductor-partition-amd (Python record)
  • fusion-e2e-tp2-b200 (Python record)
  • fusion-e2e-tp2-quick-h100 (Python record)
  • hybrid-ssm-nixlconnector-pd-accuracy-tests-4-gpus (Python record)
  • hybrid-ssm-nixlconnector-pd-prefix-cache-2-gpus (Python record)
  • kernels-b200 ×3 (Python record)
  • kernels-deepgemm-test-h100 (Python record)
  • kimi-k3-prefix-cache-4xb200 ×2 (Python record)
  • kv-offload-large (Python record)
  • kv-offload-medium (Python record)
  • kv-offload-small (Python record)
  • language-models-tests-extra-standard ×2 (Python record)
  • lm-eval-small-models (Python record)
  • lm-eval-turboquant-k3v4nc (Python record)
  • lm-eval-turboquant-k8v4 (Python record)
  • lm-eval-turboquant-t3nc (Python record)
  • lm-eval-turboquant-t4nc (Python record)
  • lora ×4 (Python record)
  • lora-tp-distributed ×4 (Python record)
  • model-executor (Python record)
  • mooncake-ec-tcp-e2e-2-gpus (Python record)
  • mrcr-eval-small-models (Python record)
  • multi-modal-accuracy-eval-small-models (Python record)
  • multiconnector-nixl-offloading-pd-accuracy-2-gpus (Python record)
  • multiconnector-nixl-offloading-pd-edge-cases-2-gpus (Python record)
  • nixlconnector-pd-edge-cases-2-gpus (Python record)
  • openai-api-correctness (Python record)
  • plugin-tests-2-gpus (Python record)
  • push-nixlconnector-pp-prefill-pd-accuracy-4-gpus (Python record)
  • quantized-moe-test-b200 (Python record)
  • rayexecutorv2-4-gpus (Python record)
  • rust-frontend-core-correctness (Python record)
  • rust-frontend-openai-coverage (Python record)
  • rust-frontend-serve-admin-coverage (Python record)
  • rust-frontend-tool-use (Python record)
  • samplers-multimodal-beam-search (Python record)
  • samplers-test (Python record)
  • scale-out-ec-e2e-2-gpus (Python record)
  • sharded-rdt-weight-transfer (Python record)
  • spec-decode-draft-model ×4 (Python record)
  • spec-decode-eagle-1-deepseek-qwen (Python record)
  • spec-decode-eagle-2-llama3-qwen-vl-other (Python record)
  • spec-decode-mtp-deepseek-mimo (Python record)
  • spec-decode-mtp-gemma4 (Python record)
  • spec-decode-mtp-qwen3-5 (Python record)
  • spec-decode-speculators (Python record)
AMD mirrors: would skip (10)
  • basic-models-tests-initialization
  • fault-tolerance-e2e-2xh100
  • kernels-fla-ops-test-b200
  • kernels-mhc-test-b200
  • multi-modal-processor ×4
  • platform-tests
  • pytorch-compilation-passes-unit-tests
  • rl-entrypoints-tests
  • v1-kv-offload
  • v1-logits-oracle
AMD mirrors: would add (63)
  • crosslayer-kv-layout-distributed-nixlconnector-pd-accuracy-tests-4-gpus (Python record)
  • cudagraph (Python record)
  • distributed-dp-tests-4-gpus (Python record)
  • distributed-flashinfer-nixlconnector-pd-accuracy-4-gpus (Python record)
  • distributed-mooncakeconnector-pd-accuracy-4-gpus (Python record)
  • distributed-nixlconnector-pd-accuracy-4-gpus (Python record)
  • distributed-tests-8xh100 (Python record)
  • distributed-torchrun-examples-4-gpus (Python record)
  • dp-ep-distributed-nixlconnector-pd-accuracy-tests-4-gpus (Python record)
  • engine (Python record)
  • engine-1-gpu (Python record)
  • entrypoints-unit-tests (Python record)
  • examples (Python record)
  • extract-hidden-states-integration (Python record)
  • extract-hidden-states-integration-2-gpus (Python record)
  • fusion-e2e-config-sweep-h100 (Python record)
  • fusion-e2e-quick-h100 (Python record)
  • fusion-e2e-tp2-ar-rms-config-sweep-h100 (Python record)
  • fusion-e2e-tp2-b200 (Python record)
  • fusion-e2e-tp2-quick-h100 (Python record)
  • hybrid-ssm-nixlconnector-pd-accuracy-tests-4-gpus (Python record)
  • hybrid-ssm-nixlconnector-pd-prefix-cache-2-gpus (Python record)
  • kernels-moe-test ×5 (Python record)
  • kernels-quantization-test ×6 (Python record)
  • kv-offload-medium (Python record)
  • kv-offload-small (Python record)
  • language-models-tests-extra-standard ×2 (Python record)
  • lm-eval-small-models (Python record)
  • lm-eval-turboquant-k3v4nc (Python record)
  • lm-eval-turboquant-k8v4 (Python record)
  • lm-eval-turboquant-t3nc (Python record)
  • lm-eval-turboquant-t4nc (Python record)
  • lora ×4 (Python record)
  • lora-tp-distributed ×4 (Python record)
  • model-executor (Python record)
  • mooncake-ec-tcp-e2e-2-gpus (Python record)
  • mrcr-eval-small-models (Python record)
  • multi-modal-accuracy-eval-small-models (Python record)
  • multiconnector-nixl-offloading-pd-accuracy-2-gpus (Python record)
  • multiconnector-nixl-offloading-pd-edge-cases-2-gpus (Python record)
  • nixlconnector-pd-edge-cases-2-gpus (Python record)
  • nixlconnector-pd-spec-decode-acceptance-2-gpus (Python record)
  • openai-api-correctness (Python record)
  • plugin-tests-2-gpus (Python record)
  • push-nixlconnector-pp-prefill-pd-accuracy-4-gpus (Python record)
  • quantization ×4 (Python record)
  • quantized-models-test (Python record)
  • rayexecutorv2-4-gpus (Python record)
  • rust-frontend-core-correctness (Python record)
  • rust-frontend-openai-coverage (Python record)
  • rust-frontend-serve-admin-coverage (Python record)
  • rust-frontend-tool-use (Python record)
  • samplers-multimodal-beam-search (Python record)
  • samplers-test (Python record)
  • scale-out-ec-e2e-2-gpus (Python record)
  • sharded-rdt-weight-transfer (Python record)
  • spec-decode-draft-model ×4 (Python record)
  • spec-decode-eagle-1-deepseek-qwen (Python record)
  • spec-decode-eagle-2-llama3-qwen-vl-other (Python record)
  • spec-decode-mtp-deepseek-mimo (Python record)
  • spec-decode-mtp-gemma4 (Python record)
  • spec-decode-mtp-qwen3-5 (Python record)
  • spec-decode-speculators (Python record)

1 changed files · base f38c6778ce · head 12da8951c8 · Python record: build 93039 at 1e5d0ea888 · kernel record: table 43b4aae (build 93244), map 43b4aae · not counted: 10 build steps, 5 A100 steps the generator no longer emits, 116 optional steps the selector would also run

@yewentao256
yewentao256 merged commit fd928e5 into vllm-project:main Oct 8, 2026
160 checks passed
michael-gpu pushed a commit to practical-inference/vllm-ampere-extended that referenced this pull request Oct 20, 2026
…llm-project#60271)

Signed-off-by: yifanFengg <evanfengff@gmail.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com>
zzzzwwjj pushed a commit to vllm-project/vllm-ascend that referenced this pull request Oct 20, 2026
### What this PR does / why we need it?

Bump the verified vLLM main pin from `c4df37df` to `a98247ab` and adapt
vllm-ascend to the upstream changes in that range. The v0.31.0 release
lane is kept intact: each adaptation is gated on
`vllm_version_is("0.31.0")` (or a version-aware helper) so both the
`main` and the `v0.31.0` CPU UT lanes stay green.

The range contains a large breaking KV-cache/attention rework plus a set
of smaller API changes:

- vllm#57169 reworked the KV cache layout: it dropped the MLA
`storage_block_size` override, added a leading `vllm_config` to
`_pool_bytes_per_block`, removed
`kernel_block_sizes`/`blocks_per_kv_block` from `BlockTables`, split
metadata-builder creation out of `initialize_attn_backend` and made
`AttentionGroup` identity-comparable.
- vllm#60335 renamed the spec-decode AR path (`autoregressive` ->
`target_dependent_ar`) and added `num_speculative_steps`/
`num_speculative_tokens` to `propose()` and the decode callbacks.
- vllm#60517 removed the torch.compile sequence-parallelism/AsyncTP
passes `PassConfig.enable_sp`/`fuse_gemm_comms`/`sp_min_token_num`,
`update_sizes_for_sequence_parallelism` and the `tensor_parallel_size`
argument of the cudagraph-size resolvers.
- vllm#60754 renamed the DP-sync state (`dp_sync` -> `dp_sync_state`)
and added `ExecuteModelState.num_spec_tokens_to_schedule`.
- vllm#58411 added `randomize_inputs` to `profile_run`/`_dummy_run`.
- vllm#60271 added a hard batch-invariance support check for every
attention backend.
- vllm#59327 moved the DeepSeek-V4.1 Engram module to `common.engram`.
- vllm#57387 moved the GLM-5-Next config classes into `transformers`
(hence the `transformers` 5.14.1 -> 5.19.0 bump, which main requires
anyway).
- Smaller seams: vllm#59175 added `prefill_end` to KV allocation,
vllm#53175 forwards the layer's spec to
`get_supported_kernel_block_sizes`, vllm#58067 passes `separators` to
xgrammar, vllm#53934 made `CudaGraphManager.dp_size` a property,
vllm#56723 builds draft metadata through the attention group, vllm#57934
makes MRV1 reject DFlash candidate-head drafts.

| Files | Upstream vLLM change (why it breaks vllm-ascend) | vllm-ascend
adaptation |

|-------|--------------------------------------------------|------------------------|
| `.github/vllm-main-verified.commit` | — (main-lane pin only) |
Verified main commit bumped `c4df37df` -> `a98247ab` |
| `pyproject.toml` | vLLM main requires `transformers >= 5.16.1` | Build
requirement bumped `transformers==5.14.1` -> `5.19.0` (satisfies both
lanes) |
| `requirements.txt` | Same transformers floor | Runtime requirement
bumped `transformers==5.14.1` -> `5.19.0` |
| `tests/deepseek_v41_utils.py` |
[vllm#57169](vllm-project/vllm#57169) removed
MLA `storage_block_size` | Gate the `storage_block_size` kwarg of the
DSV4 k-cache and indexer k-cache specs on `vllm_version_is("0.31.0")` |
| `tests/e2e/pull_request/four_card/glm53flash_assets/config.json` |
[vllm#57387](vllm-project/vllm#57387) serves
GLM-5-Next configs from `transformers` 5.19.0, which validates every
field type | Write `swiglu_limit: 10.0` and `gate_lower_bound: -5.0` as
floats |
| `tests/e2e/pull_request/four_card/glm53flash_assets/multimodal.json` |
Same strict dataclass validation | Write `vision_config.swiglu_limit:
10` -> `10.0` |
| `tests/e2e/pull_request/two_card/spec_decode/test_spec_decode.py` |
[vllm#57934](vllm-project/vllm#57934): MRV1
rejects DFlash candidate-head drafts on main | Make the
`test_dflash2_acceptance` skip unconditional instead of main-only |
| `tests/ut/attention/test_batch_invariance_support.py` |
[vllm#60271](vllm-project/vllm#60271) added the
batch-invariance support check | New regression test asserting
`supports_batch_invariance()` on all Ascend backends and the 310P/C8MXFP
subclasses |
| `tests/ut/compilation/test_graph_fusion_pass_manager.py` |
[vllm#60517](vllm-project/vllm#60517) removed
`PassConfig.fuse_gemm_comms` | Only seed the PassConfig flag on v0.31.0
and patch `enable_sp` for the main lane gate |
| `tests/ut/core/test_kv_cache_interface.py` |
[vllm#57169](vllm-project/vllm#57169) removed
`MLAAttentionSpec.storage_block_size` | Add a plain-MLA-subclass case
(`HiddenStateCacheSpec`) resolving `get_storage_block_size()` per lane |
| `tests/ut/distributed/kv_transfer/kv_p2p/test_mooncake_connector.py` |
vLLM main's scheduler calls `get_loaded_kv_cache_group_ids`, backed by
`KVConnectorBase_V1._kv_cache_config` | Seed
`MockKVCacheConfig.transfer_group_ids` and add the main-only
scheduler-hook test (skipped on v0.31.0) |
| `tests/ut/kv_offload/test_mooncake_hybrid_connector.py` | Same new
`get_loaded_kv_cache_group_ids` scheduler hook | Assert the hook is
declared on the class only on main |
| `tests/ut/kv_offload/test_preempt_offload_connector.py` | vLLM main's
remote-KV restore consults `scheduler.prefix_replay_group_ids` | Seed
`prefix_replay_group_ids = ()` in the `__new__`-based scheduler fixture
|
| `tests/ut/models/test_deepseek_v41_cache.py` |
[vllm#57169](vllm-project/vllm#57169) added the
leading `vllm_config` to `_pool_bytes_per_block` and removed MLA
`storage_block_size` | Add a `_pool_bytes_per_block(runtime, groups)`
lane helper, read specs through `get_storage_block_size()` and gate the
one explicit `storage_block_size` kwarg |
| `tests/ut/models/test_engram.py` |
[vllm#59327](vllm-project/vllm#59327) deleted
`deepseek_v41/nvidia/engram.py` and moved it to `common.engram` | Import
`upstream_engram` by lane so collection no longer aborts with
`ImportError` on main |
| `tests/ut/models/test_glm5_next_mtp.py` |
[vllm#57387](vllm-project/vllm#57387) removed
`vllm.transformers_utils.configs.glm5_next` | Import
`Glm5NextTextConfig` from `transformers` on main, keep the vLLM path on
v0.31.0 |
| `tests/ut/ops/test_gdn_attn_builder.py` | Main's GDN metadata builder
resolves the prefill backend from `model_config.hf_text_config` | Give
the `model_config` fixture an `hf_text_config` |
| `tests/ut/patch/platform/test_patch_structured_output.py` | Main gates
the guidance backend on `GuidanceBackend.is_tokenizer_supported` |
Monkeypatch that check to accept the dummy tokenizer on main |
| `tests/ut/patch/platform/test_patch_use_v2_model_runner.py` |
[vllm#60517](vllm-project/vllm#60517) dropped
the `PassConfig.enable_sp` guard, so the V2 runner no longer rejects SP
| Expect `["sequence parallelism"]` only on v0.31.0 |
| `tests/ut/patch/platform/test_prefix_cache_cp_patches.py` |
[vllm#57169](vllm-project/vllm#57169) resolves
the KV cache layout when computing pool bytes per block | Pass
`vllm_config` to the Ascend/upstream `_pool_bytes_per_block` on main and
seed `get_resolved_kv_cache_layout` |
| `tests/ut/spec_decode/test_dflash2_v2.py` |
[vllm#57169](vllm-project/vllm#57169) forwards
the physical block size to the DFlash caller;
[vllm#60754](vllm-project/vllm#60754) renamed
`dp_sync` | Select the `dp_sync`/`dp_sync_state` keyword per lane and
add the main-only kernel-block-size restore test |
| `tests/ut/spec_decode/test_eagle_proposer.py` |
[vllm#60517](vllm-project/vllm#60517) removed
`PassConfig.enable_sp` | Assert `enable_sp` is a PassConfig field only
on v0.31.0 |
| `tests/ut/spec_decode/test_mla_dspark.py` |
[vllm#60754](vllm-project/vllm#60754) renamed
`dp_sync` -> `dp_sync_state` | Pass the lane-specific keyword into
`DSparkSpeculator.propose` |
| `tests/ut/test_platform.py` |
[vllm#60517](vllm-project/vllm#60517) removed
the PassConfig SP fields and `update_sizes_for_sequence_parallelism` |
Assert the SP threshold default only on v0.31.0 and that the removed
method is no longer called on main |
| `tests/ut/worker/test_adaptive_verification.py` |
[vllm#60754](vllm-project/vllm#60754) renamed
the DP-sync argument | Build the execute-model kwargs with
`dp_sync`/`dp_sync_state` per lane |
| `tests/ut/worker/test_attn_utils_v2.py` | vLLM main made
`AttentionGroup` identity-comparable | Compare the preserved fields
(backend, layer names, spec, group id) on main instead of `==` |
| `tests/ut/worker/test_dcp_speculator_metadata_v2.py` |
[vllm#60335](vllm-project/vllm#60335) renamed
the AR speculator module;
[vllm#56723](vllm-project/vllm#56723) builds
draft metadata through the attention group | Import
`TargetDependentARSpeculator` on main and add a recording attention
group exposing `build_metadata` |
| `tests/ut/worker/test_model_runner_v1.py` |
[vllm#57169](vllm-project/vllm#57169) removed
`BlockTables.kernel_block_sizes`; main module lacks
`mamba_utils.postprocess_mamba_all` | Pass `kernel_block_sizes` only on
v0.31.0 and patch with `create=True` |
| `tests/ut/worker/test_model_runner_v2.py` |
[vllm#60517](https://github.com/vllm-project/vllm/pull/60517)/[vllm#58411](https://github.com/vllm-project/vllm/pull/58411):
`max_seq_len_np` and `randomize_inputs` exist on both lanes now | Drop
the per-lane gating and always supply `max_seq_len_np` / expect
`randomize_inputs` |
| `tests/ut/worker/test_model_runner_v2_mamba.py` | vLLM main removed
`MambaHybridModelState._ensure_align_ctx` | Seed `_mamba_ctx` on main
and add two main-only `_ensure_align_ctx` regression tests |
| `tests/ut/worker/test_mtp_pcp_speculator_v2.py` |
[vllm#60335](vllm-project/vllm#60335) renamed
the AR base class;
[vllm#60754](vllm-project/vllm#60754) renamed
`dp_sync` | Import the base class by lane and patch
`_UpstreamAutoRegressiveSpeculator` via the lane-specific keyword |
| `tests/ut/worker/test_pcp_manager_v2.py` | Main declares
`ParallelConfig.pcp_shard_decode_requests`, renamed `dp_sync` and added
`num_spec_tokens_to_schedule` | Assert the field per lane, build
`ExecuteModelState` with the lane keyword and seed
`num_spec_tokens_to_schedule` |
| `tests/ut/worker/test_v2_dummy_padding.py` |
[vllm#60754](vllm-project/vllm#60754) renamed
`dp_sync`; main's dummy context reads `block_tables.block_sizes` | Pass
the lane keyword and provide both `block_sizes` and `kernel_block_sizes`
|
| `tests/ut/worker/test_worker_v1.py` |
[vllm#58411](vllm-project/vllm#58411):
`determine_available_memory` now forwards
`profile_run(randomize_inputs=...)` | Update the stale
`assert_called_once_with()` to expect `randomize_inputs=False` |
| `tests/ut/worker/v2/test_aclgraph.py` |
[vllm#60335](vllm-project/vllm#60335) moved
`SpeculatorCudaGraphManager` to `target_dependent_ar`;
[vllm#53934](vllm-project/vllm#53934) made
`dp_size` a read-only property | Import the manager by lane, back
`dp_size` with `vllm_config` on main and expect the extra
`num_speculative_steps` capture arg |
| `tests/ut/worker/v2/test_speculator.py` |
[vllm#60335](vllm-project/vllm#60335) renamed
the AR speculator and added `num_speculative_steps`;
[vllm#60754](vllm-project/vllm#60754) renamed
`dp_sync` | Import by lane, thread `num_speculative_steps` through the
`_generate_draft`/`_multi_step_decode` assertions and add the main
`dp_sync_state` + `num_speculative_tokens` regression test |
| `tests/ut/worker/v2/test_v2_block_table.py` |
[vllm#57169](vllm-project/vllm#57169) dropped
`kernel_block_sizes` from `BlockTables` | Make the stand-in parent
init's kernel sizes optional and assert the kernel tensor is built by
`AscendBlockTables` on main |
| `vllm_ascend/_310p/sharded_state_loader_310p.py` | vLLM main split
`ShardedStateLoader.DEFAULT_PATTERN` into
`TP_ONLY_PATTERN`/`PP_AND_TP_PATTERN` | Pick the lane's default pattern
name instead of the removed combined one |
| `vllm_ascend/_310p/worker/v2/model_runner.py` |
[vllm#60517](vllm-project/vllm#60517) removed
the `tensor_parallel_size` argument of
`resolve_cudagraph_mode_and_sizes` | Forward `tensor_parallel_size` only
on v0.31.0 |
| `vllm_ascend/_310p/worker/v2/spec_decode/mtp_speculator.py` |
[vllm#60335](vllm-project/vllm#60335) renamed
the AR module and added `num_speculative_steps` to
`_generate_draft`/`_multi_step_decode` | Version-split the two overrides
and the AR import, falling back to `self.num_speculative_steps` when the
capture path omits it |
| `vllm_ascend/ascend_config.py` |
[vllm#60517](vllm-project/vllm#60517) removed
`PassConfig.enable_sp` | Read the flag only on v0.31.0, so
`enable_sp_by_pass` is False (no pass-based SP) on main |
| `vllm_ascend/attention/attention_v1.py` |
[vllm#60271](vllm-project/vllm#60271) rejects
backends that do not support batch invariance | Declare
`supports_batch_invariance()` on main (`not vllm_version_is("0.31.0")`)
|
| `vllm_ascend/attention/dsa_v1.py` |
[vllm#60271](vllm-project/vllm#60271)
batch-invariance check;
[vllm#53175](vllm-project/vllm#53175) forwards
the layer's `KVCacheSpec` into `get_supported_kernel_block_sizes`, so a
rebase had overwritten the six DSA backends back to the zero-arg form
and main raised `TypeError: ... takes 0 positional arguments but 1 was
given` | Re-apply `supports_batch_invariance()` and give all six DSA
backends the per-lane
`get_supported_kernel_block_sizes(kv_cache_spec=None)` signature |
| `vllm_ascend/attention/dsa_v41.py` |
[vllm#60271](vllm-project/vllm#60271)
batch-invariance check | Declare `supports_batch_invariance()` on
`DeepseekV41CacheBackend` for main |
| `vllm_ascend/attention/fa3_v1.py` | Same | Declare
`supports_batch_invariance()` on `AscendFABackend` for main |
| `vllm_ascend/attention/indexer.py` | Same | Declare
`supports_batch_invariance()` on `AscendSFAIndexerBackend` for main |
| `vllm_ascend/attention/indexer_kpool.py` | Same | Declare
`supports_batch_invariance()` on the indexer k-pool and tail backends
for main |
| `vllm_ascend/attention/mla_v1.py` | Same | Declare
`supports_batch_invariance()` on `AscendMLABackend` for main |
| `vllm_ascend/attention/sfa_v1.py` | Same | Declare
`supports_batch_invariance()` on `AscendSFABackend` for main |
| `vllm_ascend/compilation/graph_fusion_pass_manager.py` |
[vllm#60517](vllm-project/vllm#60517) removed
`PassConfig.fuse_gemm_comms` | Gate the MMRS fusion on
`enable_sp(config)` on main, keep reading the PassConfig flag on v0.31.0
|
| `vllm_ascend/core/kv_cache_interface.py` |
[vllm#57169](vllm-project/vllm#57169) removed
the MLA `storage_block_size` override, so a plain MLA subclass crashed
with `AttributeError: 'HiddenStateCacheSpec' object has no attribute
'storage_block_size'` | Read the optional override only on v0.31.0 and
fall back to `block_size` on main |
| `vllm_ascend/distributed/kv_transfer/kv_p2p/mooncake_connector.py` |
vLLM main's scheduler calls `get_loaded_kv_cache_group_ids`, which reads
`_kv_cache_config`; the Ascend connector overrode `__init__` without
calling the base and never set it (`AttributeError: 'MooncakeConnector'
object has no attribute '_kv_cache_config'`) | Call
`KVConnectorBase_V1.__init__` on main and declare the main-only
`get_loaded_kv_cache_group_ids` hook |
|
`vllm_ascend/distributed/kv_transfer/kv_p2p/mooncake_hybrid_connector.py`
| Same | Same base-init binding and main-only hook |
| `vllm_ascend/models/deepseek_v41/cache_config.py` |
[vllm#57169](vllm-project/vllm#57169) removed
MLA `storage_block_size` | Gate the kwarg in
`make_mla_cache_spec`/`make_index_cache_spec`/`make_folded_index_cache_spec`
on v0.31.0 |
| `vllm_ascend/models/deepseek_v41/engram/parallel.py` |
[vllm#59327](vllm-project/vllm#59327) moved
`engram_head_shard_rank` from `nvidia.engram` to `common.engram` |
Import `engram_head_shard_rank` by lane |
| `vllm_ascend/models/glm5next/attention.py` |
[vllm#57387](vllm-project/vllm#57387) removed
`vllm.transformers_utils.configs.glm5_next`, making the direct import
unresolvable (mypy `import-not-found`) | Import `Glm5NextConfig` from
`transformers` on main, keep the vLLM path on v0.31.0 |
| `vllm_ascend/models/glm5next/kda.py` | Same | Same lane-gated
`Glm5NextConfig` import |
| `vllm_ascend/models/glm5next/model.py` | Same | Same lane-gated
`Glm5NextConfig` import |
| `vllm_ascend/models/kimi_k3.py` | vLLM main made `out_hidden_size` a
required positional argument of `KimiK25MultiModalProjector`
(`TypeError: ... missing 1 required positional argument:
'out_hidden_size'`) | Pass `out_hidden_size = self.hidden_size` on main
only |
| `vllm_ascend/models/minimax_m3/msa_m3.py` |
[vllm#60271](vllm-project/vllm#60271)
batch-invariance check | Declare `supports_batch_invariance()` on the
MiniMax-M3 sparse/indexer backends for main |
| `vllm_ascend/patch/__init__.py` |
[vllm#58067](vllm-project/vllm#58067) xgrammar
`separators`; stale v0.30.0 boundary wording | Document the new xgrammar
patch (why/how/future plan) and rename the boundary to v0.31.0 |
| `vllm_ascend/patch/platform/__init__.py` | Stale release-lane wording
in the Engram adapter comment | `v0.30.0+` -> `v0.31.0+` |
| `vllm_ascend/patch/platform/patch_balance_schedule.py` | Stale
release-lane wording in the block-state snapshot comment | `vLLM
main/v0.30.0` -> `vLLM main/v0.31.0` |
| `vllm_ascend/patch/platform/patch_kv_cache_utils.py` |
[vllm#57169](vllm-project/vllm#57169) added a
leading `vllm_config` argument to `_pool_bytes_per_block` | Define
`_ascend_pool_bytes_per_block` per lane, forwarding `vllm_config` to the
upstream fallback on main |
| `vllm_ascend/patch/platform/patch_mamba_manager.py` |
[vllm#59175](vllm-project/vllm#59175) added
`prefill_end` to `get_num_blocks_to_allocate` | Always forward
`prefill_end` and drop the now-redundant lane gate |
| `vllm_ascend/patch/platform/patch_structured_output.py` |
[vllm#58067](vllm-project/vllm#58067) passes
`separators=(",", ":")` to `GrammarCompiler.compile_json_schema`, which
the shipped xgrammar (0.2.7/0.2.8) mishandles (truncated, invalid JSON
in guided decoding) | Wrap `compile_json_schema` to force
`separators=None` on main only, until xgrammar >= 0.2.9 is pinned |
| `vllm_ascend/patch/worker/__init__.py` |
[vllm#60335](vllm-project/vllm#60335) renamed
the AR speculator module | Import the AR module by lane before the 310P
manager override |
| `vllm_ascend/patch/worker/patch_v2/patch_eagle_speculator.py` | Same
AR module rename | Bind `vllm_speculator_module` from
`target_dependent_ar` on main, `autoregressive` on v0.31.0 |
| `vllm_ascend/patch/worker/patch_v2/patch_model_runner.py` |
[vllm#60517](vllm-project/vllm#60517) removed
the `tensor_parallel_size` argument | Forward it only on v0.31.0 |
| `vllm_ascend/patch/worker/patch_v2/patch_spec_decode_310.py` | Same AR
module rename | Import the AR module by lane before patching the CPU
input helpers |
| `vllm_ascend/platform.py` |
[vllm#60517](vllm-project/vllm#60517) removed
`PassConfig.enable_sp`/`fuse_gemm_comms`/`sp_min_token_num` and
`update_sizes_for_sequence_parallelism` | Gate the SP threshold default
on v0.31.0 and inline the tp-multiple filtering on main |
| `vllm_ascend/worker/model_runner_v1.py` |
[vllm#58411](vllm-project/vllm#58411)
`randomize_inputs`;
[vllm#57169](vllm-project/vllm#57169) split
metadata-builder creation and changed `AttentionGroup`;
[vllm#60517](vllm-project/vllm#60517) removed
the SP pass and the `tensor_parallel_size` argument | Forward
`randomize_inputs` unconditionally, build `AttentionGroup` without
positional builders and call
`initialize_metadata_builders`/`_init_device_metadata_providers` on
main, inline the SP-aware lcm, resolve cudagraph sizes without
`tensor_parallel_size`, treat `update_pass_config` as a no-op on main
and collapse 310P drafter kernel block sizes to an int |
| `vllm_ascend/worker/v2/block_table.py` |
[vllm#57169](vllm-project/vllm#57169) dropped
`kernel_block_sizes`/`blocks_per_kv_block` from `BlockTables` and
stopped expanding block ids | Version-split `__init__` to restore the
kernel-block layout (sizes, `blocks_per_kv_block`, expanded rows,
kernel-size tensor) and override `append_block_ids` on main |
| `vllm_ascend/worker/v2/model_runner.py` |
[vllm#58411](vllm-project/vllm#58411)
`randomize_inputs`; main's rejection sampler takes invalidation state
and needs the new `InputBatch` fields | Forward `randomize_inputs` and
`max_seq_len_np` unconditionally, skip grammar application on empty
logits and pass `grammar_invalid_drafts` output into the main rejection
sampler |
| `vllm_ascend/worker/v2/model_states/mamba_hybrid.py` | vLLM main
removed `MambaHybridModelState._ensure_align_ctx` and moved
align-context creation into `initialize_kv_cache`, so the first forward
aborted with `AttributeError: ... has no attribute '_ensure_align_ctx'`
/ `AssertionError` when the context was absent | Define
`_ensure_align_ctx` per lane: delegate on v0.31.0, lazily (re)create the
align context on main from the forward context |
| `vllm_ascend/worker/v2/pcp_manager.py` | vLLM main made
`shard_decode_requests` a required `PCPManager.__init__` argument and
`maybe_build_pcp_manager` passes it (`TypeError: ... unexpected keyword
argument 'shard_decode_requests'`) | Version-split
`AscendPCPManager.__init__`, accepting and forwarding the flag on main
while keeping the Ascend buffer setup shared |
| `vllm_ascend/worker/v2/spec_decode/autoregressive/aclgraph.py` |
[vllm#60335](vllm-project/vllm#60335) moved the
speculator CUDA-graph manager and added `num_speculative_steps` to the
captured forward | Import `SpeculatorCudaGraphManager` by lane and pass
`num_speculative_steps` on main |
| `vllm_ascend/worker/v2/spec_decode/autoregressive/speculator.py` |
[vllm#60335](vllm-project/vllm#60335) renamed
the AR base class and added `num_speculative_steps`;
[vllm#60754](vllm-project/vllm#60754) renamed
`dp_sync` -> `dp_sync_state` (`TypeError:
AscendAutoRegressiveSpeculator.propose() got an unexpected keyword
argument 'dp_sync_state'`) | Bind the upstream base class by lane and
version-split `propose()`/`_propose_impl()` plus
`_generate_draft`/`_multi_step_decode` so each lane forwards exactly its
arguments |
| `vllm_ascend/worker/v2/spec_decode/dflash/speculator.py` |
[vllm#57169](vllm-project/vllm#57169) makes the
DFlash caller forward the physical block size while the Ascend block
table stays kernel-block addressed (draft KV mismapped, every draft
rejected);
[vllm#60335](https://github.com/vllm-project/vllm/pull/60335)/[vllm#60754](https://github.com/vllm-project/vllm/pull/60754)
speculator contract | Version-split `prepare_dflash_inputs_factory`
(restoring the kernel block size per group on main) and
`propose()`/`_propose_impl()`, keeping the profiling DP-count guard |
| `vllm_ascend/worker/v2/spec_decode/dspark/speculator.py` | Same
speculator contract changes | Same version-split
`propose()`/`_propose_impl()` adaptation |
| `vllm_ascend/worker/worker.py` |
[vllm#58411](vllm-project/vllm#58411)
`profile_run` takes `randomize_inputs` | Compute `randomize_inputs` from
the env flag + DP size and forward it on both `profile_run` calls |

### Does this PR introduce _any_ user-facing change?

No. This is a CI/main2main compatibility update: behavior on vLLM main
is unchanged (the restorations only bring the main lane back to the
v0.31.0 behavior) and the v0.31.0 release lane is preserved.

### How was this patch tested?

- Unit tests updated per lane; `pytest -sv tests/ut` against both the
verified
  main commit (`a98247ab`) and the release tag (`v0.31.0`).


- vLLM main:
vllm-project/vllm@c4df37d

---------

Signed-off-by: hfadzxy <starmoon_zhang@163.com>
Signed-off-by: zhangxinyuehfad <starmoon_zhang@163.com>
tangdafu pushed a commit to tangdafu/vllm-ascend that referenced this pull request Oct 20, 2026
### What this PR does / why we need it?

Bump the verified vLLM main pin from `c4df37df` to `a98247ab` and adapt
vllm-ascend to the upstream changes in that range. The v0.31.0 release
lane is kept intact: each adaptation is gated on
`vllm_version_is("0.31.0")` (or a version-aware helper) so both the
`main` and the `v0.31.0` CPU UT lanes stay green.

The range contains a large breaking KV-cache/attention rework plus a set
of smaller API changes:

- vllm#57169 reworked the KV cache layout: it dropped the MLA
`storage_block_size` override, added a leading `vllm_config` to
`_pool_bytes_per_block`, removed
`kernel_block_sizes`/`blocks_per_kv_block` from `BlockTables`, split
metadata-builder creation out of `initialize_attn_backend` and made
`AttentionGroup` identity-comparable.
- vllm#60335 renamed the spec-decode AR path (`autoregressive` ->
`target_dependent_ar`) and added `num_speculative_steps`/
`num_speculative_tokens` to `propose()` and the decode callbacks.
- vllm#60517 removed the torch.compile sequence-parallelism/AsyncTP
passes `PassConfig.enable_sp`/`fuse_gemm_comms`/`sp_min_token_num`,
`update_sizes_for_sequence_parallelism` and the `tensor_parallel_size`
argument of the cudagraph-size resolvers.
- vllm#60754 renamed the DP-sync state (`dp_sync` -> `dp_sync_state`)
and added `ExecuteModelState.num_spec_tokens_to_schedule`.
- vllm#58411 added `randomize_inputs` to `profile_run`/`_dummy_run`.
- vllm#60271 added a hard batch-invariance support check for every
attention backend.
- vllm#59327 moved the DeepSeek-V4.1 Engram module to `common.engram`.
- vllm#57387 moved the GLM-5-Next config classes into `transformers`
(hence the `transformers` 5.14.1 -> 5.19.0 bump, which main requires
anyway).
- Smaller seams: vllm#59175 added `prefill_end` to KV allocation,
vllm#53175 forwards the layer's spec to
`get_supported_kernel_block_sizes`, vllm#58067 passes `separators` to
xgrammar, vllm#53934 made `CudaGraphManager.dp_size` a property,
vllm#56723 builds draft metadata through the attention group, vllm#57934
makes MRV1 reject DFlash candidate-head drafts.

| Files | Upstream vLLM change (why it breaks vllm-ascend) | vllm-ascend
adaptation |

|-------|--------------------------------------------------|------------------------|
| `.github/vllm-main-verified.commit` | — (main-lane pin only) |
Verified main commit bumped `c4df37df` -> `a98247ab` |
| `pyproject.toml` | vLLM main requires `transformers >= 5.16.1` | Build
requirement bumped `transformers==5.14.1` -> `5.19.0` (satisfies both
lanes) |
| `requirements.txt` | Same transformers floor | Runtime requirement
bumped `transformers==5.14.1` -> `5.19.0` |
| `tests/deepseek_v41_utils.py` |
[vllm#57169](vllm-project/vllm#57169) removed
MLA `storage_block_size` | Gate the `storage_block_size` kwarg of the
DSV4 k-cache and indexer k-cache specs on `vllm_version_is("0.31.0")` |
| `tests/e2e/pull_request/four_card/glm53flash_assets/config.json` |
[vllm#57387](vllm-project/vllm#57387) serves
GLM-5-Next configs from `transformers` 5.19.0, which validates every
field type | Write `swiglu_limit: 10.0` and `gate_lower_bound: -5.0` as
floats |
| `tests/e2e/pull_request/four_card/glm53flash_assets/multimodal.json` |
Same strict dataclass validation | Write `vision_config.swiglu_limit:
10` -> `10.0` |
| `tests/e2e/pull_request/two_card/spec_decode/test_spec_decode.py` |
[vllm#57934](vllm-project/vllm#57934): MRV1
rejects DFlash candidate-head drafts on main | Make the
`test_dflash2_acceptance` skip unconditional instead of main-only |
| `tests/ut/attention/test_batch_invariance_support.py` |
[vllm#60271](vllm-project/vllm#60271) added the
batch-invariance support check | New regression test asserting
`supports_batch_invariance()` on all Ascend backends and the 310P/C8MXFP
subclasses |
| `tests/ut/compilation/test_graph_fusion_pass_manager.py` |
[vllm#60517](vllm-project/vllm#60517) removed
`PassConfig.fuse_gemm_comms` | Only seed the PassConfig flag on v0.31.0
and patch `enable_sp` for the main lane gate |
| `tests/ut/core/test_kv_cache_interface.py` |
[vllm#57169](vllm-project/vllm#57169) removed
`MLAAttentionSpec.storage_block_size` | Add a plain-MLA-subclass case
(`HiddenStateCacheSpec`) resolving `get_storage_block_size()` per lane |
| `tests/ut/distributed/kv_transfer/kv_p2p/test_mooncake_connector.py` |
vLLM main's scheduler calls `get_loaded_kv_cache_group_ids`, backed by
`KVConnectorBase_V1._kv_cache_config` | Seed
`MockKVCacheConfig.transfer_group_ids` and add the main-only
scheduler-hook test (skipped on v0.31.0) |
| `tests/ut/kv_offload/test_mooncake_hybrid_connector.py` | Same new
`get_loaded_kv_cache_group_ids` scheduler hook | Assert the hook is
declared on the class only on main |
| `tests/ut/kv_offload/test_preempt_offload_connector.py` | vLLM main's
remote-KV restore consults `scheduler.prefix_replay_group_ids` | Seed
`prefix_replay_group_ids = ()` in the `__new__`-based scheduler fixture
|
| `tests/ut/models/test_deepseek_v41_cache.py` |
[vllm#57169](vllm-project/vllm#57169) added the
leading `vllm_config` to `_pool_bytes_per_block` and removed MLA
`storage_block_size` | Add a `_pool_bytes_per_block(runtime, groups)`
lane helper, read specs through `get_storage_block_size()` and gate the
one explicit `storage_block_size` kwarg |
| `tests/ut/models/test_engram.py` |
[vllm#59327](vllm-project/vllm#59327) deleted
`deepseek_v41/nvidia/engram.py` and moved it to `common.engram` | Import
`upstream_engram` by lane so collection no longer aborts with
`ImportError` on main |
| `tests/ut/models/test_glm5_next_mtp.py` |
[vllm#57387](vllm-project/vllm#57387) removed
`vllm.transformers_utils.configs.glm5_next` | Import
`Glm5NextTextConfig` from `transformers` on main, keep the vLLM path on
v0.31.0 |
| `tests/ut/ops/test_gdn_attn_builder.py` | Main's GDN metadata builder
resolves the prefill backend from `model_config.hf_text_config` | Give
the `model_config` fixture an `hf_text_config` |
| `tests/ut/patch/platform/test_patch_structured_output.py` | Main gates
the guidance backend on `GuidanceBackend.is_tokenizer_supported` |
Monkeypatch that check to accept the dummy tokenizer on main |
| `tests/ut/patch/platform/test_patch_use_v2_model_runner.py` |
[vllm#60517](vllm-project/vllm#60517) dropped
the `PassConfig.enable_sp` guard, so the V2 runner no longer rejects SP
| Expect `["sequence parallelism"]` only on v0.31.0 |
| `tests/ut/patch/platform/test_prefix_cache_cp_patches.py` |
[vllm#57169](vllm-project/vllm#57169) resolves
the KV cache layout when computing pool bytes per block | Pass
`vllm_config` to the Ascend/upstream `_pool_bytes_per_block` on main and
seed `get_resolved_kv_cache_layout` |
| `tests/ut/spec_decode/test_dflash2_v2.py` |
[vllm#57169](vllm-project/vllm#57169) forwards
the physical block size to the DFlash caller;
[vllm#60754](vllm-project/vllm#60754) renamed
`dp_sync` | Select the `dp_sync`/`dp_sync_state` keyword per lane and
add the main-only kernel-block-size restore test |
| `tests/ut/spec_decode/test_eagle_proposer.py` |
[vllm#60517](vllm-project/vllm#60517) removed
`PassConfig.enable_sp` | Assert `enable_sp` is a PassConfig field only
on v0.31.0 |
| `tests/ut/spec_decode/test_mla_dspark.py` |
[vllm#60754](vllm-project/vllm#60754) renamed
`dp_sync` -> `dp_sync_state` | Pass the lane-specific keyword into
`DSparkSpeculator.propose` |
| `tests/ut/test_platform.py` |
[vllm#60517](vllm-project/vllm#60517) removed
the PassConfig SP fields and `update_sizes_for_sequence_parallelism` |
Assert the SP threshold default only on v0.31.0 and that the removed
method is no longer called on main |
| `tests/ut/worker/test_adaptive_verification.py` |
[vllm#60754](vllm-project/vllm#60754) renamed
the DP-sync argument | Build the execute-model kwargs with
`dp_sync`/`dp_sync_state` per lane |
| `tests/ut/worker/test_attn_utils_v2.py` | vLLM main made
`AttentionGroup` identity-comparable | Compare the preserved fields
(backend, layer names, spec, group id) on main instead of `==` |
| `tests/ut/worker/test_dcp_speculator_metadata_v2.py` |
[vllm#60335](vllm-project/vllm#60335) renamed
the AR speculator module;
[vllm#56723](vllm-project/vllm#56723) builds
draft metadata through the attention group | Import
`TargetDependentARSpeculator` on main and add a recording attention
group exposing `build_metadata` |
| `tests/ut/worker/test_model_runner_v1.py` |
[vllm#57169](vllm-project/vllm#57169) removed
`BlockTables.kernel_block_sizes`; main module lacks
`mamba_utils.postprocess_mamba_all` | Pass `kernel_block_sizes` only on
v0.31.0 and patch with `create=True` |
| `tests/ut/worker/test_model_runner_v2.py` |
[vllm#60517](https://github.com/vllm-project/vllm/pull/60517)/[vllm#58411](https://github.com/vllm-project/vllm/pull/58411):
`max_seq_len_np` and `randomize_inputs` exist on both lanes now | Drop
the per-lane gating and always supply `max_seq_len_np` / expect
`randomize_inputs` |
| `tests/ut/worker/test_model_runner_v2_mamba.py` | vLLM main removed
`MambaHybridModelState._ensure_align_ctx` | Seed `_mamba_ctx` on main
and add two main-only `_ensure_align_ctx` regression tests |
| `tests/ut/worker/test_mtp_pcp_speculator_v2.py` |
[vllm#60335](vllm-project/vllm#60335) renamed
the AR base class;
[vllm#60754](vllm-project/vllm#60754) renamed
`dp_sync` | Import the base class by lane and patch
`_UpstreamAutoRegressiveSpeculator` via the lane-specific keyword |
| `tests/ut/worker/test_pcp_manager_v2.py` | Main declares
`ParallelConfig.pcp_shard_decode_requests`, renamed `dp_sync` and added
`num_spec_tokens_to_schedule` | Assert the field per lane, build
`ExecuteModelState` with the lane keyword and seed
`num_spec_tokens_to_schedule` |
| `tests/ut/worker/test_v2_dummy_padding.py` |
[vllm#60754](vllm-project/vllm#60754) renamed
`dp_sync`; main's dummy context reads `block_tables.block_sizes` | Pass
the lane keyword and provide both `block_sizes` and `kernel_block_sizes`
|
| `tests/ut/worker/test_worker_v1.py` |
[vllm#58411](vllm-project/vllm#58411):
`determine_available_memory` now forwards
`profile_run(randomize_inputs=...)` | Update the stale
`assert_called_once_with()` to expect `randomize_inputs=False` |
| `tests/ut/worker/v2/test_aclgraph.py` |
[vllm#60335](vllm-project/vllm#60335) moved
`SpeculatorCudaGraphManager` to `target_dependent_ar`;
[vllm#53934](vllm-project/vllm#53934) made
`dp_size` a read-only property | Import the manager by lane, back
`dp_size` with `vllm_config` on main and expect the extra
`num_speculative_steps` capture arg |
| `tests/ut/worker/v2/test_speculator.py` |
[vllm#60335](vllm-project/vllm#60335) renamed
the AR speculator and added `num_speculative_steps`;
[vllm#60754](vllm-project/vllm#60754) renamed
`dp_sync` | Import by lane, thread `num_speculative_steps` through the
`_generate_draft`/`_multi_step_decode` assertions and add the main
`dp_sync_state` + `num_speculative_tokens` regression test |
| `tests/ut/worker/v2/test_v2_block_table.py` |
[vllm#57169](vllm-project/vllm#57169) dropped
`kernel_block_sizes` from `BlockTables` | Make the stand-in parent
init's kernel sizes optional and assert the kernel tensor is built by
`AscendBlockTables` on main |
| `vllm_ascend/_310p/sharded_state_loader_310p.py` | vLLM main split
`ShardedStateLoader.DEFAULT_PATTERN` into
`TP_ONLY_PATTERN`/`PP_AND_TP_PATTERN` | Pick the lane's default pattern
name instead of the removed combined one |
| `vllm_ascend/_310p/worker/v2/model_runner.py` |
[vllm#60517](vllm-project/vllm#60517) removed
the `tensor_parallel_size` argument of
`resolve_cudagraph_mode_and_sizes` | Forward `tensor_parallel_size` only
on v0.31.0 |
| `vllm_ascend/_310p/worker/v2/spec_decode/mtp_speculator.py` |
[vllm#60335](vllm-project/vllm#60335) renamed
the AR module and added `num_speculative_steps` to
`_generate_draft`/`_multi_step_decode` | Version-split the two overrides
and the AR import, falling back to `self.num_speculative_steps` when the
capture path omits it |
| `vllm_ascend/ascend_config.py` |
[vllm#60517](vllm-project/vllm#60517) removed
`PassConfig.enable_sp` | Read the flag only on v0.31.0, so
`enable_sp_by_pass` is False (no pass-based SP) on main |
| `vllm_ascend/attention/attention_v1.py` |
[vllm#60271](vllm-project/vllm#60271) rejects
backends that do not support batch invariance | Declare
`supports_batch_invariance()` on main (`not vllm_version_is("0.31.0")`)
|
| `vllm_ascend/attention/dsa_v1.py` |
[vllm#60271](vllm-project/vllm#60271)
batch-invariance check;
[vllm#53175](vllm-project/vllm#53175) forwards
the layer's `KVCacheSpec` into `get_supported_kernel_block_sizes`, so a
rebase had overwritten the six DSA backends back to the zero-arg form
and main raised `TypeError: ... takes 0 positional arguments but 1 was
given` | Re-apply `supports_batch_invariance()` and give all six DSA
backends the per-lane
`get_supported_kernel_block_sizes(kv_cache_spec=None)` signature |
| `vllm_ascend/attention/dsa_v41.py` |
[vllm#60271](vllm-project/vllm#60271)
batch-invariance check | Declare `supports_batch_invariance()` on
`DeepseekV41CacheBackend` for main |
| `vllm_ascend/attention/fa3_v1.py` | Same | Declare
`supports_batch_invariance()` on `AscendFABackend` for main |
| `vllm_ascend/attention/indexer.py` | Same | Declare
`supports_batch_invariance()` on `AscendSFAIndexerBackend` for main |
| `vllm_ascend/attention/indexer_kpool.py` | Same | Declare
`supports_batch_invariance()` on the indexer k-pool and tail backends
for main |
| `vllm_ascend/attention/mla_v1.py` | Same | Declare
`supports_batch_invariance()` on `AscendMLABackend` for main |
| `vllm_ascend/attention/sfa_v1.py` | Same | Declare
`supports_batch_invariance()` on `AscendSFABackend` for main |
| `vllm_ascend/compilation/graph_fusion_pass_manager.py` |
[vllm#60517](vllm-project/vllm#60517) removed
`PassConfig.fuse_gemm_comms` | Gate the MMRS fusion on
`enable_sp(config)` on main, keep reading the PassConfig flag on v0.31.0
|
| `vllm_ascend/core/kv_cache_interface.py` |
[vllm#57169](vllm-project/vllm#57169) removed
the MLA `storage_block_size` override, so a plain MLA subclass crashed
with `AttributeError: 'HiddenStateCacheSpec' object has no attribute
'storage_block_size'` | Read the optional override only on v0.31.0 and
fall back to `block_size` on main |
| `vllm_ascend/distributed/kv_transfer/kv_p2p/mooncake_connector.py` |
vLLM main's scheduler calls `get_loaded_kv_cache_group_ids`, which reads
`_kv_cache_config`; the Ascend connector overrode `__init__` without
calling the base and never set it (`AttributeError: 'MooncakeConnector'
object has no attribute '_kv_cache_config'`) | Call
`KVConnectorBase_V1.__init__` on main and declare the main-only
`get_loaded_kv_cache_group_ids` hook |
|
`vllm_ascend/distributed/kv_transfer/kv_p2p/mooncake_hybrid_connector.py`
| Same | Same base-init binding and main-only hook |
| `vllm_ascend/models/deepseek_v41/cache_config.py` |
[vllm#57169](vllm-project/vllm#57169) removed
MLA `storage_block_size` | Gate the kwarg in
`make_mla_cache_spec`/`make_index_cache_spec`/`make_folded_index_cache_spec`
on v0.31.0 |
| `vllm_ascend/models/deepseek_v41/engram/parallel.py` |
[vllm#59327](vllm-project/vllm#59327) moved
`engram_head_shard_rank` from `nvidia.engram` to `common.engram` |
Import `engram_head_shard_rank` by lane |
| `vllm_ascend/models/glm5next/attention.py` |
[vllm#57387](vllm-project/vllm#57387) removed
`vllm.transformers_utils.configs.glm5_next`, making the direct import
unresolvable (mypy `import-not-found`) | Import `Glm5NextConfig` from
`transformers` on main, keep the vLLM path on v0.31.0 |
| `vllm_ascend/models/glm5next/kda.py` | Same | Same lane-gated
`Glm5NextConfig` import |
| `vllm_ascend/models/glm5next/model.py` | Same | Same lane-gated
`Glm5NextConfig` import |
| `vllm_ascend/models/kimi_k3.py` | vLLM main made `out_hidden_size` a
required positional argument of `KimiK25MultiModalProjector`
(`TypeError: ... missing 1 required positional argument:
'out_hidden_size'`) | Pass `out_hidden_size = self.hidden_size` on main
only |
| `vllm_ascend/models/minimax_m3/msa_m3.py` |
[vllm#60271](vllm-project/vllm#60271)
batch-invariance check | Declare `supports_batch_invariance()` on the
MiniMax-M3 sparse/indexer backends for main |
| `vllm_ascend/patch/__init__.py` |
[vllm#58067](vllm-project/vllm#58067) xgrammar
`separators`; stale v0.30.0 boundary wording | Document the new xgrammar
patch (why/how/future plan) and rename the boundary to v0.31.0 |
| `vllm_ascend/patch/platform/__init__.py` | Stale release-lane wording
in the Engram adapter comment | `v0.30.0+` -> `v0.31.0+` |
| `vllm_ascend/patch/platform/patch_balance_schedule.py` | Stale
release-lane wording in the block-state snapshot comment | `vLLM
main/v0.30.0` -> `vLLM main/v0.31.0` |
| `vllm_ascend/patch/platform/patch_kv_cache_utils.py` |
[vllm#57169](vllm-project/vllm#57169) added a
leading `vllm_config` argument to `_pool_bytes_per_block` | Define
`_ascend_pool_bytes_per_block` per lane, forwarding `vllm_config` to the
upstream fallback on main |
| `vllm_ascend/patch/platform/patch_mamba_manager.py` |
[vllm#59175](vllm-project/vllm#59175) added
`prefill_end` to `get_num_blocks_to_allocate` | Always forward
`prefill_end` and drop the now-redundant lane gate |
| `vllm_ascend/patch/platform/patch_structured_output.py` |
[vllm#58067](vllm-project/vllm#58067) passes
`separators=(",", ":")` to `GrammarCompiler.compile_json_schema`, which
the shipped xgrammar (0.2.7/0.2.8) mishandles (truncated, invalid JSON
in guided decoding) | Wrap `compile_json_schema` to force
`separators=None` on main only, until xgrammar >= 0.2.9 is pinned |
| `vllm_ascend/patch/worker/__init__.py` |
[vllm#60335](vllm-project/vllm#60335) renamed
the AR speculator module | Import the AR module by lane before the 310P
manager override |
| `vllm_ascend/patch/worker/patch_v2/patch_eagle_speculator.py` | Same
AR module rename | Bind `vllm_speculator_module` from
`target_dependent_ar` on main, `autoregressive` on v0.31.0 |
| `vllm_ascend/patch/worker/patch_v2/patch_model_runner.py` |
[vllm#60517](vllm-project/vllm#60517) removed
the `tensor_parallel_size` argument | Forward it only on v0.31.0 |
| `vllm_ascend/patch/worker/patch_v2/patch_spec_decode_310.py` | Same AR
module rename | Import the AR module by lane before patching the CPU
input helpers |
| `vllm_ascend/platform.py` |
[vllm#60517](vllm-project/vllm#60517) removed
`PassConfig.enable_sp`/`fuse_gemm_comms`/`sp_min_token_num` and
`update_sizes_for_sequence_parallelism` | Gate the SP threshold default
on v0.31.0 and inline the tp-multiple filtering on main |
| `vllm_ascend/worker/model_runner_v1.py` |
[vllm#58411](vllm-project/vllm#58411)
`randomize_inputs`;
[vllm#57169](vllm-project/vllm#57169) split
metadata-builder creation and changed `AttentionGroup`;
[vllm#60517](vllm-project/vllm#60517) removed
the SP pass and the `tensor_parallel_size` argument | Forward
`randomize_inputs` unconditionally, build `AttentionGroup` without
positional builders and call
`initialize_metadata_builders`/`_init_device_metadata_providers` on
main, inline the SP-aware lcm, resolve cudagraph sizes without
`tensor_parallel_size`, treat `update_pass_config` as a no-op on main
and collapse 310P drafter kernel block sizes to an int |
| `vllm_ascend/worker/v2/block_table.py` |
[vllm#57169](vllm-project/vllm#57169) dropped
`kernel_block_sizes`/`blocks_per_kv_block` from `BlockTables` and
stopped expanding block ids | Version-split `__init__` to restore the
kernel-block layout (sizes, `blocks_per_kv_block`, expanded rows,
kernel-size tensor) and override `append_block_ids` on main |
| `vllm_ascend/worker/v2/model_runner.py` |
[vllm#58411](vllm-project/vllm#58411)
`randomize_inputs`; main's rejection sampler takes invalidation state
and needs the new `InputBatch` fields | Forward `randomize_inputs` and
`max_seq_len_np` unconditionally, skip grammar application on empty
logits and pass `grammar_invalid_drafts` output into the main rejection
sampler |
| `vllm_ascend/worker/v2/model_states/mamba_hybrid.py` | vLLM main
removed `MambaHybridModelState._ensure_align_ctx` and moved
align-context creation into `initialize_kv_cache`, so the first forward
aborted with `AttributeError: ... has no attribute '_ensure_align_ctx'`
/ `AssertionError` when the context was absent | Define
`_ensure_align_ctx` per lane: delegate on v0.31.0, lazily (re)create the
align context on main from the forward context |
| `vllm_ascend/worker/v2/pcp_manager.py` | vLLM main made
`shard_decode_requests` a required `PCPManager.__init__` argument and
`maybe_build_pcp_manager` passes it (`TypeError: ... unexpected keyword
argument 'shard_decode_requests'`) | Version-split
`AscendPCPManager.__init__`, accepting and forwarding the flag on main
while keeping the Ascend buffer setup shared |
| `vllm_ascend/worker/v2/spec_decode/autoregressive/aclgraph.py` |
[vllm#60335](vllm-project/vllm#60335) moved the
speculator CUDA-graph manager and added `num_speculative_steps` to the
captured forward | Import `SpeculatorCudaGraphManager` by lane and pass
`num_speculative_steps` on main |
| `vllm_ascend/worker/v2/spec_decode/autoregressive/speculator.py` |
[vllm#60335](vllm-project/vllm#60335) renamed
the AR base class and added `num_speculative_steps`;
[vllm#60754](vllm-project/vllm#60754) renamed
`dp_sync` -> `dp_sync_state` (`TypeError:
AscendAutoRegressiveSpeculator.propose() got an unexpected keyword
argument 'dp_sync_state'`) | Bind the upstream base class by lane and
version-split `propose()`/`_propose_impl()` plus
`_generate_draft`/`_multi_step_decode` so each lane forwards exactly its
arguments |
| `vllm_ascend/worker/v2/spec_decode/dflash/speculator.py` |
[vllm#57169](vllm-project/vllm#57169) makes the
DFlash caller forward the physical block size while the Ascend block
table stays kernel-block addressed (draft KV mismapped, every draft
rejected);
[vllm#60335](https://github.com/vllm-project/vllm/pull/60335)/[vllm#60754](https://github.com/vllm-project/vllm/pull/60754)
speculator contract | Version-split `prepare_dflash_inputs_factory`
(restoring the kernel block size per group on main) and
`propose()`/`_propose_impl()`, keeping the profiling DP-count guard |
| `vllm_ascend/worker/v2/spec_decode/dspark/speculator.py` | Same
speculator contract changes | Same version-split
`propose()`/`_propose_impl()` adaptation |
| `vllm_ascend/worker/worker.py` |
[vllm#58411](vllm-project/vllm#58411)
`profile_run` takes `randomize_inputs` | Compute `randomize_inputs` from
the env flag + DP size and forward it on both `profile_run` calls |

### Does this PR introduce _any_ user-facing change?

No. This is a CI/main2main compatibility update: behavior on vLLM main
is unchanged (the restorations only bring the main lane back to the
v0.31.0 behavior) and the v0.31.0 release lane is preserved.

### How was this patch tested?

- Unit tests updated per lane; `pytest -sv tests/ut` against both the
verified
  main commit (`a98247ab`) and the release tag (`v0.31.0`).


- vLLM main:
vllm-project/vllm@c4df37d

---------

Signed-off-by: hfadzxy <starmoon_zhang@163.com>
Signed-off-by: zhangxinyuehfad <starmoon_zhang@163.com>
chujiangang2006 pushed a commit to chujiangang2006/vllm-ascend that referenced this pull request Oct 20, 2026
### What this PR does / why we need it?

Bump the verified vLLM main pin from `c4df37df` to `a98247ab` and adapt
vllm-ascend to the upstream changes in that range. The v0.31.0 release
lane is kept intact: each adaptation is gated on
`vllm_version_is("0.31.0")` (or a version-aware helper) so both the
`main` and the `v0.31.0` CPU UT lanes stay green.

The range contains a large breaking KV-cache/attention rework plus a set
of smaller API changes:

- vllm#57169 reworked the KV cache layout: it dropped the MLA
`storage_block_size` override, added a leading `vllm_config` to
`_pool_bytes_per_block`, removed
`kernel_block_sizes`/`blocks_per_kv_block` from `BlockTables`, split
metadata-builder creation out of `initialize_attn_backend` and made
`AttentionGroup` identity-comparable.
- vllm#60335 renamed the spec-decode AR path (`autoregressive` ->
`target_dependent_ar`) and added `num_speculative_steps`/
`num_speculative_tokens` to `propose()` and the decode callbacks.
- vllm#60517 removed the torch.compile sequence-parallelism/AsyncTP
passes `PassConfig.enable_sp`/`fuse_gemm_comms`/`sp_min_token_num`,
`update_sizes_for_sequence_parallelism` and the `tensor_parallel_size`
argument of the cudagraph-size resolvers.
- vllm#60754 renamed the DP-sync state (`dp_sync` -> `dp_sync_state`)
and added `ExecuteModelState.num_spec_tokens_to_schedule`.
- vllm#58411 added `randomize_inputs` to `profile_run`/`_dummy_run`.
- vllm#60271 added a hard batch-invariance support check for every
attention backend.
- vllm#59327 moved the DeepSeek-V4.1 Engram module to `common.engram`.
- vllm#57387 moved the GLM-5-Next config classes into `transformers`
(hence the `transformers` 5.14.1 -> 5.19.0 bump, which main requires
anyway).
- Smaller seams: vllm#59175 added `prefill_end` to KV allocation,
vllm#53175 forwards the layer's spec to
`get_supported_kernel_block_sizes`, vllm#58067 passes `separators` to
xgrammar, vllm#53934 made `CudaGraphManager.dp_size` a property,
vllm#56723 builds draft metadata through the attention group, vllm#57934
makes MRV1 reject DFlash candidate-head drafts.

| Files | Upstream vLLM change (why it breaks vllm-ascend) | vllm-ascend
adaptation |

|-------|--------------------------------------------------|------------------------|
| `.github/vllm-main-verified.commit` | — (main-lane pin only) |
Verified main commit bumped `c4df37df` -> `a98247ab` |
| `pyproject.toml` | vLLM main requires `transformers >= 5.16.1` | Build
requirement bumped `transformers==5.14.1` -> `5.19.0` (satisfies both
lanes) |
| `requirements.txt` | Same transformers floor | Runtime requirement
bumped `transformers==5.14.1` -> `5.19.0` |
| `tests/deepseek_v41_utils.py` |
[vllm#57169](vllm-project/vllm#57169) removed
MLA `storage_block_size` | Gate the `storage_block_size` kwarg of the
DSV4 k-cache and indexer k-cache specs on `vllm_version_is("0.31.0")` |
| `tests/e2e/pull_request/four_card/glm53flash_assets/config.json` |
[vllm#57387](vllm-project/vllm#57387) serves
GLM-5-Next configs from `transformers` 5.19.0, which validates every
field type | Write `swiglu_limit: 10.0` and `gate_lower_bound: -5.0` as
floats |
| `tests/e2e/pull_request/four_card/glm53flash_assets/multimodal.json` |
Same strict dataclass validation | Write `vision_config.swiglu_limit:
10` -> `10.0` |
| `tests/e2e/pull_request/two_card/spec_decode/test_spec_decode.py` |
[vllm#57934](vllm-project/vllm#57934): MRV1
rejects DFlash candidate-head drafts on main | Make the
`test_dflash2_acceptance` skip unconditional instead of main-only |
| `tests/ut/attention/test_batch_invariance_support.py` |
[vllm#60271](vllm-project/vllm#60271) added the
batch-invariance support check | New regression test asserting
`supports_batch_invariance()` on all Ascend backends and the 310P/C8MXFP
subclasses |
| `tests/ut/compilation/test_graph_fusion_pass_manager.py` |
[vllm#60517](vllm-project/vllm#60517) removed
`PassConfig.fuse_gemm_comms` | Only seed the PassConfig flag on v0.31.0
and patch `enable_sp` for the main lane gate |
| `tests/ut/core/test_kv_cache_interface.py` |
[vllm#57169](vllm-project/vllm#57169) removed
`MLAAttentionSpec.storage_block_size` | Add a plain-MLA-subclass case
(`HiddenStateCacheSpec`) resolving `get_storage_block_size()` per lane |
| `tests/ut/distributed/kv_transfer/kv_p2p/test_mooncake_connector.py` |
vLLM main's scheduler calls `get_loaded_kv_cache_group_ids`, backed by
`KVConnectorBase_V1._kv_cache_config` | Seed
`MockKVCacheConfig.transfer_group_ids` and add the main-only
scheduler-hook test (skipped on v0.31.0) |
| `tests/ut/kv_offload/test_mooncake_hybrid_connector.py` | Same new
`get_loaded_kv_cache_group_ids` scheduler hook | Assert the hook is
declared on the class only on main |
| `tests/ut/kv_offload/test_preempt_offload_connector.py` | vLLM main's
remote-KV restore consults `scheduler.prefix_replay_group_ids` | Seed
`prefix_replay_group_ids = ()` in the `__new__`-based scheduler fixture
|
| `tests/ut/models/test_deepseek_v41_cache.py` |
[vllm#57169](vllm-project/vllm#57169) added the
leading `vllm_config` to `_pool_bytes_per_block` and removed MLA
`storage_block_size` | Add a `_pool_bytes_per_block(runtime, groups)`
lane helper, read specs through `get_storage_block_size()` and gate the
one explicit `storage_block_size` kwarg |
| `tests/ut/models/test_engram.py` |
[vllm#59327](vllm-project/vllm#59327) deleted
`deepseek_v41/nvidia/engram.py` and moved it to `common.engram` | Import
`upstream_engram` by lane so collection no longer aborts with
`ImportError` on main |
| `tests/ut/models/test_glm5_next_mtp.py` |
[vllm#57387](vllm-project/vllm#57387) removed
`vllm.transformers_utils.configs.glm5_next` | Import
`Glm5NextTextConfig` from `transformers` on main, keep the vLLM path on
v0.31.0 |
| `tests/ut/ops/test_gdn_attn_builder.py` | Main's GDN metadata builder
resolves the prefill backend from `model_config.hf_text_config` | Give
the `model_config` fixture an `hf_text_config` |
| `tests/ut/patch/platform/test_patch_structured_output.py` | Main gates
the guidance backend on `GuidanceBackend.is_tokenizer_supported` |
Monkeypatch that check to accept the dummy tokenizer on main |
| `tests/ut/patch/platform/test_patch_use_v2_model_runner.py` |
[vllm#60517](vllm-project/vllm#60517) dropped
the `PassConfig.enable_sp` guard, so the V2 runner no longer rejects SP
| Expect `["sequence parallelism"]` only on v0.31.0 |
| `tests/ut/patch/platform/test_prefix_cache_cp_patches.py` |
[vllm#57169](vllm-project/vllm#57169) resolves
the KV cache layout when computing pool bytes per block | Pass
`vllm_config` to the Ascend/upstream `_pool_bytes_per_block` on main and
seed `get_resolved_kv_cache_layout` |
| `tests/ut/spec_decode/test_dflash2_v2.py` |
[vllm#57169](vllm-project/vllm#57169) forwards
the physical block size to the DFlash caller;
[vllm#60754](vllm-project/vllm#60754) renamed
`dp_sync` | Select the `dp_sync`/`dp_sync_state` keyword per lane and
add the main-only kernel-block-size restore test |
| `tests/ut/spec_decode/test_eagle_proposer.py` |
[vllm#60517](vllm-project/vllm#60517) removed
`PassConfig.enable_sp` | Assert `enable_sp` is a PassConfig field only
on v0.31.0 |
| `tests/ut/spec_decode/test_mla_dspark.py` |
[vllm#60754](vllm-project/vllm#60754) renamed
`dp_sync` -> `dp_sync_state` | Pass the lane-specific keyword into
`DSparkSpeculator.propose` |
| `tests/ut/test_platform.py` |
[vllm#60517](vllm-project/vllm#60517) removed
the PassConfig SP fields and `update_sizes_for_sequence_parallelism` |
Assert the SP threshold default only on v0.31.0 and that the removed
method is no longer called on main |
| `tests/ut/worker/test_adaptive_verification.py` |
[vllm#60754](vllm-project/vllm#60754) renamed
the DP-sync argument | Build the execute-model kwargs with
`dp_sync`/`dp_sync_state` per lane |
| `tests/ut/worker/test_attn_utils_v2.py` | vLLM main made
`AttentionGroup` identity-comparable | Compare the preserved fields
(backend, layer names, spec, group id) on main instead of `==` |
| `tests/ut/worker/test_dcp_speculator_metadata_v2.py` |
[vllm#60335](vllm-project/vllm#60335) renamed
the AR speculator module;
[vllm#56723](vllm-project/vllm#56723) builds
draft metadata through the attention group | Import
`TargetDependentARSpeculator` on main and add a recording attention
group exposing `build_metadata` |
| `tests/ut/worker/test_model_runner_v1.py` |
[vllm#57169](vllm-project/vllm#57169) removed
`BlockTables.kernel_block_sizes`; main module lacks
`mamba_utils.postprocess_mamba_all` | Pass `kernel_block_sizes` only on
v0.31.0 and patch with `create=True` |
| `tests/ut/worker/test_model_runner_v2.py` |
[vllm#60517](https://github.com/vllm-project/vllm/pull/60517)/[vllm#58411](https://github.com/vllm-project/vllm/pull/58411):
`max_seq_len_np` and `randomize_inputs` exist on both lanes now | Drop
the per-lane gating and always supply `max_seq_len_np` / expect
`randomize_inputs` |
| `tests/ut/worker/test_model_runner_v2_mamba.py` | vLLM main removed
`MambaHybridModelState._ensure_align_ctx` | Seed `_mamba_ctx` on main
and add two main-only `_ensure_align_ctx` regression tests |
| `tests/ut/worker/test_mtp_pcp_speculator_v2.py` |
[vllm#60335](vllm-project/vllm#60335) renamed
the AR base class;
[vllm#60754](vllm-project/vllm#60754) renamed
`dp_sync` | Import the base class by lane and patch
`_UpstreamAutoRegressiveSpeculator` via the lane-specific keyword |
| `tests/ut/worker/test_pcp_manager_v2.py` | Main declares
`ParallelConfig.pcp_shard_decode_requests`, renamed `dp_sync` and added
`num_spec_tokens_to_schedule` | Assert the field per lane, build
`ExecuteModelState` with the lane keyword and seed
`num_spec_tokens_to_schedule` |
| `tests/ut/worker/test_v2_dummy_padding.py` |
[vllm#60754](vllm-project/vllm#60754) renamed
`dp_sync`; main's dummy context reads `block_tables.block_sizes` | Pass
the lane keyword and provide both `block_sizes` and `kernel_block_sizes`
|
| `tests/ut/worker/test_worker_v1.py` |
[vllm#58411](vllm-project/vllm#58411):
`determine_available_memory` now forwards
`profile_run(randomize_inputs=...)` | Update the stale
`assert_called_once_with()` to expect `randomize_inputs=False` |
| `tests/ut/worker/v2/test_aclgraph.py` |
[vllm#60335](vllm-project/vllm#60335) moved
`SpeculatorCudaGraphManager` to `target_dependent_ar`;
[vllm#53934](vllm-project/vllm#53934) made
`dp_size` a read-only property | Import the manager by lane, back
`dp_size` with `vllm_config` on main and expect the extra
`num_speculative_steps` capture arg |
| `tests/ut/worker/v2/test_speculator.py` |
[vllm#60335](vllm-project/vllm#60335) renamed
the AR speculator and added `num_speculative_steps`;
[vllm#60754](vllm-project/vllm#60754) renamed
`dp_sync` | Import by lane, thread `num_speculative_steps` through the
`_generate_draft`/`_multi_step_decode` assertions and add the main
`dp_sync_state` + `num_speculative_tokens` regression test |
| `tests/ut/worker/v2/test_v2_block_table.py` |
[vllm#57169](vllm-project/vllm#57169) dropped
`kernel_block_sizes` from `BlockTables` | Make the stand-in parent
init's kernel sizes optional and assert the kernel tensor is built by
`AscendBlockTables` on main |
| `vllm_ascend/_310p/sharded_state_loader_310p.py` | vLLM main split
`ShardedStateLoader.DEFAULT_PATTERN` into
`TP_ONLY_PATTERN`/`PP_AND_TP_PATTERN` | Pick the lane's default pattern
name instead of the removed combined one |
| `vllm_ascend/_310p/worker/v2/model_runner.py` |
[vllm#60517](vllm-project/vllm#60517) removed
the `tensor_parallel_size` argument of
`resolve_cudagraph_mode_and_sizes` | Forward `tensor_parallel_size` only
on v0.31.0 |
| `vllm_ascend/_310p/worker/v2/spec_decode/mtp_speculator.py` |
[vllm#60335](vllm-project/vllm#60335) renamed
the AR module and added `num_speculative_steps` to
`_generate_draft`/`_multi_step_decode` | Version-split the two overrides
and the AR import, falling back to `self.num_speculative_steps` when the
capture path omits it |
| `vllm_ascend/ascend_config.py` |
[vllm#60517](vllm-project/vllm#60517) removed
`PassConfig.enable_sp` | Read the flag only on v0.31.0, so
`enable_sp_by_pass` is False (no pass-based SP) on main |
| `vllm_ascend/attention/attention_v1.py` |
[vllm#60271](vllm-project/vllm#60271) rejects
backends that do not support batch invariance | Declare
`supports_batch_invariance()` on main (`not vllm_version_is("0.31.0")`)
|
| `vllm_ascend/attention/dsa_v1.py` |
[vllm#60271](vllm-project/vllm#60271)
batch-invariance check;
[vllm#53175](vllm-project/vllm#53175) forwards
the layer's `KVCacheSpec` into `get_supported_kernel_block_sizes`, so a
rebase had overwritten the six DSA backends back to the zero-arg form
and main raised `TypeError: ... takes 0 positional arguments but 1 was
given` | Re-apply `supports_batch_invariance()` and give all six DSA
backends the per-lane
`get_supported_kernel_block_sizes(kv_cache_spec=None)` signature |
| `vllm_ascend/attention/dsa_v41.py` |
[vllm#60271](vllm-project/vllm#60271)
batch-invariance check | Declare `supports_batch_invariance()` on
`DeepseekV41CacheBackend` for main |
| `vllm_ascend/attention/fa3_v1.py` | Same | Declare
`supports_batch_invariance()` on `AscendFABackend` for main |
| `vllm_ascend/attention/indexer.py` | Same | Declare
`supports_batch_invariance()` on `AscendSFAIndexerBackend` for main |
| `vllm_ascend/attention/indexer_kpool.py` | Same | Declare
`supports_batch_invariance()` on the indexer k-pool and tail backends
for main |
| `vllm_ascend/attention/mla_v1.py` | Same | Declare
`supports_batch_invariance()` on `AscendMLABackend` for main |
| `vllm_ascend/attention/sfa_v1.py` | Same | Declare
`supports_batch_invariance()` on `AscendSFABackend` for main |
| `vllm_ascend/compilation/graph_fusion_pass_manager.py` |
[vllm#60517](vllm-project/vllm#60517) removed
`PassConfig.fuse_gemm_comms` | Gate the MMRS fusion on
`enable_sp(config)` on main, keep reading the PassConfig flag on v0.31.0
|
| `vllm_ascend/core/kv_cache_interface.py` |
[vllm#57169](vllm-project/vllm#57169) removed
the MLA `storage_block_size` override, so a plain MLA subclass crashed
with `AttributeError: 'HiddenStateCacheSpec' object has no attribute
'storage_block_size'` | Read the optional override only on v0.31.0 and
fall back to `block_size` on main |
| `vllm_ascend/distributed/kv_transfer/kv_p2p/mooncake_connector.py` |
vLLM main's scheduler calls `get_loaded_kv_cache_group_ids`, which reads
`_kv_cache_config`; the Ascend connector overrode `__init__` without
calling the base and never set it (`AttributeError: 'MooncakeConnector'
object has no attribute '_kv_cache_config'`) | Call
`KVConnectorBase_V1.__init__` on main and declare the main-only
`get_loaded_kv_cache_group_ids` hook |
|
`vllm_ascend/distributed/kv_transfer/kv_p2p/mooncake_hybrid_connector.py`
| Same | Same base-init binding and main-only hook |
| `vllm_ascend/models/deepseek_v41/cache_config.py` |
[vllm#57169](vllm-project/vllm#57169) removed
MLA `storage_block_size` | Gate the kwarg in
`make_mla_cache_spec`/`make_index_cache_spec`/`make_folded_index_cache_spec`
on v0.31.0 |
| `vllm_ascend/models/deepseek_v41/engram/parallel.py` |
[vllm#59327](vllm-project/vllm#59327) moved
`engram_head_shard_rank` from `nvidia.engram` to `common.engram` |
Import `engram_head_shard_rank` by lane |
| `vllm_ascend/models/glm5next/attention.py` |
[vllm#57387](vllm-project/vllm#57387) removed
`vllm.transformers_utils.configs.glm5_next`, making the direct import
unresolvable (mypy `import-not-found`) | Import `Glm5NextConfig` from
`transformers` on main, keep the vLLM path on v0.31.0 |
| `vllm_ascend/models/glm5next/kda.py` | Same | Same lane-gated
`Glm5NextConfig` import |
| `vllm_ascend/models/glm5next/model.py` | Same | Same lane-gated
`Glm5NextConfig` import |
| `vllm_ascend/models/kimi_k3.py` | vLLM main made `out_hidden_size` a
required positional argument of `KimiK25MultiModalProjector`
(`TypeError: ... missing 1 required positional argument:
'out_hidden_size'`) | Pass `out_hidden_size = self.hidden_size` on main
only |
| `vllm_ascend/models/minimax_m3/msa_m3.py` |
[vllm#60271](vllm-project/vllm#60271)
batch-invariance check | Declare `supports_batch_invariance()` on the
MiniMax-M3 sparse/indexer backends for main |
| `vllm_ascend/patch/__init__.py` |
[vllm#58067](vllm-project/vllm#58067) xgrammar
`separators`; stale v0.30.0 boundary wording | Document the new xgrammar
patch (why/how/future plan) and rename the boundary to v0.31.0 |
| `vllm_ascend/patch/platform/__init__.py` | Stale release-lane wording
in the Engram adapter comment | `v0.30.0+` -> `v0.31.0+` |
| `vllm_ascend/patch/platform/patch_balance_schedule.py` | Stale
release-lane wording in the block-state snapshot comment | `vLLM
main/v0.30.0` -> `vLLM main/v0.31.0` |
| `vllm_ascend/patch/platform/patch_kv_cache_utils.py` |
[vllm#57169](vllm-project/vllm#57169) added a
leading `vllm_config` argument to `_pool_bytes_per_block` | Define
`_ascend_pool_bytes_per_block` per lane, forwarding `vllm_config` to the
upstream fallback on main |
| `vllm_ascend/patch/platform/patch_mamba_manager.py` |
[vllm#59175](vllm-project/vllm#59175) added
`prefill_end` to `get_num_blocks_to_allocate` | Always forward
`prefill_end` and drop the now-redundant lane gate |
| `vllm_ascend/patch/platform/patch_structured_output.py` |
[vllm#58067](vllm-project/vllm#58067) passes
`separators=(",", ":")` to `GrammarCompiler.compile_json_schema`, which
the shipped xgrammar (0.2.7/0.2.8) mishandles (truncated, invalid JSON
in guided decoding) | Wrap `compile_json_schema` to force
`separators=None` on main only, until xgrammar >= 0.2.9 is pinned |
| `vllm_ascend/patch/worker/__init__.py` |
[vllm#60335](vllm-project/vllm#60335) renamed
the AR speculator module | Import the AR module by lane before the 310P
manager override |
| `vllm_ascend/patch/worker/patch_v2/patch_eagle_speculator.py` | Same
AR module rename | Bind `vllm_speculator_module` from
`target_dependent_ar` on main, `autoregressive` on v0.31.0 |
| `vllm_ascend/patch/worker/patch_v2/patch_model_runner.py` |
[vllm#60517](vllm-project/vllm#60517) removed
the `tensor_parallel_size` argument | Forward it only on v0.31.0 |
| `vllm_ascend/patch/worker/patch_v2/patch_spec_decode_310.py` | Same AR
module rename | Import the AR module by lane before patching the CPU
input helpers |
| `vllm_ascend/platform.py` |
[vllm#60517](vllm-project/vllm#60517) removed
`PassConfig.enable_sp`/`fuse_gemm_comms`/`sp_min_token_num` and
`update_sizes_for_sequence_parallelism` | Gate the SP threshold default
on v0.31.0 and inline the tp-multiple filtering on main |
| `vllm_ascend/worker/model_runner_v1.py` |
[vllm#58411](vllm-project/vllm#58411)
`randomize_inputs`;
[vllm#57169](vllm-project/vllm#57169) split
metadata-builder creation and changed `AttentionGroup`;
[vllm#60517](vllm-project/vllm#60517) removed
the SP pass and the `tensor_parallel_size` argument | Forward
`randomize_inputs` unconditionally, build `AttentionGroup` without
positional builders and call
`initialize_metadata_builders`/`_init_device_metadata_providers` on
main, inline the SP-aware lcm, resolve cudagraph sizes without
`tensor_parallel_size`, treat `update_pass_config` as a no-op on main
and collapse 310P drafter kernel block sizes to an int |
| `vllm_ascend/worker/v2/block_table.py` |
[vllm#57169](vllm-project/vllm#57169) dropped
`kernel_block_sizes`/`blocks_per_kv_block` from `BlockTables` and
stopped expanding block ids | Version-split `__init__` to restore the
kernel-block layout (sizes, `blocks_per_kv_block`, expanded rows,
kernel-size tensor) and override `append_block_ids` on main |
| `vllm_ascend/worker/v2/model_runner.py` |
[vllm#58411](vllm-project/vllm#58411)
`randomize_inputs`; main's rejection sampler takes invalidation state
and needs the new `InputBatch` fields | Forward `randomize_inputs` and
`max_seq_len_np` unconditionally, skip grammar application on empty
logits and pass `grammar_invalid_drafts` output into the main rejection
sampler |
| `vllm_ascend/worker/v2/model_states/mamba_hybrid.py` | vLLM main
removed `MambaHybridModelState._ensure_align_ctx` and moved
align-context creation into `initialize_kv_cache`, so the first forward
aborted with `AttributeError: ... has no attribute '_ensure_align_ctx'`
/ `AssertionError` when the context was absent | Define
`_ensure_align_ctx` per lane: delegate on v0.31.0, lazily (re)create the
align context on main from the forward context |
| `vllm_ascend/worker/v2/pcp_manager.py` | vLLM main made
`shard_decode_requests` a required `PCPManager.__init__` argument and
`maybe_build_pcp_manager` passes it (`TypeError: ... unexpected keyword
argument 'shard_decode_requests'`) | Version-split
`AscendPCPManager.__init__`, accepting and forwarding the flag on main
while keeping the Ascend buffer setup shared |
| `vllm_ascend/worker/v2/spec_decode/autoregressive/aclgraph.py` |
[vllm#60335](vllm-project/vllm#60335) moved the
speculator CUDA-graph manager and added `num_speculative_steps` to the
captured forward | Import `SpeculatorCudaGraphManager` by lane and pass
`num_speculative_steps` on main |
| `vllm_ascend/worker/v2/spec_decode/autoregressive/speculator.py` |
[vllm#60335](vllm-project/vllm#60335) renamed
the AR base class and added `num_speculative_steps`;
[vllm#60754](vllm-project/vllm#60754) renamed
`dp_sync` -> `dp_sync_state` (`TypeError:
AscendAutoRegressiveSpeculator.propose() got an unexpected keyword
argument 'dp_sync_state'`) | Bind the upstream base class by lane and
version-split `propose()`/`_propose_impl()` plus
`_generate_draft`/`_multi_step_decode` so each lane forwards exactly its
arguments |
| `vllm_ascend/worker/v2/spec_decode/dflash/speculator.py` |
[vllm#57169](vllm-project/vllm#57169) makes the
DFlash caller forward the physical block size while the Ascend block
table stays kernel-block addressed (draft KV mismapped, every draft
rejected);
[vllm#60335](https://github.com/vllm-project/vllm/pull/60335)/[vllm#60754](https://github.com/vllm-project/vllm/pull/60754)
speculator contract | Version-split `prepare_dflash_inputs_factory`
(restoring the kernel block size per group on main) and
`propose()`/`_propose_impl()`, keeping the profiling DP-count guard |
| `vllm_ascend/worker/v2/spec_decode/dspark/speculator.py` | Same
speculator contract changes | Same version-split
`propose()`/`_propose_impl()` adaptation |
| `vllm_ascend/worker/worker.py` |
[vllm#58411](vllm-project/vllm#58411)
`profile_run` takes `randomize_inputs` | Compute `randomize_inputs` from
the env flag + DP size and forward it on both `profile_run` calls |

### Does this PR introduce _any_ user-facing change?

No. This is a CI/main2main compatibility update: behavior on vLLM main
is unchanged (the restorations only bring the main lane back to the
v0.31.0 behavior) and the v0.31.0 release lane is preserved.

### How was this patch tested?

- Unit tests updated per lane; `pytest -sv tests/ut` against both the
verified
  main commit (`a98247ab`) and the release tag (`v0.31.0`).


- vLLM main:
vllm-project/vllm@c4df37d

---------

Signed-off-by: hfadzxy <starmoon_zhang@163.com>
Signed-off-by: zhangxinyuehfad <starmoon_zhang@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working mrv2 Model Runner V2 specific ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants