Repository navigation
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Pull request overview
Fixes a crash in the MiMo-V2 multimodal processor when a video’s audio track ends before the final video grid timestamps by clamping per-grid audio token lengths to zero instead of asserting.
Changes:
- Clamp
segment_audio_token_lento>= 0to avoidAssertionErrorwhenaudio_start_token_idx >= audio_token_len. - Avoid slicing/appending zero-length tokenized audio segments by setting
segment_audio = Nonewhen the computed segment length is0.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Independent reproduction and verification of this fix, in case it helps unblock the review. Repro — sglang v0.5.18, MiMo-V2.5 official FP8 weights, TP4 on 8×H200. Any Root cause is exactly what this PR describes: for the tail grid segments We arrived at the same patch as this PR independently (before finding it): Verification on a real AV case suite, 2 samples per case:
Answer quality on the short-track cases is on par with the full-track cases — the model still describes both the visual content and the audio events correctly — so clamping to 0 (tail grids emit video tokens with no audio placeholders) does not visibly degrade the output. Worth noting we have not verified that this matches MiMo's training-time handling of a short/absent tail; this is an empirical result, not a claim about the intended semantics. One thing this PR needs before it can land: it no longer applies to current Note also that the originating issue #24602 was auto-closed by the stale bot on 2026-07-18 for inactivity, not because it was fixed — the crash is still present on Happy to open a rebased PR with a regression test on |
|
/tag-and-rerun-ci |
8eab809 to
b4f9310
Compare
|
Rebased onto current |
Clamp per-grid audio lengths at zero when the video continues after its audio track. Empty tail segments keep their video tokens and skip audio slicing instead of raising an assertion. Rebase the fix onto _build_video_audio_units and cover positive, zero, and negative raw segment lengths with a CPU unit test. Co-authored-by: Claude <[email protected]> Signed-off-by: YushuoSun <[email protected]>
b4f9310 to
ce2fefc
Compare
|
The first CPU run caught a test-environment issue: importing |
|
/rerun-failed-ci |
|
I re-ran CI (/rerun-failed-ci) after rebasing and stubbing optional FFmpeg decoder imports in test path; remaining failures are infra/test-environment issues (external import/path/runner constraints), not a functional regression in the fix. Happy to reopen/rebase for another run if helpful for merge confidence. |
|
I reopened this on latest main as: #38664 |
|
I opened a refreshed PR against current main: #38668 |
|
Superseded by #38668. |
Motivation
Fixes #24602.
MiMo-V2.5 crashes when a video's audio track ends before the final video grid. Later grids start at or beyond
audio_token_len, so the previous calculation produced a zero or negative segment length and hit an assertion, returning HTTP 500 for the whole request.Modifications
The patch is rebased onto current
main, where this logic now lives in_build_video_audio_units:Behavior is unchanged while audio is available. The only new path is for video grids after the audio has ended.
Accuracy Tests
@yuweih205 independently reproduced the failure and verified the same fix on MiMo-V2.5 with 8xH200: the short-track case changed from 0/2 to 2/2, and the full six-case AV suite passed 12/12. See the verification in #25515 (comment).
The new unit test is registered in
base-a-test-cpu; Linux CI will execute it on this revision.Speed Tests and Profiling
Not run. The hot-path change replaces a subtraction plus assertion with
max(0, ...)and avoids slicing empty audio segments.Checklist
test_video_units_allow_audio_to_end_before_video.CI States
Latest PR Test (Base): ❌ Run #33359800548
Latest PR Test (Extra): ❌ Run #33359800304
Latest PR Test (AMD ROCm 7.2): ❌ Run #33359800684