Repository navigation
[Fix] glm4v: Clamp request video budgets to the deployment limit - #43871
Merged
ShangmingCai merged 7 commits intoOct 18, 2026
Merged
Conversation
Request fps, max_frames, max_tokens_per_frame, and max_image_tokens could raise the processor budget before frames were decoded. Fixes sgl-project#43705
…dget A cap clamped to the token ceiling still skipped presize and applied that ceiling to every frame. Drop it at decode time when the product exceeds the shared budget, and use the full clip length on a DP shard. Fixes sgl-project#43705
cipheraxat
requested review from
HaiShaw,
JustinTong0323,
ShangmingCai,
liusy58,
mickqian,
yctseng0211,
yhyang201 and
yuan-luo
as code owners
October 12, 2026 16:40
…per-frame caps in pixels GLM-4.1V/4.6V processors have no max_frames, so a request max_frames was clamped to 2048 while the HF sampler stops at max_duration * fps (600). Use that as the ceiling. The per-frame drop compared tokens counted at 784 px against a presize budget counted at 1568 px, so caps that fit were dropped. Compare pixels. Reject non-positive and non-finite video_url knobs in the OpenAI schema, warn once when a request value is clamped, and document that request values can only tighten the deployment budget. Fixes sgl-project#43705 Co-Authored-By: Claude Opus 5.5 <[email protected]>
cipheraxat
requested review from
sogalin,
wisclmy0611 and
zijiexia
as code owners
October 14, 2026 20:37
Collaborator
There was a problem hiding this comment.
Looks good for this part.
ShangmingCai
approved these changes
Oct 16, 2026
Collaborator
|
/tag-and-rerun-ci |
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
Fixes #43705.
GLM-V video requests could raise
fps,max_frames,max_tokens_per_frame, andmax_image_tokensabove the deployment budget before frames were decoded. A large request could then make the worker decode far more frames, at higher resolution, than the default config allows.Modifications
fps-only request does not injectmax_framesand bypass the HF sampler.max_frameslimit comes from the processor'smax_frames, or from--mm-process-config. GLM-4.1V/4.5V/4.6V processors have nomax_frames; their HF sampler stops atmax_duration * fps(600 by default), so that value is the limit there. It follows a serverfpsoverride.max_tokens_per_framewhen its total pixels (cap * 28^2 * frame_count) exceed the shared presize budget. The frames then go through the shared presize path. A server-configured per-frame cap keeps per-frame mode.ChatCompletionMessageContentVideoURLnow declaresgt=0(andallow_inf_nan=Falseforfps), so OpenAI-path requests get a 400 before batching. The processor keeps the same check for the native/generatepath.multimodal_language_models.mdxnow says GLM-V request knobs can only tighten the budget, and operators raise the limits with--mm-process-config.Accuracy Tests
No model-forward or kernel change. Tests in
test/registered/unit/multimodal/test_glm4v_mixed_offsets.pybuild budgets with the realglm_processor_video_config. They cover:max_duration * fpslimit;The GLM-4.xV frame-limit, per-frame pixel, and schema tests fail on the previous head and pass now.
Speed Tests and Profiling
No inference-speed change. The clamp bounds decode work that a request could otherwise raise.
Checklist
Accuracy and speed benchmarks do not apply because this does not change model outputs or kernels.
🤖 Generated with Claude Code
CI States
Latest PR Test (Base): ✅ Run #39040010390
Latest PR Test (Extra): ❌ Run #39040010177
Latest PR Test (AMD ROCm 10): ❌ Run #39040010354