WIP feat: added video support for approximate prefix match#1911
WIP feat: added video support for approximate prefix match#1911capri-xiyue wants to merge 9 commits into
Conversation
Signed-off-by: Xiyue Yu <xiyue@google.com>
Signed-off-by: Xiyue Yu <xiyue@google.com>
|
@namgyu-youn
Let's keep iterating in your PR to figure out the best balance between accurate token estimation and a simple user experience. And extracting metadata from video directly could be a follow up PR if we think it is feasible. And let me know your thoughts about this PR |
Signed-off-by: Xiyue Yu <xiyue@google.com>
|
Here is the estimated comparison with qwen3 vl === RUN TestVideoEstimator_PlaceholderCount_Live for gemma4, I use setting as follows |
Signed-off-by: Xiyue Yu <xiyue@google.com>
|
cc @ahg-g |
|
Thanks for drafting this — the header-based metadata idea seems a nice simplification over parsing MP4 containers directly. Before we converge on an interface, I want to flag an accuracy concern with the formula itself.
Your benchmark shows durations 1–30s tracking linearly within ~1.5%, then 60s/90s both plateauing at exactly maxVideoTokens: 12288 — which looks like factor and maxVideoTokens were tuned to fit this specific grid rather than the formula reproducing the cap independently. Could you reproduce different source like 60fps, non-24/30 capture rate? #1408's formula mirrors the real vLLM mechanism rather than fitting a curve to it, which is why it holds up on Video-MME clips it wasn't tuned against. Separately, could we land #1408 first? It'd give us a merged, validated baseline for Qwen3-VL to iterate the interface question on top of, rather than deciding the interface before the underlying formula is settled. |
Signed-off-by: Xiyue Yu <xiyue@google.com>
Signed-off-by: Xiyue Yu <xiyue@google.com>
I ran it with the fps you suggested The estimation is still relatively accurate. The source video's FPS actually doesn't matter, since Qwen 3VL extracts frames using its own sampling rate(sample fps). For context, I adapted the formula from your PR and the Qwen VL source code, just simplifying it slightly. To clarify, our goal isn't 100% perfect token estimation, but rather finding the right balance between UI simplicity, processing speed, and token estimation accuracy. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
dded video support for approximate prefix match.
Which issue(s) this PR fixes:
Part of #1746
Release note (write
NONEif no user-facing change):