Two Bugs That Hid in Plain Sight: A vLLM Debugging Detective Story — Asaf Gardin & Yuval Belfer
Two rare vLLM failures produced confident gibberish without errors; cross-engine log-prob comparisons, constrained memory, and request IDs exposed scheduler and cache-index bugs.
AI21 saw gibberish roughly **once per thousand prompts**, only in vLLM and under load. One bug scheduled decode before prefill for a fresh Mamba request, reusing stale state; another used a **32-bit cache index** that wrapped instead of raising an error.
Build a deterministic log-prob comparison against a simpler inference engine, then vary memory pressure and rollout count to change the failure’s timing or location. Carry request identity into the model forward path so a bad output can be tied to scheduler and kernel metadata.
AI21 saw gibberish roughly **once per thousand prompts**, only in vLLM and under load. One bug scheduled decode before prefill for a fresh Mamba request, reusing stale state; another used a **32-bit cache index** that wrapped instead of raising an error. Build a deterministic log-prob comparison against a simpler inference engine, then vary memory pressure and rollout count to change the failure’s timing or location. Carry request identity into the model forward path so a bad output can be tied to scheduler and kernel metadata. Neither defect crashed the process, and ordinary quality checks could therefore misclassify corrupted inference as model behavior. The fixes were specific—a prefill guard and changing the index to size_t—but the broader debugging method matters most for stateful runtimes.
This adds inference-runtime corruption as a prerequisite check for trustworthy agent evaluation. Rare, load-dependent scheduler and integer-overflow bugs can emit plausible failures without crashes, so benchmark scores may measure serving defects as model behavior. Differential log-prob tests against a simpler engine, load variation, and request-linked runtime metadata complement final-state and constraint grading by first establishing that the evaluated model execution is sound.