Use model-native video preprocessing for Qwen3-VL - #36109
Open
avisingh599 wants to merge 4 commits into
Open
Conversation
avisingh599
requested review from
HaiShaw,
JustinTong0323,
mickqian,
yctseng0211,
yhyang201 and
yuan-luo
as code owners
August 23, 2026 20:21
…lit processor The processor split left two call sites pointing at the legacy path: - NATIVE_MM_FAMILIES matches the mm-processor class by identity, so qwen3_vl/qwen3_5 resolving to Qwen3VLImageProcessor no longer matched the qwen_vl family and SGLANG_RUST_SERVER=1 hard-errored at launch. Give the Qwen3 processor its own family entry (same native pipeline, images only, unchanged by this PR). - The EPD encoder preprocessor called the legacy factor-28 preprocess_video for every qwen model type, keeping the double-resize for qwen3_vl/qwen3_5. Dispatch those model types to qwen3_vl.preprocess_video. Pin the gate mapping with a test going through get_mm_processor_cls.
…trings The fps=1/fps=2 cases recomputed the expected indices with the same smart_nframes + linspace the implementation calls, i.e. they asserted the code against itself, and duplicated the hardcoded [0, 3, 6, 9] oracle in the source-geometry test. The pinned flags asserted an implementation-detail optimization, not a behavior contract.
JustinTong0323
requested review from
ShangmingCai,
Ying1123,
hnyls2002,
liusy58,
merrymercy and
xiezhq-hermann
as code owners
August 24, 2026 17:58
Collaborator
|
Pushed two commits on top (hope that is okay — happy to split them out if you would rather take them as suggestions):
Two things that need your call:
Non-blocking: the accuracy evidence (18 examples x 8 samples) is on the thin side for the F1 deltas claimed — a VideoMME-class number would make this much easier to stamp. CI note: the red gates are just the missing |
Author
|
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.
Motivation
SGLang currently pre-resizes Qwen2/2.5 and Qwen3 video frames through the same factor-28 path. The processor stacks differ: Hugging Face's Qwen2 video processor uses 14-pixel patches, while Qwen3 has a dedicated Qwen3VLVideoProcessor with 16-pixel patches and a temporal-spatial resize budget. Consequently, Qwen3 frames are resized using the legacy geometry before being resized again by their model-native processor. See also the Qwen3-VL technical report.
Modifications
qwen3_vl.py.max_framesbehavior.Accuracy Tests
On an 18-example temporal-localization evaluation with eight samples per example, macro F1@1s/3s/5s changed from
0.4298/0.6851/0.7458to0.4628/0.6970/0.7655.CI States
Latest PR Test (Base): ❌ Run #32759734996
Latest PR Test (Extra): ❌ Run #32759734721
Latest PR Test (AMD ROCm 7.2): ❌ Run #32759735088