Repository navigation
Fix MiMo media memory reservations with bounded native execution - #205
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
4 tasks done
javiech1
pushed a commit
to javiech1/mlx-swift-lm
that referenced
this pull request
Oct 24, 2026
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.
Summary
Fix MiMo image/video admission by bounding actual vision execution before reducing its reservation. The production OpenRouter 1280×851 JPEG was charged about 344 GiB of extra vision memory; video graph charges reached 959–1014 GiB. The quote retained every layer/frame's worst-case graph simultaneously.
forwardBounded: synchronously complete each temporal grid and each transformer block using the existing native-work owner and checked evaluation.The companion d-inference PR distinguishes media-memory refusals from text/KV capacity failures so they do not clamp otherwise-working text providers.
Before
After
Validation
swift build --build-testswith the pinned local MLX and source-matched Metal library.MiMoV26NativeMediaDeadlineTests: eleven tests, including repeated media refusals followed by real text generation, expiry, cancellation, seal ownership and retirement.MiMoV26FullVisionQualificationTests: all four captured media plus 1080p, 4K, maximum-area portrait/panorama and 32-frame cases passed with the actual 364 BF16 vision tensors.MiMoV26FullAudioQualificationTests: genuine authenticated codec, captured stereo AAC plus 1/30/61/300-second PCM cases; all incremental allocator peaks below the corresponding reservations.On an M4 Max/128 GiB machine, the large JPEG vision workspace is 0.899 GiB with 0.404 GiB additional measured MLX peak. The MP4 vision workspace is 0.734 GiB and native audio reservation 0.323 GiB (previously 8.713 GiB for audio). Retained pixels/patches/features are additional.
The vision component measurement excludes language-model/codec weights, target KV and non-MLX allocations. The separate audio measurement covers PCM-to-codec output and excludes final audio-patch execution; that patch allowance remains charged. This is not full-size signed-provider or fleet qualification. See
docs/mimo-v26/media-working-set-20260930.mdfor source revision, hashes, calculated reservations and measurement scope.No language-model weights are committed. The checked-in encoded fixtures total about 8 MB; no request authorization headers or production prompt bodies are included.