Skip to content

fix(vllm_rollout): Filter prompts exceeding max_model_len instead of …#690

Open
Pritiks23 wants to merge 2 commits into
nvidia-cosmos:mainfrom
Pritiks23:fix/vllm-max-model-len-filtering
Open

fix(vllm_rollout): Filter prompts exceeding max_model_len instead of …#690
Pritiks23 wants to merge 2 commits into
nvidia-cosmos:mainfrom
Pritiks23:fix/vllm-max-model-len-filtering

Conversation

@Pritiks23

Copy link
Copy Markdown

Fixes issue #403 - vLLM now raises an error when decoder prompt length exceeds max_model_len, especially with large images/videos in VLM tasks. This fix filters out oversized prompts before passing them to vLLM, preventing errors while logging warnings about skipped samples.

Changes:

  • Added prompt length validation in rollout_generation_single_turn()
  • Added prompt length validation in async rollout_generation()
  • Supports both LLM (string/dict prompts) and VLM (image/video inputs)
  • Logs warnings when samples are skipped due to exceeding max_model_len
  • Gracefully handles edge cases where token count cannot be determined

Pritiks23 added 2 commits May 22, 2026 18:40
…raising error

Fixes issue nvidia-cosmos#403 - vLLM now raises an error when decoder prompt length exceeds
max_model_len, especially with large images/videos in VLM tasks. This fix filters
out oversized prompts before passing them to vLLM, preventing errors while logging
warnings about skipped samples.

Changes:
- Added prompt length validation in rollout_generation_single_turn()
- Added prompt length validation in async rollout_generation()
- Supports both LLM (string/dict prompts) and VLM (image/video inputs)
- Logs warnings when samples are skipped due to exceeding max_model_len
- Gracefully handles edge cases where token count cannot be determined
@Pritiks23 Pritiks23 force-pushed the fix/vllm-max-model-len-filtering branch from 5876831 to 4c2abb1 Compare May 22, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant