Skip to content

[Bug Fix][Model Runner V2][Spec Decode] Warmup & capture with different attention states for speculator prefill - #44253

Merged
WoosukKwon merged 2 commits into
vllm-project:mainfrom
TheEpicDolphin:fix/mrv2-speculator-lazy-attn-state
Jun 3, 2026
Merged

WoosukKwon merged 2 commits into
vllm-project:mainfrom
TheEpicDolphin:fix/mrv2-speculator-lazy-attn-state

Conversation

@TheEpicDolphin

@TheEpicDolphin TheEpicDolphin commented Jun 1, 2026 •

Copy link
Copy Markdown
Member

Context

I noticed an issue previously for MRV2 DSV4 where the model would output gibberish for simple prompts. The root cause was that the model was running both the warmup and capture forward passes using the same attention metadata. This was problematic for attention backends (e.g. FlashMLA) that lazily initialize metadata state. The warmup pass (run eagerly) triggers the lazy init and flips an have_initialized flag on the metadata, so the capture pass then sees the flag already set, skips the init, and never records the initialization kernel into the graph. That issue was fixed with this PR by using separate attention metadata for warmup and capture, so the init runs and is recorded during capture.

A similar issue happens with MRV2 DSV4 MTP, and likely also with other speculator attention backends that perform lazy metadata initializations. In the speculator case, PrefillEagleCudaGraphManager does not build its own metadata. It reuses the target model's capture metadata, returning that same object from create_forward_fn both when CudaGraphManager calls it before warmup and again before capture.

The key subtlety is that CUDA graph capture records kernels without executing them. So when the target model captured its graph, the FlashMLA planner's host code set have_initialized=True and bound a freshly-allocated tile_scheduler_metadata / num_splits tensor — but the kernel that fills those buffers was only recorded, never executed. The buffers are valid allocations holding garbage.

The speculator then receives this metadata and runs its prefill warmup eagerly (real execution). Because have_initialized is already True, the planner is skipped and the garbage scheduler buffers are fed straight into the FlashMLA decode kernel, which indexes the KV cache / block table out of bounds. The result is this error during speculator prefill capture:

