Debugging Silent Failures in vLLM State Cache

AI Engineergo watch the original →

Two silent inference bugs in vLLM—caused by incorrect scheduler state handling and integer overflow—were identified by comparing logprobs against a baseline and tracing request IDs through the forward pass.

Identifying Silent Failures via Logprob Forensics

When models return gibberish without crashing, standard error logs are useless. The authors identified these silent failures by building a logprob comparison script. By running the same prompt through the production vLLM instance and a vanilla Hugging Face Transformers baseline, they calculated the divergence in token distributions. This allowed them to isolate specific requests that were producing incorrect logits, even when the model maintained high confidence.

Resolving Scheduler and Memory Bugs

Two distinct bugs were traced to the Mamba state cache:

  • Incorrect Scheduler Ordering: The vLLM scheduler occasionally triggered a decode pass before a prefill pass. Because Mamba kernels read state before writing, they processed stale data from previous requests. The fix involved threading a request_id through the forward pass to identify the culprit and ensuring the scheduler correctly marks uncomputed tokens for prefill.
  • Integer Overflow in State Indexing: A 32-bit index used for the Mamba state cache wrapped around after exceeding four billion entries. This caused silent data corruption under high load. The fix was replacing the uint32 index type with size_t to ensure 64-bit addressing on modern architectures.

Debugging Strategies for Stateful Inference

To reproduce these issues, the authors manipulated vLLM configuration flags to force failures. Reducing GPU memory utilization surfaced the scheduler bug by increasing contention, while increasing the number of rollouts per prompt accelerated the manifestation of the integer overflow. When debugging complex inference engines, the authors recommend threading request identities through the forward pass to bypass the anonymity of tensor-based processing.

  • #vllm
  • #debugging
  • #mamba
  • #inference

summary by google/gemini-3.1-flash-lite. probably wrong about something. check the source.