@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 81786c8774
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 10, 22:45 UTC

[BugFix] Fix async scheduling + reasoning with struct output (#31332)

Signed-off-by: Nick Hill <nickhill123@gmail.com>

Nick Hill committed Dec 25, 2025 at 15:01 UTC 81786c87748b0177111dfdc07af5351d8389baa1
3 files changed +9 -3
tests/v1/entrypoints/llm/test_struct_output_generate.py
+6 -2
@@ -608,7 +608,7 @@ Make the response as short as possible.
608
609
610 @pytest.mark.parametrize(
611 - "model_name, backend, tokenizer_mode, reasoning_parser, speculative_config", # noqa: E501
611 + "model_name, backend, tokenizer_mode, reasoning_parser, speculative_config, async_scheduling", # noqa: E501
612 [
613 (
614 "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B",
@@ -616,8 +616,10 @@ Make the response as short as possible.
616 "auto",
617 "deepseek_r1",
618 NGRAM_SPEC_CONFIG,
619 + False,
620 ),
620 - ("Qwen/Qwen3-1.7B", "xgrammar", "auto", "deepseek_r1", None),
621 + ("Qwen/Qwen3-1.7B", "xgrammar", "auto", "deepseek_r1", None, False),
622 + ("Qwen/Qwen3-1.7B", "xgrammar", "auto", "deepseek_r1", None, True),
623 ],
624 )
625 def test_structured_output_with_reasoning_matrices(
@@ -626,6 +628,7 @@ def test_structured_output_with_reasoning_matrices(
628 reasoning_parser: str,
629 model_name: str,
630 speculative_config: dict[str, Any] | None,
631 + async_scheduling: bool,
632 ):
633 if current_platform.is_tpu() and speculative_config:
634 pytest.skip("TPU does not support speculative decoding")
@@ -646,6 +649,7 @@ def test_structured_output_with_reasoning_matrices(
649 ),
650 tokenizer_mode=tokenizer_mode,
651 speculative_config=speculative_config,
652 + async_scheduling=async_scheduling,
653 )
654 tokenizer = llm.get_tokenizer()
655 reasoner = ReasoningParserManager.get_reasoning_parser(reasoning_parser)(
tests/v1/structured_output/test_reasoning_structured_output.py
+1
@@ -71,6 +71,7 @@ class TestReasoningStructuredOutput:
71 request.prompt_token_ids = [1, 2, 3, 4, 5]
72 request.all_token_ids = [1, 2, 3, 4, 5, 6, 7, 8]
73 request.num_computed_tokens = 5
74 + request.num_output_placeholders = 0
75 return request
76
77 def test_should_fill_bitmask_with_enable_in_reasoning(
vllm/v1/structured_output/__init__.py
+2 -1
@@ -339,8 +339,9 @@ class StructuredOutputManager:
339 return True
340
341 # Check if reasoning ends in *this* step
342 + delta_from = request.num_computed_tokens - request.num_output_placeholders
343 if self.reasoner.is_reasoning_end_streaming(
343 - request.all_token_ids, request.all_token_ids[request.num_computed_tokens :]
344 + request.all_token_ids, request.all_token_ids[delta_from:]
345 ):
346 # Reasoning just ended, so we shouldn't advance til
347 # next pass