(Worker_DP3_EP3 pid=2845516) ERROR 06-01 23:50:49 [multiproc_executor.py:966]   File "/home/gdelfin/vllm/vllm/v1/worker/gpu/model_runner.py", line 653, in capture_model
(Worker_DP3_EP3 pid=2845516) ERROR 06-01 23:50:49 [multiproc_executor.py:966]     self.speculator.capture(captured_attn_states)
(Worker_DP3_EP3 pid=2845516) ERROR 06-01 23:50:49 [multiproc_executor.py:966]   File "/home/gdelfin/vllm/vllm/v1/worker/gpu/spec_decode/eagle/speculator.py", line 443, in capture
(Worker_DP3_EP3 pid=2845516) ERROR 06-01 23:50:49 [multiproc_executor.py:966]     self.prefill_cudagraph_manager.capture(
(Worker_DP3_EP3 pid=2845516) ERROR 06-01 23:50:49 [multiproc_executor.py:966]   File "/home/gdelfin/vllm/vllm/v1/worker/gpu/spec_decode/eagle/cudagraph.py", line 53, in capture
(Worker_DP3_EP3 pid=2845516) ERROR 06-01 23:50:49 [multiproc_executor.py:966]     super().capture(create_forward_fn, progress_bar_desc)
(Worker_DP3_EP3 pid=2845516) ERROR 06-01 23:50:49 [multiproc_executor.py:966]   File "/home/gdelfin/vllm/.venv/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 124, in decorate_context
(Worker_DP3_EP3 pid=2845516) ERROR 06-01 23:50:49 [multiproc_executor.py:966]     return func(*args, **kwargs)
(Worker_DP3_EP3 pid=2845516) ERROR 06-01 23:50:49 [multiproc_executor.py:966]            ^^^^^^^^^^^^^^^^^^^^^
(Worker_DP3_EP3 pid=2845516) ERROR 06-01 23:50:49 [multiproc_executor.py:966]   File "/home/gdelfin/vllm/vllm/v1/worker/gpu/cudagraph_utils.py", line 255, in capture
(Worker_DP3_EP3 pid=2845516) ERROR 06-01 23:50:49 [multiproc_executor.py:966]     with torch.cuda.graph(graph, self.pool):
(Worker_DP3_EP3 pid=2845516) ERROR 06-01 23:50:49 [multiproc_executor.py:966]          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(Worker_DP3_EP3 pid=2845516) ERROR 06-01 23:50:49 [multiproc_executor.py:966]   File "/home/gdelfin/vllm/.venv/lib/python3.12/site-packages/torch/cuda/graphs.py", line 239, in __enter__
(Worker_DP3_EP3 pid=2845516) ERROR 06-01 23:50:49 [multiproc_executor.py:966]     torch.cuda.synchronize()
(Worker_DP3_EP3 pid=2845516) ERROR 06-01 23:50:49 [multiproc_executor.py:966]   File "/home/gdelfin/vllm/.venv/lib/python3.12/site-packages/torch/cuda/__init__.py", line 1162, in synchronize
(Worker_DP3_EP3 pid=2845516) ERROR 06-01 23:50:49 [multiproc_executor.py:966]     return torch._C._cuda_synchronize()
(Worker_DP3_EP3 pid=2845516) ERROR 06-01 23:50:49 [multiproc_executor.py:966]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(Worker_DP3_EP3 pid=2845516) ERROR 06-01 23:50:49 [multiproc_executor.py:966] torch.AcceleratorError: CUDA error: unspecified launch failure
(Worker_DP3_EP3 pid=2845516) ERROR 06-01 23:50:49 [multiproc_executor.py:966] Search for `cudaErrorLaunchFailure' in https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__TYPES.html for more information.
(Worker_DP3_EP3 pid=2845516) ERROR 06-01 23:50:49 [multiproc_executor.py:966] CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
(Worker_DP3_EP3 pid=2845516) ERROR 06-01 23:50:49 [multiproc_executor.py:966] For debugging consider passing CUDA_LAUNCH_BLOCKING=1
(Worker_DP3_EP3 pid=2845516) ERROR 06-01 23:50:49 [multiproc_executor.py:966] Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.

This PR

Fixes the above issue by modifying CudaGraphManager.capture to return, for each batch descriptor, the attention states used for both warmup and capture. These are passed into PrefillEagleCudaGraphManager and the correct one is used for the speculator forward pass based on the warmup parameter. This ensures that we don't invoke the warmup and capture forward passes on the same attention metadata.

Benchmarks

Server Command

#!/bin/bash

export VLLM_USE_V2_MODEL_RUNNER=1
export VLLM_DEEP_GEMM_WARMUP="skip"

MODEL_CKPT="deepseek-ai/DeepSeek-V4-Flash"

vllm serve $MODEL_CKPT \
    -dp 4 -ep \
    --port 8003 \
    --block-size 256 \
    --kv-cache-dtype fp8 \
    --tokenizer-mode deepseek_v4 \
    --tool-call-parser deepseek_v4 \
    --reasoning-parser deepseek_v4 \
    --moe-backend deep_gemm_mega_moe \
    --speculative-config '{"method": "mtp", "num_speculative_tokens": 3}' \
    --no-enable-prefix-caching \
    --kernel-config.enable_flashinfer_autotune=False

Benchmark Command

vllm-bench --backend openai-chat \
     --base-url http://127.0.0.1:8003 \
     --model deepseek-ai/DeepSeek-V4-Flash\
     --dataset-name speed-bench \
     --speed-bench-config throughput_16k \
     --speed-bench-max-input-len 8192 \
     --speed-bench-category low_entropy \
     --output-len 1024 \
     --save-result \
     --num-warmups 1 \
     --seed 420 \
     --sweep-max-concurrency 1,2,1024 \
     --sweep-num-prompts-factor 5 \
     --temperature 0 \
     --top-p 1

Results

Metric Concurrency = 1 Concurrency = 2 Concurrency = 1024
Benchmark duration (s) 14.60 17.14 390.02
Total input tokens 40,960 81,920 41,943,040
Total generated tokens 3,688 7,752 2,851,158
Request throughput (req/s) 0.34 0.58 13.13
Output token throughput (tok/s) 252.64 452.38 7,310.21
Peak output token throughput (tok/s) 96.00 187.00 16,893.00
Total token throughput (tok/s) 3,058.57 5,232.93 114,849.87
Mean TTFT (ms) 264.37 296.63 22,956.43
Median TTFT (ms) 264.00 258.02 19,345.86
P90 TTFT (ms) 270.02 444.74 38,323.11
P99 TTFT (ms) 273.17 458.13 61,000.88
Mean TPOT (ms) 3.63 4.04 89.74
Median TPOT (ms) 3.68 3.86 77.74
P90 TPOT (ms) 3.74 4.29 114.70
P99 TPOT (ms) 3.74 5.55 315.51
Mean ITL (ms) 10.59 11.39 250.53
Median ITL (ms) 10.50 10.85 208.79
P90 ITL (ms) 11.02 10.95 240.82
P99 ITL (ms) 15.46 13.35 299.93
Mean E2EL (ms) 2,919.42 3,314.18 70,754.69
Median E2EL (ms) 2,996.37 4,155.82 65,880.41
P90 E2EL (ms) 3,850.75 4,444.94 117,805.97
P99 E2EL (ms) 3,852.71 4,487.04 149,902.46
Acceptance rate (%) 65.22 64.62 64.46
Acceptance length 2.96 2.94 2.93
Drafts 1,248 2,639 971,705
Draft tokens 3,744 7,917 2,915,115
Accepted tokens 2,442 5,116 1,879,132
Position 0 acceptance (%) 94.95 95.60 94.56
Position 1 acceptance (%) 68.83 67.49 68.13
Position 2 acceptance (%) 31.89 30.77 30.69

No more startup failure!

…rent attention states for speculator prefill

Signed-off-by: Giancarlo Delfin <gdelfin@inferact.ai>
@mergify mergify Bot added nvidia v1 bug Something isn't working labels Jun 1, 2026
@TheEpicDolphin
TheEpicDolphin marked this pull request as ready for review June 2, 2026 00:07
@TheEpicDolphin TheEpicDolphin added the ready ONLY add when PR is ready to merge/full CI is needed label Jun 2, 2026
@WoosukKwon
WoosukKwon enabled auto-merge (squash) June 3, 2026 20:32
@WoosukKwon
WoosukKwon merged commit 91945b6 into vllm-project:main Jun 3, 2026
64 checks passed
@github-project-automation github-project-automation Bot moved this to Done in NVIDIA Jun 3, 2026
@TheEpicDolphin
TheEpicDolphin deleted the fix/mrv2-speculator-lazy-attn-state branch June 3, 2026 20:38
nkzhenhua pushed a commit to nkzhenhua/vllm that referenced this pull request Jun 24, 2026
…nt attention states for speculator prefill (vllm-project#44253)

Signed-off-by: Giancarlo Delfin <gdelfin@inferact.ai>
Co-authored-by: Woosuk Kwon <woosuk@inferact.ai>
MengqingCao pushed a commit to vllm-project/vllm-ascend that referenced this pull request Jul 4, 2026
### What this PR does / why we need it?

This PR upgrades the verified vLLM main commit to
`b9a7cd464c9ae9b1b450f8982b76d7be4de73724` and adapts vLLM Ascend to
upstream API changes introduced after the previous verified commit.

`vllm_ascend/__init__.py`

- Set `VLLM_USE_V2_MODEL_RUNNER=0` for non-`0.23.0`.
- Reason: this branch keeps the main compatibility path on V1 model
runner. V2 still has
partial compatibility updates, but it is not enabled as the default path
here.
- Related upstream changes: vLLM Model Runner V2 migration work,
including
[vllm#42667](vllm-project/vllm#42667) and
[vllm#44446](vllm-project/vllm#44446).

`tests/e2e/pull_request/one_card/test_guided_decoding.py`

- For non-`0.23.0` and `xgrammar` / `outlines`, set
  `VLLM_REGEX_COMPILATION_TIMEOUT_S=30` during the test.
- Keep `0.23.0` behavior unchanged.
- Reason: upstream added a structured-output regex compilation timeout.
The existing
complex JSON schema can exceed the default 5s timeout during grammar
compilation.
- Upstream source:
[vllm#45118](vllm-project/vllm#45118).

`vllm_ascend/core/scheduler_profiling_chunk.py`

- Add `throttle_prefills: bool = False` to
`ProfilingChunkScheduler.schedule`.
- Reason: upstream scheduler `schedule()` now accepts
`throttle_prefills`.
- Upstream source:
[vllm#44558](vllm-project/vllm#44558).

`vllm_ascend/patch/platform/patch_balance_schedule.py`

- Add `throttle_prefills` to `BalanceScheduler.schedule`.
- For `0.23.0`, continue calling `super().schedule()` with no argument.
- For non-`0.23.0`, forward `throttle_prefills` to upstream scheduler.
- Reason: keep the balance scheduler wrapper compatible with both old
and new upstream
  scheduler signatures.
- Upstream source:
[vllm#44558](vllm-project/vllm#44558).

`vllm_ascend/patch/platform/patch_profiling_chunk.py`

- Change the schedule wrapper to accept `*args, **kwargs`.
- Reason: profiling chunk patch wraps scheduler implementations whose
signatures now
  differ between `0.23.0` and upstream main.
- Upstream source:
[vllm#44558](vllm-project/vllm#44558).

`vllm_ascend/spec_decode/ngram_proposer.py`

- Split `AscendNgramProposer.propose` by `vllm_version_is("0.23.0")`.
- `0.23.0` keeps the old Ascend behavior using `runner.input_batch`.
- Non-`0.23.0` follows upstream Dynamic SD signature:
`propose(num_speculative_tokens, sampled_token_ids, num_tokens_no_spec,
token_ids_cpu, ...)`.
- Pass `num_speculative_tokens` into `batch_propose`.
- Reason: upstream Dynamic Speculative Decoding changed ngram proposer
signatures and
  made the per-step draft-token budget explicit.
- Upstream source:
[vllm#32374](vllm-project/vllm#32374).

`vllm_ascend/spec_decode/suffix_proposer.py`

- Add version-aware wrapper for suffix decoding proposer.
- `0.23.0` keeps calling upstream as:
  `super().propose(input_batch, sampled_token_ids)`.
- Non-`0.23.0` calls upstream as:
`super().propose(num_speculative_tokens, input_batch, sampled_token_ids,
...)`.
- Reason: upstream Dynamic SD added `num_speculative_tokens` to suffix
decoding proposer.
- Upstream source:
[vllm#32374](vllm-project/vllm#32374).

`vllm_ascend/worker/model_runner_v1.py`

- For `AscendNgramProposer`, pass
  `scheduler_output.num_spec_tokens_to_schedule`,
`self.input_batch.num_tokens_no_spec`, and
`self.input_batch.token_ids_cpu`
  on non-`0.23.0`.
- For `AscendSuffixDecodingProposer`, pass
  `num_speculative_tokens=scheduler_output.num_spec_tokens_to_schedule`
  on non-`0.23.0`.
- For Eagle-style proposers, pass
`self.speculative_config.num_speculative_tokens`
  on non-`0.23.0`.
- Reason: upstream Dynamic SD changed proposer call signatures and
scheduler output now
  carries the dynamic speculative token budget.
- Upstream source:
[vllm#32374](vllm-project/vllm#32374).

`vllm_ascend/worker/encoder_acl_graph.py`

- For `0.23.0`, continue using `self.budget_graphs[token_budget]`.
- For non-`0.23.0`, use upstream graph-set storage through
  `self._get_graph_set("default")`.
- Reason: upstream encoder CUDA graph manager changed from a flat budget
graph map to
  graph sets for multiple capture paths.
- Upstream source:
[vllm#43586](vllm-project/vllm#43586).

`vllm_ascend/ops/fused_moe/fused_moe.py`

- Keep `0.23.0` routed-experts capture config lookup from
`layer.vllm_config.model_config`.
- For non-`0.23.0`, use `get_current_vllm_config()` to obtain
`model_config`.
- Reason: upstream routed experts capture is now driven by current vLLM
config context
  instead of relying only on the layer-local config path.
- Upstream source:
[vllm#28284](vllm-project/vllm#28284).

`vllm_ascend/worker/v2/aclgraph_utils.py`

- Add `lora_capture_cases` to `ModelAclGraphManager.__init__` and
forward it upstream.
- Add `lora_capture_hook` to `capture_model` and forward it by keyword.
- Reason: upstream MRV2 LoRA warmup/capture now passes LoRA capture
cases and hook
  through CUDA graph manager APIs.
- Upstream source:
[vllm#35536](vllm-project/vllm#35536).

`vllm_ascend/worker/v2/model_runner.py`

- Update the graph manager factory to accept `lora_capture_cases`.
- Forward `lora_capture_cases` into `ModelAclGraphManager`.
- Reason: without this factory-level argument, upstream MRV2 LoRA warmup
fails before
  reaching Ascend ACL graph manager.
- Upstream source:
[vllm#35536](vllm-project/vllm#35536).

`vllm_ascend/worker/v2/spec_decode/eagle/aclgraph.py`

- Replace the misleading `AttentionStatePair as CapturedAttentionState`
alias with
  direct `AttentionStatePair` usage.
- Rename `full_cg_attn_states` to `attn_states`.
- Forward `progress_bar_desc` by keyword.
- Reason: upstream Eagle graph capture split/renamed captured attention
state flow.
- Upstream source:
[vllm#44253](vllm-project/vllm#44253).

`vllm_ascend/patch/platform/__init__.py`

- Only import GLM4.7 / MiniMax M2 parser patches and MiniMax usage
accounting patch
  on `0.23.0`.
- Reason: upstream main has refactored these parser internals, so the
old Ascend patches
  are only valid for the `0.23.0` parser implementation.
- Upstream sources:
  [vllm#45701](vllm-project/vllm#45701),
  [vllm#45915](vllm-project/vllm#45915).

`tests/ut/patch/platform/test_patch_glm47_tool_call_parser.py`

- Skip the module on non-`0.23.0` before importing incompatible upstream
parser internals.
- Reason: upstream GLM parser internals were migrated/refactored and
  `_extract_tool_call_regions` is no longer available in the old form.
- Upstream source:
[vllm#45915](vllm-project/vllm#45915).

`tests/ut/patch/platform/test_patch_minimax_m2_tool_call_parser.py`

- Skip on non-`0.23.0`.
- Reason: upstream MiniMax M2 tool parser moved to the new streaming
parser engine and
old attributes such as `tool_call_start_token` are no longer available.
- Upstream source:
[vllm#45701](vllm-project/vllm#45701).

`tests/ut/patch/platform/test_patch_minimax_usage_accounting.py`

- Skip on non-`0.23.0`.
- Reason: upstream MiniMax M2 reasoning/parser internals changed and old
usage accounting
  patch assumptions no longer hold on main.
- Upstream source:
[vllm#45701](vllm-project/vllm#45701).

- vLLM version: v0.23.0
- vLLM main:
vllm-project/vllm@a30addc
---------
Signed-off-by: MrZ20 <2609716663@qq.com>
Signed-off-by: Mrz20 <2609716663@qq.com>
wangyichao1999 pushed a commit to wangyichao1999/vllm-ascend that referenced this pull request Jul 9, 2026
### What this PR does / why we need it?

This PR upgrades the verified vLLM main commit to
`b9a7cd464c9ae9b1b450f8982b76d7be4de73724` and adapts vLLM Ascend to
upstream API changes introduced after the previous verified commit.

`vllm_ascend/__init__.py`

- Set `VLLM_USE_V2_MODEL_RUNNER=0` for non-`0.23.0`.
- Reason: this branch keeps the main compatibility path on V1 model
runner. V2 still has
partial compatibility updates, but it is not enabled as the default path
here.
- Related upstream changes: vLLM Model Runner V2 migration work,
including
[vllm#42667](vllm-project/vllm#42667) and
[vllm#44446](vllm-project/vllm#44446).

`tests/e2e/pull_request/one_card/test_guided_decoding.py`

- For non-`0.23.0` and `xgrammar` / `outlines`, set
  `VLLM_REGEX_COMPILATION_TIMEOUT_S=30` during the test.
- Keep `0.23.0` behavior unchanged.
- Reason: upstream added a structured-output regex compilation timeout.
The existing
complex JSON schema can exceed the default 5s timeout during grammar
compilation.
- Upstream source:
[vllm#45118](vllm-project/vllm#45118).

`vllm_ascend/core/scheduler_profiling_chunk.py`

- Add `throttle_prefills: bool = False` to
`ProfilingChunkScheduler.schedule`.
- Reason: upstream scheduler `schedule()` now accepts
`throttle_prefills`.
- Upstream source:
[vllm#44558](vllm-project/vllm#44558).

`vllm_ascend/patch/platform/patch_balance_schedule.py`

- Add `throttle_prefills` to `BalanceScheduler.schedule`.
- For `0.23.0`, continue calling `super().schedule()` with no argument.
- For non-`0.23.0`, forward `throttle_prefills` to upstream scheduler.
- Reason: keep the balance scheduler wrapper compatible with both old
and new upstream
  scheduler signatures.
- Upstream source:
[vllm#44558](vllm-project/vllm#44558).

`vllm_ascend/patch/platform/patch_profiling_chunk.py`

- Change the schedule wrapper to accept `*args, **kwargs`.
- Reason: profiling chunk patch wraps scheduler implementations whose
signatures now
  differ between `0.23.0` and upstream main.
- Upstream source:
[vllm#44558](vllm-project/vllm#44558).

`vllm_ascend/spec_decode/ngram_proposer.py`

- Split `AscendNgramProposer.propose` by `vllm_version_is("0.23.0")`.
- `0.23.0` keeps the old Ascend behavior using `runner.input_batch`.
- Non-`0.23.0` follows upstream Dynamic SD signature:
`propose(num_speculative_tokens, sampled_token_ids, num_tokens_no_spec,
token_ids_cpu, ...)`.
- Pass `num_speculative_tokens` into `batch_propose`.
- Reason: upstream Dynamic Speculative Decoding changed ngram proposer
signatures and
  made the per-step draft-token budget explicit.
- Upstream source:
[vllm#32374](vllm-project/vllm#32374).

`vllm_ascend/spec_decode/suffix_proposer.py`

- Add version-aware wrapper for suffix decoding proposer.
- `0.23.0` keeps calling upstream as:
  `super().propose(input_batch, sampled_token_ids)`.
- Non-`0.23.0` calls upstream as:
`super().propose(num_speculative_tokens, input_batch, sampled_token_ids,
...)`.
- Reason: upstream Dynamic SD added `num_speculative_tokens` to suffix
decoding proposer.
- Upstream source:
[vllm#32374](vllm-project/vllm#32374).

`vllm_ascend/worker/model_runner_v1.py`

- For `AscendNgramProposer`, pass
  `scheduler_output.num_spec_tokens_to_schedule`,
`self.input_batch.num_tokens_no_spec`, and
`self.input_batch.token_ids_cpu`
  on non-`0.23.0`.
- For `AscendSuffixDecodingProposer`, pass
  `num_speculative_tokens=scheduler_output.num_spec_tokens_to_schedule`
  on non-`0.23.0`.
- For Eagle-style proposers, pass
`self.speculative_config.num_speculative_tokens`
  on non-`0.23.0`.
- Reason: upstream Dynamic SD changed proposer call signatures and
scheduler output now
  carries the dynamic speculative token budget.
- Upstream source:
[vllm#32374](vllm-project/vllm#32374).

`vllm_ascend/worker/encoder_acl_graph.py`

- For `0.23.0`, continue using `self.budget_graphs[token_budget]`.
- For non-`0.23.0`, use upstream graph-set storage through
  `self._get_graph_set("default")`.
- Reason: upstream encoder CUDA graph manager changed from a flat budget
graph map to
  graph sets for multiple capture paths.
- Upstream source:
[vllm#43586](vllm-project/vllm#43586).

`vllm_ascend/ops/fused_moe/fused_moe.py`

- Keep `0.23.0` routed-experts capture config lookup from
`layer.vllm_config.model_config`.
- For non-`0.23.0`, use `get_current_vllm_config()` to obtain
`model_config`.
- Reason: upstream routed experts capture is now driven by current vLLM
config context
  instead of relying only on the layer-local config path.
- Upstream source:
[vllm#28284](vllm-project/vllm#28284).

`vllm_ascend/worker/v2/aclgraph_utils.py`

- Add `lora_capture_cases` to `ModelAclGraphManager.__init__` and
forward it upstream.
- Add `lora_capture_hook` to `capture_model` and forward it by keyword.
- Reason: upstream MRV2 LoRA warmup/capture now passes LoRA capture
cases and hook
  through CUDA graph manager APIs.
- Upstream source:
[vllm#35536](vllm-project/vllm#35536).

`vllm_ascend/worker/v2/model_runner.py`

- Update the graph manager factory to accept `lora_capture_cases`.
- Forward `lora_capture_cases` into `ModelAclGraphManager`.
- Reason: without this factory-level argument, upstream MRV2 LoRA warmup
fails before
  reaching Ascend ACL graph manager.
- Upstream source:
[vllm#35536](vllm-project/vllm#35536).

`vllm_ascend/worker/v2/spec_decode/eagle/aclgraph.py`

- Replace the misleading `AttentionStatePair as CapturedAttentionState`
alias with
  direct `AttentionStatePair` usage.
- Rename `full_cg_attn_states` to `attn_states`.
- Forward `progress_bar_desc` by keyword.
- Reason: upstream Eagle graph capture split/renamed captured attention
state flow.
- Upstream source:
[vllm#44253](vllm-project/vllm#44253).

`vllm_ascend/patch/platform/__init__.py`

- Only import GLM4.7 / MiniMax M2 parser patches and MiniMax usage
accounting patch
  on `0.23.0`.
- Reason: upstream main has refactored these parser internals, so the
old Ascend patches
  are only valid for the `0.23.0` parser implementation.
- Upstream sources:
  [vllm#45701](vllm-project/vllm#45701),
  [vllm#45915](vllm-project/vllm#45915).

`tests/ut/patch/platform/test_patch_glm47_tool_call_parser.py`

- Skip the module on non-`0.23.0` before importing incompatible upstream
parser internals.
- Reason: upstream GLM parser internals were migrated/refactored and
  `_extract_tool_call_regions` is no longer available in the old form.
- Upstream source:
[vllm#45915](vllm-project/vllm#45915).

`tests/ut/patch/platform/test_patch_minimax_m2_tool_call_parser.py`

- Skip on non-`0.23.0`.
- Reason: upstream MiniMax M2 tool parser moved to the new streaming
parser engine and
old attributes such as `tool_call_start_token` are no longer available.
- Upstream source:
[vllm#45701](vllm-project/vllm#45701).

`tests/ut/patch/platform/test_patch_minimax_usage_accounting.py`

- Skip on non-`0.23.0`.
- Reason: upstream MiniMax M2 reasoning/parser internals changed and old
usage accounting
  patch assumptions no longer hold on main.
- Upstream source:
[vllm#45701](vllm-project/vllm#45701).

- vLLM version: v0.23.0
- vLLM main:
vllm-project/vllm@a30addc
---------
Signed-off-by: MrZ20 <2609716663@qq.com>
Signed-off-by: Mrz20 <2609716663@qq.com>
xqchen7 pushed a commit to nv-action/vllm-benchmarks that referenced this pull request Jul 15, 2026
### What this PR does / why we need it?

This PR upgrades the verified vLLM main commit to
`b9a7cd464c9ae9b1b450f8982b76d7be4de73724` and adapts vLLM Ascend to
upstream API changes introduced after the previous verified commit.

`vllm_ascend/__init__.py`

- Set `VLLM_USE_V2_MODEL_RUNNER=0` for non-`0.23.0`.
- Reason: this branch keeps the main compatibility path on V1 model
runner. V2 still has
partial compatibility updates, but it is not enabled as the default path
here.
- Related upstream changes: vLLM Model Runner V2 migration work,
including
[vllm#42667](vllm-project/vllm#42667) and
[vllm#44446](vllm-project/vllm#44446).

`tests/e2e/pull_request/one_card/test_guided_decoding.py`

- For non-`0.23.0` and `xgrammar` / `outlines`, set
  `VLLM_REGEX_COMPILATION_TIMEOUT_S=30` during the test.
- Keep `0.23.0` behavior unchanged.
- Reason: upstream added a structured-output regex compilation timeout.
The existing
complex JSON schema can exceed the default 5s timeout during grammar
compilation.
- Upstream source:
[vllm#45118](vllm-project/vllm#45118).

`vllm_ascend/core/scheduler_profiling_chunk.py`

- Add `throttle_prefills: bool = False` to
`ProfilingChunkScheduler.schedule`.
- Reason: upstream scheduler `schedule()` now accepts
`throttle_prefills`.
- Upstream source:
[vllm#44558](vllm-project/vllm#44558).

`vllm_ascend/patch/platform/patch_balance_schedule.py`

- Add `throttle_prefills` to `BalanceScheduler.schedule`.
- For `0.23.0`, continue calling `super().schedule()` with no argument.
- For non-`0.23.0`, forward `throttle_prefills` to upstream scheduler.
- Reason: keep the balance scheduler wrapper compatible with both old
and new upstream
  scheduler signatures.
- Upstream source:
[vllm#44558](vllm-project/vllm#44558).

`vllm_ascend/patch/platform/patch_profiling_chunk.py`

- Change the schedule wrapper to accept `*args, **kwargs`.
- Reason: profiling chunk patch wraps scheduler implementations whose
signatures now
  differ between `0.23.0` and upstream main.
- Upstream source:
[vllm#44558](vllm-project/vllm#44558).

`vllm_ascend/spec_decode/ngram_proposer.py`

- Split `AscendNgramProposer.propose` by `vllm_version_is("0.23.0")`.
- `0.23.0` keeps the old Ascend behavior using `runner.input_batch`.
- Non-`0.23.0` follows upstream Dynamic SD signature:
`propose(num_speculative_tokens, sampled_token_ids, num_tokens_no_spec,
token_ids_cpu, ...)`.
- Pass `num_speculative_tokens` into `batch_propose`.
- Reason: upstream Dynamic Speculative Decoding changed ngram proposer
signatures and
  made the per-step draft-token budget explicit.
- Upstream source:
[vllm#32374](vllm-project/vllm#32374).

`vllm_ascend/spec_decode/suffix_proposer.py`

- Add version-aware wrapper for suffix decoding proposer.
- `0.23.0` keeps calling upstream as:
  `super().propose(input_batch, sampled_token_ids)`.
- Non-`0.23.0` calls upstream as:
`super().propose(num_speculative_tokens, input_batch, sampled_token_ids,
...)`.
- Reason: upstream Dynamic SD added `num_speculative_tokens` to suffix
decoding proposer.
- Upstream source:
[vllm#32374](vllm-project/vllm#32374).

`vllm_ascend/worker/model_runner_v1.py`

- For `AscendNgramProposer`, pass
  `scheduler_output.num_spec_tokens_to_schedule`,
`self.input_batch.num_tokens_no_spec`, and
`self.input_batch.token_ids_cpu`
  on non-`0.23.0`.
- For `AscendSuffixDecodingProposer`, pass
  `num_speculative_tokens=scheduler_output.num_spec_tokens_to_schedule`
  on non-`0.23.0`.
- For Eagle-style proposers, pass
`self.speculative_config.num_speculative_tokens`
  on non-`0.23.0`.
- Reason: upstream Dynamic SD changed proposer call signatures and
scheduler output now
  carries the dynamic speculative token budget.
- Upstream source:
[vllm#32374](vllm-project/vllm#32374).

`vllm_ascend/worker/encoder_acl_graph.py`

- For `0.23.0`, continue using `self.budget_graphs[token_budget]`.
- For non-`0.23.0`, use upstream graph-set storage through
  `self._get_graph_set("default")`.
- Reason: upstream encoder CUDA graph manager changed from a flat budget
graph map to
  graph sets for multiple capture paths.
- Upstream source:
[vllm#43586](vllm-project/vllm#43586).

`vllm_ascend/ops/fused_moe/fused_moe.py`

- Keep `0.23.0` routed-experts capture config lookup from
`layer.vllm_config.model_config`.
- For non-`0.23.0`, use `get_current_vllm_config()` to obtain
`model_config`.
- Reason: upstream routed experts capture is now driven by current vLLM
config context
  instead of relying only on the layer-local config path.
- Upstream source:
[vllm#28284](vllm-project/vllm#28284).

`vllm_ascend/worker/v2/aclgraph_utils.py`

- Add `lora_capture_cases` to `ModelAclGraphManager.__init__` and
forward it upstream.
- Add `lora_capture_hook` to `capture_model` and forward it by keyword.
- Reason: upstream MRV2 LoRA warmup/capture now passes LoRA capture
cases and hook
  through CUDA graph manager APIs.
- Upstream source:
[vllm#35536](vllm-project/vllm#35536).

`vllm_ascend/worker/v2/model_runner.py`

- Update the graph manager factory to accept `lora_capture_cases`.
- Forward `lora_capture_cases` into `ModelAclGraphManager`.
- Reason: without this factory-level argument, upstream MRV2 LoRA warmup
fails before
  reaching Ascend ACL graph manager.
- Upstream source:
[vllm#35536](vllm-project/vllm#35536).

`vllm_ascend/worker/v2/spec_decode/eagle/aclgraph.py`

- Replace the misleading `AttentionStatePair as CapturedAttentionState`
alias with
  direct `AttentionStatePair` usage.
- Rename `full_cg_attn_states` to `attn_states`.
- Forward `progress_bar_desc` by keyword.
- Reason: upstream Eagle graph capture split/renamed captured attention
state flow.
- Upstream source:
[vllm#44253](vllm-project/vllm#44253).

`vllm_ascend/patch/platform/__init__.py`

- Only import GLM4.7 / MiniMax M2 parser patches and MiniMax usage
accounting patch
  on `0.23.0`.
- Reason: upstream main has refactored these parser internals, so the
old Ascend patches
  are only valid for the `0.23.0` parser implementation.
- Upstream sources:
  [vllm#45701](vllm-project/vllm#45701),
  [vllm#45915](vllm-project/vllm#45915).

`tests/ut/patch/platform/test_patch_glm47_tool_call_parser.py`

- Skip the module on non-`0.23.0` before importing incompatible upstream
parser internals.
- Reason: upstream GLM parser internals were migrated/refactored and
  `_extract_tool_call_regions` is no longer available in the old form.
- Upstream source:
[vllm#45915](vllm-project/vllm#45915).

`tests/ut/patch/platform/test_patch_minimax_m2_tool_call_parser.py`

- Skip on non-`0.23.0`.
- Reason: upstream MiniMax M2 tool parser moved to the new streaming
parser engine and
old attributes such as `tool_call_start_token` are no longer available.
- Upstream source:
[vllm#45701](vllm-project/vllm#45701).

`tests/ut/patch/platform/test_patch_minimax_usage_accounting.py`

- Skip on non-`0.23.0`.
- Reason: upstream MiniMax M2 reasoning/parser internals changed and old
usage accounting
  patch assumptions no longer hold on main.
- Upstream source:
[vllm#45701](vllm-project/vllm#45701).

- vLLM version: v0.23.0
- vLLM main:
vllm-project/vllm@a30addc
---------
Signed-off-by: MrZ20 <2609716663@qq.com>
Signed-off-by: Mrz20 <2609716663@qq.com>
Signed-off-by: xqchen7 <chenxueqing7@huawei.com>
philippesic pushed a commit to philippesic/vllm-semantic-cache that referenced this pull request Jul 19, 2026
…nt attention states for speculator prefill (vllm-project#44253)

Signed-off-by: Giancarlo Delfin <gdelfin@inferact.ai>
Co-authored-by: Woosuk Kwon <woosuk@inferact.ai>
Alex-stack-hub pushed a commit to 0moyi0-2024/vllm-ascend_tp that referenced this pull request Jul 27, 2026
### What this PR does / why we need it?

This PR upgrades the verified vLLM main commit to
`b9a7cd464c9ae9b1b450f8982b76d7be4de73724` and adapts vLLM Ascend to
upstream API changes introduced after the previous verified commit.

`vllm_ascend/__init__.py`

- Set `VLLM_USE_V2_MODEL_RUNNER=0` for non-`0.23.0`.
- Reason: this branch keeps the main compatibility path on V1 model
runner. V2 still has
partial compatibility updates, but it is not enabled as the default path
here.
- Related upstream changes: vLLM Model Runner V2 migration work,
including
[vllm#42667](vllm-project/vllm#42667) and
[vllm#44446](vllm-project/vllm#44446).

`tests/e2e/pull_request/one_card/test_guided_decoding.py`

- For non-`0.23.0` and `xgrammar` / `outlines`, set
  `VLLM_REGEX_COMPILATION_TIMEOUT_S=30` during the test.
- Keep `0.23.0` behavior unchanged.
- Reason: upstream added a structured-output regex compilation timeout.
The existing
complex JSON schema can exceed the default 5s timeout during grammar
compilation.
- Upstream source:
[vllm#45118](vllm-project/vllm#45118).

`vllm_ascend/core/scheduler_profiling_chunk.py`

- Add `throttle_prefills: bool = False` to
`ProfilingChunkScheduler.schedule`.
- Reason: upstream scheduler `schedule()` now accepts
`throttle_prefills`.
- Upstream source:
[vllm#44558](vllm-project/vllm#44558).

`vllm_ascend/patch/platform/patch_balance_schedule.py`

- Add `throttle_prefills` to `BalanceScheduler.schedule`.
- For `0.23.0`, continue calling `super().schedule()` with no argument.
- For non-`0.23.0`, forward `throttle_prefills` to upstream scheduler.
- Reason: keep the balance scheduler wrapper compatible with both old
and new upstream
  scheduler signatures.
- Upstream source:
[vllm#44558](vllm-project/vllm#44558).

`vllm_ascend/patch/platform/patch_profiling_chunk.py`

- Change the schedule wrapper to accept `*args, **kwargs`.
- Reason: profiling chunk patch wraps scheduler implementations whose
signatures now
  differ between `0.23.0` and upstream main.
- Upstream source:
[vllm#44558](vllm-project/vllm#44558).

`vllm_ascend/spec_decode/ngram_proposer.py`

- Split `AscendNgramProposer.propose` by `vllm_version_is("0.23.0")`.
- `0.23.0` keeps the old Ascend behavior using `runner.input_batch`.
- Non-`0.23.0` follows upstream Dynamic SD signature:
`propose(num_speculative_tokens, sampled_token_ids, num_tokens_no_spec,
token_ids_cpu, ...)`.
- Pass `num_speculative_tokens` into `batch_propose`.
- Reason: upstream Dynamic Speculative Decoding changed ngram proposer
signatures and
  made the per-step draft-token budget explicit.
- Upstream source:
[vllm#32374](vllm-project/vllm#32374).

`vllm_ascend/spec_decode/suffix_proposer.py`

- Add version-aware wrapper for suffix decoding proposer.
- `0.23.0` keeps calling upstream as:
  `super().propose(input_batch, sampled_token_ids)`.
- Non-`0.23.0` calls upstream as:
`super().propose(num_speculative_tokens, input_batch, sampled_token_ids,
...)`.
- Reason: upstream Dynamic SD added `num_speculative_tokens` to suffix
decoding proposer.
- Upstream source:
[vllm#32374](vllm-project/vllm#32374).

`vllm_ascend/worker/model_runner_v1.py`

- For `AscendNgramProposer`, pass
  `scheduler_output.num_spec_tokens_to_schedule`,
`self.input_batch.num_tokens_no_spec`, and
`self.input_batch.token_ids_cpu`
  on non-`0.23.0`.
- For `AscendSuffixDecodingProposer`, pass
  `num_speculative_tokens=scheduler_output.num_spec_tokens_to_schedule`
  on non-`0.23.0`.
- For Eagle-style proposers, pass
`self.speculative_config.num_speculative_tokens`
  on non-`0.23.0`.
- Reason: upstream Dynamic SD changed proposer call signatures and
scheduler output now
  carries the dynamic speculative token budget.
- Upstream source:
[vllm#32374](vllm-project/vllm#32374).

`vllm_ascend/worker/encoder_acl_graph.py`

- For `0.23.0`, continue using `self.budget_graphs[token_budget]`.
- For non-`0.23.0`, use upstream graph-set storage through
  `self._get_graph_set("default")`.
- Reason: upstream encoder CUDA graph manager changed from a flat budget
graph map to
  graph sets for multiple capture paths.
- Upstream source:
[vllm#43586](vllm-project/vllm#43586).

`vllm_ascend/ops/fused_moe/fused_moe.py`

- Keep `0.23.0` routed-experts capture config lookup from
`layer.vllm_config.model_config`.
- For non-`0.23.0`, use `get_current_vllm_config()` to obtain
`model_config`.
- Reason: upstream routed experts capture is now driven by current vLLM
config context
  instead of relying only on the layer-local config path.
- Upstream source:
[vllm#28284](vllm-project/vllm#28284).

`vllm_ascend/worker/v2/aclgraph_utils.py`

- Add `lora_capture_cases` to `ModelAclGraphManager.__init__` and
forward it upstream.
- Add `lora_capture_hook` to `capture_model` and forward it by keyword.
- Reason: upstream MRV2 LoRA warmup/capture now passes LoRA capture
cases and hook
  through CUDA graph manager APIs.
- Upstream source:
[vllm#35536](vllm-project/vllm#35536).

`vllm_ascend/worker/v2/model_runner.py`

- Update the graph manager factory to accept `lora_capture_cases`.
- Forward `lora_capture_cases` into `ModelAclGraphManager`.
- Reason: without this factory-level argument, upstream MRV2 LoRA warmup
fails before
  reaching Ascend ACL graph manager.
- Upstream source:
[vllm#35536](vllm-project/vllm#35536).

`vllm_ascend/worker/v2/spec_decode/eagle/aclgraph.py`

- Replace the misleading `AttentionStatePair as CapturedAttentionState`
alias with
  direct `AttentionStatePair` usage.
- Rename `full_cg_attn_states` to `attn_states`.
- Forward `progress_bar_desc` by keyword.
- Reason: upstream Eagle graph capture split/renamed captured attention
state flow.
- Upstream source:
[vllm#44253](vllm-project/vllm#44253).

`vllm_ascend/patch/platform/__init__.py`

- Only import GLM4.7 / MiniMax M2 parser patches and MiniMax usage
accounting patch
  on `0.23.0`.
- Reason: upstream main has refactored these parser internals, so the
old Ascend patches
  are only valid for the `0.23.0` parser implementation.
- Upstream sources:
  [vllm#45701](vllm-project/vllm#45701),
  [vllm#45915](vllm-project/vllm#45915).

`tests/ut/patch/platform/test_patch_glm47_tool_call_parser.py`

- Skip the module on non-`0.23.0` before importing incompatible upstream
parser internals.
- Reason: upstream GLM parser internals were migrated/refactored and
  `_extract_tool_call_regions` is no longer available in the old form.
- Upstream source:
[vllm#45915](vllm-project/vllm#45915).

`tests/ut/patch/platform/test_patch_minimax_m2_tool_call_parser.py`

- Skip on non-`0.23.0`.
- Reason: upstream MiniMax M2 tool parser moved to the new streaming
parser engine and
old attributes such as `tool_call_start_token` are no longer available.
- Upstream source:
[vllm#45701](vllm-project/vllm#45701).

`tests/ut/patch/platform/test_patch_minimax_usage_accounting.py`

- Skip on non-`0.23.0`.
- Reason: upstream MiniMax M2 reasoning/parser internals changed and old
usage accounting
  patch assumptions no longer hold on main.
- Upstream source:
[vllm#45701](vllm-project/vllm#45701).

- vLLM version: v0.23.0
- vLLM main:
vllm-project/vllm@a30addc
---------
Signed-off-by: MrZ20 <2609716663@qq.com>
Signed-off-by: Mrz20 <2609716663@qq.com>
MmMmaru pushed a commit to jiaqi-lee/vllm-ascend that referenced this pull request Aug 19, 2026
### What this PR does / why we need it?

This PR upgrades the verified vLLM main commit to
`b9a7cd464c9ae9b1b450f8982b76d7be4de73724` and adapts vLLM Ascend to
upstream API changes introduced after the previous verified commit.

`vllm_ascend/__init__.py`

- Set `VLLM_USE_V2_MODEL_RUNNER=0` for non-`0.23.0`.
- Reason: this branch keeps the main compatibility path on V1 model
runner. V2 still has
partial compatibility updates, but it is not enabled as the default path
here.
- Related upstream changes: vLLM Model Runner V2 migration work,
including
[vllm#42667](vllm-project/vllm#42667) and
[vllm#44446](vllm-project/vllm#44446).

`tests/e2e/pull_request/one_card/test_guided_decoding.py`

- For non-`0.23.0` and `xgrammar` / `outlines`, set
  `VLLM_REGEX_COMPILATION_TIMEOUT_S=30` during the test.
- Keep `0.23.0` behavior unchanged.
- Reason: upstream added a structured-output regex compilation timeout.
The existing
complex JSON schema can exceed the default 5s timeout during grammar
compilation.
- Upstream source:
[vllm#45118](vllm-project/vllm#45118).

`vllm_ascend/core/scheduler_profiling_chunk.py`

- Add `throttle_prefills: bool = False` to
`ProfilingChunkScheduler.schedule`.
- Reason: upstream scheduler `schedule()` now accepts
`throttle_prefills`.
- Upstream source:
[vllm#44558](vllm-project/vllm#44558).

`vllm_ascend/patch/platform/patch_balance_schedule.py`

- Add `throttle_prefills` to `BalanceScheduler.schedule`.
- For `0.23.0`, continue calling `super().schedule()` with no argument.
- For non-`0.23.0`, forward `throttle_prefills` to upstream scheduler.
- Reason: keep the balance scheduler wrapper compatible with both old
and new upstream
  scheduler signatures.
- Upstream source:
[vllm#44558](vllm-project/vllm#44558).

`vllm_ascend/patch/platform/patch_profiling_chunk.py`

- Change the schedule wrapper to accept `*args, **kwargs`.
- Reason: profiling chunk patch wraps scheduler implementations whose
signatures now
  differ between `0.23.0` and upstream main.
- Upstream source:
[vllm#44558](vllm-project/vllm#44558).

`vllm_ascend/spec_decode/ngram_proposer.py`

- Split `AscendNgramProposer.propose` by `vllm_version_is("0.23.0")`.
- `0.23.0` keeps the old Ascend behavior using `runner.input_batch`.
- Non-`0.23.0` follows upstream Dynamic SD signature:
`propose(num_speculative_tokens, sampled_token_ids, num_tokens_no_spec,
token_ids_cpu, ...)`.
- Pass `num_speculative_tokens` into `batch_propose`.
- Reason: upstream Dynamic Speculative Decoding changed ngram proposer
signatures and
  made the per-step draft-token budget explicit.
- Upstream source:
[vllm#32374](vllm-project/vllm#32374).

`vllm_ascend/spec_decode/suffix_proposer.py`

- Add version-aware wrapper for suffix decoding proposer.
- `0.23.0` keeps calling upstream as:
  `super().propose(input_batch, sampled_token_ids)`.
- Non-`0.23.0` calls upstream as:
`super().propose(num_speculative_tokens, input_batch, sampled_token_ids,
...)`.
- Reason: upstream Dynamic SD added `num_speculative_tokens` to suffix
decoding proposer.
- Upstream source:
[vllm#32374](vllm-project/vllm#32374).

`vllm_ascend/worker/model_runner_v1.py`

- For `AscendNgramProposer`, pass
  `scheduler_output.num_spec_tokens_to_schedule`,
`self.input_batch.num_tokens_no_spec`, and
`self.input_batch.token_ids_cpu`
  on non-`0.23.0`.
- For `AscendSuffixDecodingProposer`, pass
  `num_speculative_tokens=scheduler_output.num_spec_tokens_to_schedule`
  on non-`0.23.0`.
- For Eagle-style proposers, pass
`self.speculative_config.num_speculative_tokens`
  on non-`0.23.0`.
- Reason: upstream Dynamic SD changed proposer call signatures and
scheduler output now
  carries the dynamic speculative token budget.
- Upstream source:
[vllm#32374](vllm-project/vllm#32374).

`vllm_ascend/worker/encoder_acl_graph.py`

- For `0.23.0`, continue using `self.budget_graphs[token_budget]`.
- For non-`0.23.0`, use upstream graph-set storage through
  `self._get_graph_set("default")`.
- Reason: upstream encoder CUDA graph manager changed from a flat budget
graph map to
  graph sets for multiple capture paths.
- Upstream source:
[vllm#43586](vllm-project/vllm#43586).

`vllm_ascend/ops/fused_moe/fused_moe.py`

- Keep `0.23.0` routed-experts capture config lookup from
`layer.vllm_config.model_config`.
- For non-`0.23.0`, use `get_current_vllm_config()` to obtain
`model_config`.
- Reason: upstream routed experts capture is now driven by current vLLM
config context
  instead of relying only on the layer-local config path.
- Upstream source:
[vllm#28284](vllm-project/vllm#28284).

`vllm_ascend/worker/v2/aclgraph_utils.py`

- Add `lora_capture_cases` to `ModelAclGraphManager.__init__` and
forward it upstream.
- Add `lora_capture_hook` to `capture_model` and forward it by keyword.
- Reason: upstream MRV2 LoRA warmup/capture now passes LoRA capture
cases and hook
  through CUDA graph manager APIs.
- Upstream source:
[vllm#35536](vllm-project/vllm#35536).

`vllm_ascend/worker/v2/model_runner.py`

- Update the graph manager factory to accept `lora_capture_cases`.
- Forward `lora_capture_cases` into `ModelAclGraphManager`.
- Reason: without this factory-level argument, upstream MRV2 LoRA warmup
fails before
  reaching Ascend ACL graph manager.
- Upstream source:
[vllm#35536](vllm-project/vllm#35536).

`vllm_ascend/worker/v2/spec_decode/eagle/aclgraph.py`

- Replace the misleading `AttentionStatePair as CapturedAttentionState`
alias with
  direct `AttentionStatePair` usage.
- Rename `full_cg_attn_states` to `attn_states`.
- Forward `progress_bar_desc` by keyword.
- Reason: upstream Eagle graph capture split/renamed captured attention
state flow.
- Upstream source:
[vllm#44253](vllm-project/vllm#44253).

`vllm_ascend/patch/platform/__init__.py`

- Only import GLM4.7 / MiniMax M2 parser patches and MiniMax usage
accounting patch
  on `0.23.0`.
- Reason: upstream main has refactored these parser internals, so the
old Ascend patches
  are only valid for the `0.23.0` parser implementation.
- Upstream sources:
  [vllm#45701](vllm-project/vllm#45701),
  [vllm#45915](vllm-project/vllm#45915).

`tests/ut/patch/platform/test_patch_glm47_tool_call_parser.py`

- Skip the module on non-`0.23.0` before importing incompatible upstream
parser internals.
- Reason: upstream GLM parser internals were migrated/refactored and
  `_extract_tool_call_regions` is no longer available in the old form.
- Upstream source:
[vllm#45915](vllm-project/vllm#45915).

`tests/ut/patch/platform/test_patch_minimax_m2_tool_call_parser.py`

- Skip on non-`0.23.0`.
- Reason: upstream MiniMax M2 tool parser moved to the new streaming
parser engine and
old attributes such as `tool_call_start_token` are no longer available.
- Upstream source:
[vllm#45701](vllm-project/vllm#45701).

`tests/ut/patch/platform/test_patch_minimax_usage_accounting.py`

- Skip on non-`0.23.0`.
- Reason: upstream MiniMax M2 reasoning/parser internals changed and old
usage accounting
  patch assumptions no longer hold on main.
- Upstream source:
[vllm#45701](vllm-project/vllm#45701).

- vLLM version: v0.23.0
- vLLM main:
vllm-project/vllm@a30addc
---------
Signed-off-by: MrZ20 <2609716663@qq.com>
Signed-off-by: Mrz20 <2609716663@qq.com>
shiqiangA pushed a commit to shiqiangA/vllm-ascend that referenced this pull request Aug 20, 2026
### What this PR does / why we need it?

This PR upgrades the verified vLLM main commit to
`b9a7cd464c9ae9b1b450f8982b76d7be4de73724` and adapts vLLM Ascend to
upstream API changes introduced after the previous verified commit.

`vllm_ascend/__init__.py`

- Set `VLLM_USE_V2_MODEL_RUNNER=0` for non-`0.23.0`.
- Reason: this branch keeps the main compatibility path on V1 model
runner. V2 still has
partial compatibility updates, but it is not enabled as the default path
here.
- Related upstream changes: vLLM Model Runner V2 migration work,
including
[vllm#42667](vllm-project/vllm#42667) and
[vllm#44446](vllm-project/vllm#44446).

`tests/e2e/pull_request/one_card/test_guided_decoding.py`

- For non-`0.23.0` and `xgrammar` / `outlines`, set
  `VLLM_REGEX_COMPILATION_TIMEOUT_S=30` during the test.
- Keep `0.23.0` behavior unchanged.
- Reason: upstream added a structured-output regex compilation timeout.
The existing
complex JSON schema can exceed the default 5s timeout during grammar
compilation.
- Upstream source:
[vllm#45118](vllm-project/vllm#45118).

`vllm_ascend/core/scheduler_profiling_chunk.py`

- Add `throttle_prefills: bool = False` to
`ProfilingChunkScheduler.schedule`.
- Reason: upstream scheduler `schedule()` now accepts
`throttle_prefills`.
- Upstream source:
[vllm#44558](vllm-project/vllm#44558).

`vllm_ascend/patch/platform/patch_balance_schedule.py`

- Add `throttle_prefills` to `BalanceScheduler.schedule`.
- For `0.23.0`, continue calling `super().schedule()` with no argument.
- For non-`0.23.0`, forward `throttle_prefills` to upstream scheduler.
- Reason: keep the balance scheduler wrapper compatible with both old
and new upstream
  scheduler signatures.
- Upstream source:
[vllm#44558](vllm-project/vllm#44558).

`vllm_ascend/patch/platform/patch_profiling_chunk.py`

- Change the schedule wrapper to accept `*args, **kwargs`.
- Reason: profiling chunk patch wraps scheduler implementations whose
signatures now
  differ between `0.23.0` and upstream main.
- Upstream source:
[vllm#44558](vllm-project/vllm#44558).

`vllm_ascend/spec_decode/ngram_proposer.py`

- Split `AscendNgramProposer.propose` by `vllm_version_is("0.23.0")`.
- `0.23.0` keeps the old Ascend behavior using `runner.input_batch`.
- Non-`0.23.0` follows upstream Dynamic SD signature:
`propose(num_speculative_tokens, sampled_token_ids, num_tokens_no_spec,
token_ids_cpu, ...)`.
- Pass `num_speculative_tokens` into `batch_propose`.
- Reason: upstream Dynamic Speculative Decoding changed ngram proposer
signatures and
  made the per-step draft-token budget explicit.
- Upstream source:
[vllm#32374](vllm-project/vllm#32374).

`vllm_ascend/spec_decode/suffix_proposer.py`

- Add version-aware wrapper for suffix decoding proposer.
- `0.23.0` keeps calling upstream as:
  `super().propose(input_batch, sampled_token_ids)`.
- Non-`0.23.0` calls upstream as:
`super().propose(num_speculative_tokens, input_batch, sampled_token_ids,
...)`.
- Reason: upstream Dynamic SD added `num_speculative_tokens` to suffix
decoding proposer.
- Upstream source:
[vllm#32374](vllm-project/vllm#32374).

`vllm_ascend/worker/model_runner_v1.py`

- For `AscendNgramProposer`, pass
  `scheduler_output.num_spec_tokens_to_schedule`,
`self.input_batch.num_tokens_no_spec`, and
`self.input_batch.token_ids_cpu`
  on non-`0.23.0`.
- For `AscendSuffixDecodingProposer`, pass
  `num_speculative_tokens=scheduler_output.num_spec_tokens_to_schedule`
  on non-`0.23.0`.
- For Eagle-style proposers, pass
`self.speculative_config.num_speculative_tokens`
  on non-`0.23.0`.
- Reason: upstream Dynamic SD changed proposer call signatures and
scheduler output now
  carries the dynamic speculative token budget.
- Upstream source:
[vllm#32374](vllm-project/vllm#32374).

`vllm_ascend/worker/encoder_acl_graph.py`

- For `0.23.0`, continue using `self.budget_graphs[token_budget]`.
- For non-`0.23.0`, use upstream graph-set storage through
  `self._get_graph_set("default")`.
- Reason: upstream encoder CUDA graph manager changed from a flat budget
graph map to
  graph sets for multiple capture paths.
- Upstream source:
[vllm#43586](vllm-project/vllm#43586).

`vllm_ascend/ops/fused_moe/fused_moe.py`

- Keep `0.23.0` routed-experts capture config lookup from
`layer.vllm_config.model_config`.
- For non-`0.23.0`, use `get_current_vllm_config()` to obtain
`model_config`.
- Reason: upstream routed experts capture is now driven by current vLLM
config context
  instead of relying only on the layer-local config path.
- Upstream source:
[vllm#28284](vllm-project/vllm#28284).

`vllm_ascend/worker/v2/aclgraph_utils.py`

- Add `lora_capture_cases` to `ModelAclGraphManager.__init__` and
forward it upstream.
- Add `lora_capture_hook` to `capture_model` and forward it by keyword.
- Reason: upstream MRV2 LoRA warmup/capture now passes LoRA capture
cases and hook
  through CUDA graph manager APIs.
- Upstream source:
[vllm#35536](vllm-project/vllm#35536).

`vllm_ascend/worker/v2/model_runner.py`

- Update the graph manager factory to accept `lora_capture_cases`.
- Forward `lora_capture_cases` into `ModelAclGraphManager`.
- Reason: without this factory-level argument, upstream MRV2 LoRA warmup
fails before
  reaching Ascend ACL graph manager.
- Upstream source:
[vllm#35536](vllm-project/vllm#35536).

`vllm_ascend/worker/v2/spec_decode/eagle/aclgraph.py`

- Replace the misleading `AttentionStatePair as CapturedAttentionState`
alias with
  direct `AttentionStatePair` usage.
- Rename `full_cg_attn_states` to `attn_states`.
- Forward `progress_bar_desc` by keyword.
- Reason: upstream Eagle graph capture split/renamed captured attention
state flow.
- Upstream source:
[vllm#44253](vllm-project/vllm#44253).

`vllm_ascend/patch/platform/__init__.py`

- Only import GLM4.7 / MiniMax M2 parser patches and MiniMax usage
accounting patch
  on `0.23.0`.
- Reason: upstream main has refactored these parser internals, so the
old Ascend patches
  are only valid for the `0.23.0` parser implementation.
- Upstream sources:
  [vllm#45701](vllm-project/vllm#45701),
  [vllm#45915](vllm-project/vllm#45915).

`tests/ut/patch/platform/test_patch_glm47_tool_call_parser.py`

- Skip the module on non-`0.23.0` before importing incompatible upstream
parser internals.
- Reason: upstream GLM parser internals were migrated/refactored and
  `_extract_tool_call_regions` is no longer available in the old form.
- Upstream source:
[vllm#45915](vllm-project/vllm#45915).

`tests/ut/patch/platform/test_patch_minimax_m2_tool_call_parser.py`

- Skip on non-`0.23.0`.
- Reason: upstream MiniMax M2 tool parser moved to the new streaming
parser engine and
old attributes such as `tool_call_start_token` are no longer available.
- Upstream source:
[vllm#45701](vllm-project/vllm#45701).

`tests/ut/patch/platform/test_patch_minimax_usage_accounting.py`

- Skip on non-`0.23.0`.
- Reason: upstream MiniMax M2 reasoning/parser internals changed and old
usage accounting
  patch assumptions no longer hold on main.
- Upstream source:
[vllm#45701](vllm-project/vllm#45701).

- vLLM version: v0.23.0
- vLLM main:
vllm-project/vllm@a30addc
---------
Signed-off-by: MrZ20 <2609716663@qq.com>
Signed-off-by: Mrz20 <2609716663@qq.com>
Leetrytry pushed a commit to Leetrytry/vllm-ascend that referenced this pull request Sep 11, 2026
### What this PR does / why we need it?

This PR upgrades the verified vLLM main commit to
`b9a7cd464c9ae9b1b450f8982b76d7be4de73724` and adapts vLLM Ascend to
upstream API changes introduced after the previous verified commit.

`vllm_ascend/__init__.py`

- Set `VLLM_USE_V2_MODEL_RUNNER=0` for non-`0.23.0`.
- Reason: this branch keeps the main compatibility path on V1 model
runner. V2 still has
partial compatibility updates, but it is not enabled as the default path
here.
- Related upstream changes: vLLM Model Runner V2 migration work,
including
[vllm#42667](vllm-project/vllm#42667) and
[vllm#44446](vllm-project/vllm#44446).

`tests/e2e/pull_request/one_card/test_guided_decoding.py`

- For non-`0.23.0` and `xgrammar` / `outlines`, set
  `VLLM_REGEX_COMPILATION_TIMEOUT_S=30` during the test.
- Keep `0.23.0` behavior unchanged.
- Reason: upstream added a structured-output regex compilation timeout.
The existing
complex JSON schema can exceed the default 5s timeout during grammar
compilation.
- Upstream source:
[vllm#45118](vllm-project/vllm#45118).

`vllm_ascend/core/scheduler_profiling_chunk.py`

- Add `throttle_prefills: bool = False` to
`ProfilingChunkScheduler.schedule`.
- Reason: upstream scheduler `schedule()` now accepts
`throttle_prefills`.
- Upstream source:
[vllm#44558](vllm-project/vllm#44558).

`vllm_ascend/patch/platform/patch_balance_schedule.py`

- Add `throttle_prefills` to `BalanceScheduler.schedule`.
- For `0.23.0`, continue calling `super().schedule()` with no argument.
- For non-`0.23.0`, forward `throttle_prefills` to upstream scheduler.
- Reason: keep the balance scheduler wrapper compatible with both old
and new upstream
  scheduler signatures.
- Upstream source:
[vllm#44558](vllm-project/vllm#44558).

`vllm_ascend/patch/platform/patch_profiling_chunk.py`

- Change the schedule wrapper to accept `*args, **kwargs`.
- Reason: profiling chunk patch wraps scheduler implementations whose
signatures now
  differ between `0.23.0` and upstream main.
- Upstream source:
[vllm#44558](vllm-project/vllm#44558).

`vllm_ascend/spec_decode/ngram_proposer.py`

- Split `AscendNgramProposer.propose` by `vllm_version_is("0.23.0")`.
- `0.23.0` keeps the old Ascend behavior using `runner.input_batch`.
- Non-`0.23.0` follows upstream Dynamic SD signature:
`propose(num_speculative_tokens, sampled_token_ids, num_tokens_no_spec,
token_ids_cpu, ...)`.
- Pass `num_speculative_tokens` into `batch_propose`.
- Reason: upstream Dynamic Speculative Decoding changed ngram proposer
signatures and
  made the per-step draft-token budget explicit.
- Upstream source:
[vllm#32374](vllm-project/vllm#32374).

`vllm_ascend/spec_decode/suffix_proposer.py`

- Add version-aware wrapper for suffix decoding proposer.
- `0.23.0` keeps calling upstream as:
  `super().propose(input_batch, sampled_token_ids)`.
- Non-`0.23.0` calls upstream as:
`super().propose(num_speculative_tokens, input_batch, sampled_token_ids,
...)`.
- Reason: upstream Dynamic SD added `num_speculative_tokens` to suffix
decoding proposer.
- Upstream source:
[vllm#32374](vllm-project/vllm#32374).

`vllm_ascend/worker/model_runner_v1.py`

- For `AscendNgramProposer`, pass
  `scheduler_output.num_spec_tokens_to_schedule`,
`self.input_batch.num_tokens_no_spec`, and
`self.input_batch.token_ids_cpu`
  on non-`0.23.0`.
- For `AscendSuffixDecodingProposer`, pass
  `num_speculative_tokens=scheduler_output.num_spec_tokens_to_schedule`
  on non-`0.23.0`.
- For Eagle-style proposers, pass
`self.speculative_config.num_speculative_tokens`
  on non-`0.23.0`.
- Reason: upstream Dynamic SD changed proposer call signatures and
scheduler output now
  carries the dynamic speculative token budget.
- Upstream source:
[vllm#32374](vllm-project/vllm#32374).

`vllm_ascend/worker/encoder_acl_graph.py`

- For `0.23.0`, continue using `self.budget_graphs[token_budget]`.
- For non-`0.23.0`, use upstream graph-set storage through
  `self._get_graph_set("default")`.
- Reason: upstream encoder CUDA graph manager changed from a flat budget
graph map to
  graph sets for multiple capture paths.
- Upstream source:
[vllm#43586](vllm-project/vllm#43586).

`vllm_ascend/ops/fused_moe/fused_moe.py`

- Keep `0.23.0` routed-experts capture config lookup from
`layer.vllm_config.model_config`.
- For non-`0.23.0`, use `get_current_vllm_config()` to obtain
`model_config`.
- Reason: upstream routed experts capture is now driven by current vLLM
config context
  instead of relying only on the layer-local config path.
- Upstream source:
[vllm#28284](vllm-project/vllm#28284).

`vllm_ascend/worker/v2/aclgraph_utils.py`

- Add `lora_capture_cases` to `ModelAclGraphManager.__init__` and
forward it upstream.
- Add `lora_capture_hook` to `capture_model` and forward it by keyword.
- Reason: upstream MRV2 LoRA warmup/capture now passes LoRA capture
cases and hook
  through CUDA graph manager APIs.
- Upstream source:
[vllm#35536](vllm-project/vllm#35536).

`vllm_ascend/worker/v2/model_runner.py`

- Update the graph manager factory to accept `lora_capture_cases`.
- Forward `lora_capture_cases` into `ModelAclGraphManager`.
- Reason: without this factory-level argument, upstream MRV2 LoRA warmup
fails before
  reaching Ascend ACL graph manager.
- Upstream source:
[vllm#35536](vllm-project/vllm#35536).

`vllm_ascend/worker/v2/spec_decode/eagle/aclgraph.py`

- Replace the misleading `AttentionStatePair as CapturedAttentionState`
alias with
  direct `AttentionStatePair` usage.
- Rename `full_cg_attn_states` to `attn_states`.
- Forward `progress_bar_desc` by keyword.
- Reason: upstream Eagle graph capture split/renamed captured attention
state flow.
- Upstream source:
[vllm#44253](vllm-project/vllm#44253).

`vllm_ascend/patch/platform/__init__.py`

- Only import GLM4.7 / MiniMax M2 parser patches and MiniMax usage
accounting patch
  on `0.23.0`.
- Reason: upstream main has refactored these parser internals, so the
old Ascend patches
  are only valid for the `0.23.0` parser implementation.
- Upstream sources:
  [vllm#45701](vllm-project/vllm#45701),
  [vllm#45915](vllm-project/vllm#45915).

`tests/ut/patch/platform/test_patch_glm47_tool_call_parser.py`

- Skip the module on non-`0.23.0` before importing incompatible upstream
parser internals.
- Reason: upstream GLM parser internals were migrated/refactored and
  `_extract_tool_call_regions` is no longer available in the old form.
- Upstream source:
[vllm#45915](vllm-project/vllm#45915).

`tests/ut/patch/platform/test_patch_minimax_m2_tool_call_parser.py`

- Skip on non-`0.23.0`.
- Reason: upstream MiniMax M2 tool parser moved to the new streaming
parser engine and
old attributes such as `tool_call_start_token` are no longer available.
- Upstream source:
[vllm#45701](vllm-project/vllm#45701).

`tests/ut/patch/platform/test_patch_minimax_usage_accounting.py`

- Skip on non-`0.23.0`.
- Reason: upstream MiniMax M2 reasoning/parser internals changed and old
usage accounting
  patch assumptions no longer hold on main.
- Upstream source:
[vllm#45701](vllm-project/vllm#45701).

- vLLM version: v0.23.0
- vLLM main:
vllm-project/vllm@a30addc
---------
Signed-off-by: MrZ20 <2609716663@qq.com>
Signed-off-by: Mrz20 <2609716663@qq.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 nvidia ready ONLY add when PR is ready to merge/full CI is needed v1

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants