fix(examples): disable prefix caching in multimodal QA and document the symptom - #577
fix(examples): disable prefix caching in multimodal QA and document the symptom#577Ming (shuming-dev) wants to merge 2 commits into
Conversation
…he symptom vLLM's prefix cache desyncs from the multimodal receiver cache across the trainer's sleep/wake cycles (vllm#42995), surfacing as 'AssertionError: Expected a cached item for mm_hash=...' or a silent rollout hang. Turn it off in the example config and add a troubleshooting note to the example doc.
There was a problem hiding this comment.
Pull request overview
Disables vLLM prefix caching for multimodal QA and documents the related cache-desynchronization failure.
Changes:
- Disables prefix caching in the multimodal rollout configuration.
- Adds troubleshooting guidance for cache assertions and rollout hangs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
examples/multimodal_qa/train_multimodal_qa.py |
Disables prefix caching. |
docs/80-example-multimodal-qa.md |
Documents symptoms and mitigation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| ## Troubleshooting | ||
|
|
||
| - **`AssertionError: Expected a cached item for mm_hash=...`, or rollouts hanging after a sleep/wake cycle**: this is a vLLM multimodal prefix-cache desync ([vllm#42995](https://github.com/vllm-project/vllm/issues/42995)), not an Agent Lightning bug. The trainer sleeps and wakes the vLLM replicas around each update step, which is exactly what triggers it. Set `actor_rollout_ref.rollout.enable_prefix_caching: False` (already the default in this example) and restart from the latest checkpoint. |
There was a problem hiding this comment.
Good points, both fixed in 3c3534c: the note is now scoped to vLLM < 0.22.0 (crediting the upstream fix vllm#43001), and the advice reads "restart the run — resuming from the latest checkpoint if you have checkpointing enabled" instead of assuming a checkpoint exists.
Sylvester Kaczmarek (sylvesterkaczmarek)
left a comment
There was a problem hiding this comment.
This is a safe conservative default for the affected multimodal example, and the troubleshooting text correctly ties the failure to vLLM versions before 0.22.0. The one lifecycle concern is that the code disables prefix caching unconditionally, including fixed versions, so this workaround can become a permanent performance tax as the dependency floor moves. I would track a version-gated/default-removal follow-up once the supported vLLM baseline reaches the fixed release.
Summary
Follow-up to #560. The trainer sleeps and wakes the vLLM replicas around each update step. For multimodal rollouts, vLLM's prefix cache can desync from the multimodal receiver cache across those sleep/wake cycles (vllm#42995), surfacing as:
AssertionError: Expected a cached item for mm_hash='...'in the vLLM engine log, orWe hit this repeatedly in a real multimodal GRPO run; disabling prefix caching avoids it.
Changes
examples/multimodal_qa/train_multimodal_qa.py: setactor_rollout_ref.rollout.enable_prefix_caching: Falsewith an explanatory comment.docs/80-example-multimodal-qa.md: add a Troubleshooting entry describing the symptom and the workaround.Text-only training is unaffected; this is scoped to the multimodal example.