fix(examples): disable prefix caching in multimodal QA and document the symptom - #577
Open
Ming (shuming-dev) wants to merge 2 commits into
Open
fix(examples): disable prefix caching in multimodal QA and document the symptom#577Ming (shuming-dev) wants to merge 2 commits into
Ming (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.
Contributor
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. |
Contributor
Author
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.