[Security] Cap Qwen-VL video sampling knobs - #56729
Merged
Isotr0py merged 1 commit intoSep 14, 2026
Merged
Conversation
jperezdealgaba
requested review from
DarkLight1337,
NickLucche,
shen-shanshan,
tjtanaa and
ywang96
as code owners
September 13, 2026 22:07
Isotr0py
approved these changes
Sep 14, 2026
| * temporal_patch_size | ||
| ) | ||
| n = total_frames_num / original_fps * target.fps | ||
| n = total_frames_num / original_fps * min(target.fps, cls._MAX_FPS) |
Member
There was a problem hiding this comment.
I think a better solution is making fps and max_frames static kwargs, which can't be overrided by arguments from request.
But anyway, let's leave it to be done in followup refactoring.
Request-level max_frames and fps were applied with no server ceiling, so the Qwen2-VL and Qwen3-VL samplers could decode every source frame. Clamp both knobs to the existing 768-frame and 30-fps class limits. Co-authored-by: Cursor Agent Signed-off-by: Juan Pérez de Algaba <jperezde@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
jperezdealgaba
force-pushed
the
fix/qwen-vl-sampling-caps
branch
from
September 14, 2026 07:54
c97ebd3 to
a389a7c
Compare
Isotr0py
enabled auto-merge (squash)
September 14, 2026 08:49
Member
|
/ci run |
|
✅ Triggered Buildkite CI #88769 for commit |
Shreya-gaur
pushed a commit
to Shreya-gaur/vllm_private
that referenced
this pull request
Sep 14, 2026
Signed-off-by: Juan Pérez de Algaba <jperezde@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
ItsRoy69
pushed a commit
to ItsRoy69/vllm
that referenced
this pull request
Sep 15, 2026
Signed-off-by: Juan Pérez de Algaba <jperezde@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
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
Qwen2-VL and Qwen3-VL video samplers ignore
num_framesand bound sampling on request-controlledmax_framesandfps. A client can raise those knobs throughmedia_io_kwargsand force the frontend to decode every source frame. This applies the same class-level ceilings already used by the GLMGA sampler (_MAX_FRAMES,_MAX_FPS), so a request may lower the sample count but cannot raise it past 768 frames or 30 fps.Changes
vllm/multimodal/video.py: clampmax_framesandfpsinQwen2VLVideoBackendandQwen3VLVideoBackend.Codepath coverage
compute_frames_index_to_sampleon both Qwen backends. OpenCV, TorchCodec, PyNvVideoCodec, and DeepStream all call that method, so every codec is covered.LLMall reach the sameMediaConnector→VideoMediaIO→ registered sampler chain.video/jpegload_base64does not use these samplers (it keys offnum_frames). The Rust frontend rejectsmedia_io_kwargsand is unaffected.Duplicate-work check
Open/merged PRs searched for Qwen backends,
max_frames,media_io_kwargs, and video sampling caps.num_framesinVideoMediaIO.merge_kwargsonly; these samplers ignorenum_frames.Tests
Existing
TestGLMGASamplingCapstests already cover the same clamping pattern on the GLMGA backend. The Qwen backends apply identical class-level_MAX_FRAMES/_MAX_FPScaps.AI assistance
This PR was developed with AI assistance.
Made with Cursor