Skip to content

[Fix] MiMo-V2 video+audio crash when audio is shorter than video (refresh) - #38668

Open
yushuosun wants to merge 2 commits into
sgl-project:mainfrom
yushuosun:fix/mimo-v2-video-audio-shorter-than-video-r4
Open

yushuosun wants to merge 2 commits into
sgl-project:mainfrom
yushuosun:fix/mimo-v2-video-audio-shorter-than-video-r4

Conversation

@yushuosun

@yushuosun yushuosun commented Sep 9, 2026 •

Copy link
Copy Markdown

This is a refresh of #25515 against current main.


CI States

Latest PR Test (Base): ❌ Run #34683626893
Latest PR Test (Extra): ❌ Run #34683626804
Latest PR Test (AMD ROCm 10): ❌ Run #34683626884

Reported in sgl-project#24602: serving MiMo-V2.5 with a normal
video file whose audio track ends before the last video grid timestamp
crashes inside `_process_video_audio_content`:

  File "...multimodal/processors/mimo_v2.py", line 974, in
        _process_video_audio_content
    assert segment_audio_token_len > 0
  AssertionError

Per video grid `i`, the code computes

    audio_start = int(grid_t_timestamps[i]   * audio_token_per_second)
    audio_end   = int(grid_t_timestamps[i+1] * audio_token_per_second)
    segment_audio_token_len =
        min(audio_end, audio_token_len) - audio_start

When the video is longer than its audio track, the late grids have
`audio_start >= audio_token_len`, so `segment_audio_token_len` becomes
zero or negative and the assert fires, dropping the whole request.

Clamp the segment length to `>= 0` so the late grids still emit their
video tokens with zero audio placeholders, and skip the slice (set
`segment_audio = None`) when the segment is empty. The downstream loop
already guards with `if segment_audio is not None:` before appending
to `audio_segments`, so no other change is needed.

Co-authored-by: Claude <[email protected]>
Signed-off-by: yushuosun <[email protected]>
@yushuosun

Copy link
Copy Markdown
Author

The latest gate run is blocked before tests start because the PR has no required run-ci label (and the extra workflow also requires the corresponding extra CI label). Please add the repository's required CI label(s) and retrigger the gate; the current failure is not a code-test failure.

@yushuosun

Copy link
Copy Markdown
Author

I’m blocked on this PR by required CI labels not writable from my account. Could a maintainer or the CI triage bot add the repo-required PR labels for Base/Extra gates so PR tests can run/finish, then rerun CI? The failing runs are currently blocked before execution due missing label requirements.

@yushuosun

Copy link
Copy Markdown
Author

I checked the upstream workflow policy in pr-states/pr-gate: base/amd/amdx workflows require PR label
un-ci, and extra workflows additionally require
un-ci-extra. If you can add these two labels on the PR, the gate should move past the current label-blocked state and proceed with tests.

sammysun0711 added a commit to sammysun0711/sglang that referenced this pull request Nov 7, 2026
* fix: keep MiMo-V2 processor available without TorchCodec

(cherry picked from commit b2c69db)
Signed-off-by: Xiake Sun <[email protected]>

* fix(multimodal): preserve MiMo video after audio ends

- Keep video-only tail units and cover them with a regression test.
- Backport yushuosun's upstream PR sgl-project#38668, adapting the test location.

(cherry picked from commits 32414bc
and ec9952c)

Signed-off-by: Xiake Sun <[email protected]>

* feat(multimodal): enable MiMo Flash audio on ROCm

- Route packed audio attention through AITER with causal and window semantics.
- Select the ROCm vision backend and allow native MXFP4 validation.
- Add media, numerical attention, and model-level grounding checks.

Signed-off-by: Xiake Sun <[email protected]>

* eval: update eval script and setup env guide for multimodal feature support

Signed-off-by: Xiake Sun <[email protected]>

* address review comments

Signed-off-by: Xiake Sun <[email protected]>

---------

Signed-off-by: Xiake Sun <[email protected]>
Co-authored-by: jbernloehr <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant