vllm - 💡(How to fix) Fix [Bug]: Structured outputs + pipeline parallelism on the V1 model runner: xgrammar FSM desync ("Failed to advance FSM") [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fixed

Code Example

backend_xgrammar.py: Failed to advance FSM for request <id> for tokens 4754
scheduler.py: Unexpected: grammar rejected tokens [4754]. Terminating request.
RAW_BUFFERClick to expand / collapse

Your current environment

env is not needed

🐛 Describe the bug

Used model : qwen 3.5 27b

PP (pipeline_parallel_size > 1) and structured outputs (xgrammar), requests intermittently fail with a 500.

backend_xgrammar.py: Failed to advance FSM for request <id> for tokens 4754
scheduler.py: Unexpected: grammar rejected tokens [4754]. Terminating request.

The failure is most reliable right after server start; once the engine is warm it becomes intermittent.

This only happens when the engine uses the V1 model runner. Models that run on the V2 model runner are not affected.

Environment

  • vLLM 0.22.1rc1.dev266+g469f3dcf1; code paths below are unchanged on current main (c66b19800).
  • Model: cyankiwi/Qwen3.5-27B-AWQ-4bit (hybrid / Mamba-style, Qwen3.5).
  • 3x A100-40GB.
  • Flags:
  --structured-outputs '{"backend":"xgrammar","disable_any_whitespace":true}'
  --reasoning-parser qwen3 --attention-backend FLASHINFER

-Async scheduling enabled (default, and forced-on by PP).

The model is hybrid with mamba_cache_mode="align" (set automatically when prefix caching is on), which is listed as unsupported by the V2 model runner (config/vllm.py: _get_v2_model_runner_unsupported_features), so the engine falls back to the V1 model runner. That fallback is what exposes the bug.

how to reproduce the bug

Send multiple concurrent chat-completion requests with json schema, right after the server becomes ready A single request is enough on a cold engine.

100% failure on the first burst, then intermittent.


  • PP=3, V1 runner, structured: fails (FSM reject, 500). Reliable on first burst.
  • TP=2, V1 runner, structured: no failures (105 requests).
  • TP=3: cannot start for this model (16 attention heads not divisible by 3), which is why PP is used to span 3 GPUs in the first place.
  • Plain (non-structured) generation under PP=3: no failures.

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING