Repository navigation
fix(models): bound Inkling 2 Small load memory and validate it - #3397
Merged
Merged
Conversation
inureyes
added a commit
that referenced
this pull request
Nov 24, 2026
9 tasks done
Inkling 2 Small loaded and generated on a 512 GB M3 Ultra, but its first token built the contiguous gate and up copies of every layer's expert w13 in one graph, taking the process footprint to 459 GiB and the host to 10% free memory. The loader now evaluates the sanitized weights one decoder layer at a time with the MLX buffer cache off and restores the limit afterwards, as mlx-vlm's README does for Small. The MLX peak is now 367 GiB, the first prefill drops from 8.2 s to 0.34 s, and greedy output is unchanged (Mini output is identical to the unbounded path). The Inkling 2 kernels log each model's gate decision at load and the first dispatch of each kernel at debug level, which shows Small takes only the short convolution. The two reference trace scripts gain the bounded load so mlx-vlm can hold Small. Small results (greedy match, 0/409 and 0/88 decided disagreements, server, ABAB kernels, batch 4, DSpark) are in docs/benchmark_results/inkling2-small-m3ultra-2026-11-24.md. Tests: --lib inkling (172), --lib coverage_tests (18), clippy and the CI contract scripts. Closes #3373
inureyes
force-pushed
the
test/issue-3373-inkling2-small-validation
branch
from
November 24, 2026 07:43
883fe8b to
c3b5c32
Compare
inureyes
marked this pull request as ready for review
November 24, 2026 07:45
Closed
5 tasks done
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
First real-checkpoint run of Inkling 2 Small (
thinkingmachines/Inkling-2-Small885d78bf) on a 512 GB M3 Ultra, against mlx-vlm 466069f5, with the one Small-specific bug it exposed fixed.w13in one graph, taking the process footprint to 459 GiB (10% free on the host).load_inkling2_vlmnow evaluates the sanitized weights one decoder layer at a time with the MLX cache limit at 0 and restores it, as mlx-vlm's README does for Small. MLX peak 367 GiB, first prefill 8.2 s to 0.34 s, output unchanged.mlxcel inspectestimates 364.8 GiB for weights, KV and activations (0.6% under the peak), somemory_estimate.rsis unchanged.scripts/mlx_vlm_image_logit_trace.py --bounded-loadand a zero cache limit inmlx_lm_logit_trace.py --mlx-vlmlet mlx-vlm hold Small.docs/supported-models.md(model entry and DSpark row), plus the fact that Small's index has no audio tensor (1348model.llm.*, 422model.visual.*), so the fix(vlm): refuse audio input for Inkling 2 with a clear error #3376 refusal holds for it.Results
image_url,get_weather{"city":"Warsaw"}MLXCEL_MTP_ALLOW_INEXACT=1; probe declines, 503855/800232 bytes)Details:
docs/benchmark_results/inkling2-small-m3ultra-2026-11-24.md.Test plan
cargo test --profile test-fast --features metal,accelerate --lib inkling(172 passed) and--lib coverage_tests(18), under the GPU lockcargo clippy --lib --tests --features metal,accelerate -- -D warnings,cargo fmt --all -- --check, the CI contract scripts and the header checkMLXCEL_WEIGHT_MATERIALIZATION=lazy(the unbounded path)make verify) left to the orchestratorCloses #3373