Repository navigation
fix(vision): an explicit image_max_tokens of 1120 (or min of 70) is honoured; unset reaches the runner as 0 (ADR 0048) - #468
Conversation
…onoured; unset reaches the runner as 0 (ADR 0048) api.DefaultOptions fills the image budget with gemma4's 70/1120, so unset and an explicit 70/1120 reached the runners as the same values, and the resolvers for models with other bounds read 70/1120 as "unset" (ADR 0016 kept it as a documented limitation). On muse-glimmer, whose ceiling is 4096, image_max_tokens=1120 sized a 2048x2048 image at 4100 tokens, against 1091 at 1119 or 1121 (MLX, 30b-nvfp4 and 30b-mxfp8, 2026-10-11). - server: modelOptionsWithEmbeddingBatchDefault zeroes each bound neither the request nor the Modelfile set (hasOption, as for draft_num_predict), so unset reaches the runners as 0, "the model's own". - llm (nemotron_h_omni) and mlxrunner (ResolveImageBudget: muse-glimmer, qwen3.5, nemotron_h): only <= 0 is unset; any explicit value is honoured, 70 and 1120 included. - gemma4 is unchanged: its own bounds are 70/1120, and unset and explicit launch the same flags. - Tests that asserted the sentinel now assert the explicit value; TestModelOptionsImageBudgetUnsetIsZero and a nemotron reload row (an explicit 70/1120 is a different launch) are new. - ADR 0048 records the change; ADR 0016's and 0021's sentinel clauses and nemotron-dynres-patch.md point to it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…duced, and glimmer against gemma4:31b think-off Phases 0-2 done (inventory, smoke on all eight tags, preflight ladders); phase 3 in progress. The findings and their draft PRs (#464-#468), and summarize_head_to_head.py's table of glimmer against gemma4:31b, thinking off, pasted as printed with its MIXED-build provenance. Several glimmer cells sit on the format + think-off path #464 fixes; the rglfix_ re-run is the comparison to read. Also corrects the record's unknown-think-level line (it falls back to the default; upstream ollama#18473) and the probe check that follows from it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
CUDA host review, at How it was checked:
Other checks:
One gap: a key sent as
Should be stated in the PR: an explicit 1120 or 70 sent to nemotron on GGUF now changes the launch and forces a reload. Before, it was a no-op. Nit: From |
…048)
hasOption only checks that a key exists, while FromMap skips a nil value,
so {"image_max_tokens": null} kept DefaultOptions' 1120 and read as an
explicit request for it. On nemotron_h_omni (GGUF) that launched 70/1120
instead of 256/3328 and reloaded against unset requests.
The image bounds now use hasNonNilOption, for the request and the
Modelfile alike. draft_num_predict and num_batch keep hasOption.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the 70/1120 sentinel Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, both points are fixed:
From |
|
Confirmed at
Agreed on leaving From |
… comment over #483's visionArch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s 1-5, the fixes it produced, and the follow-ups Phases 0-5 ran on all eight tags. The record's outcome section lists the five fixes now in v0.40.2-dynres.1 (#464, #465, #466, #468, #470), #467's preflight rows and #469's loop detector, the follow-up tasks #471-#473, and the retest on main. Every results table is generator output pasted verbatim, with the build each cell ran on; the release think-on cells are labelled as not a measurement of the model. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An explicit
image_max_tokens: 1120(orimage_min_tokens: 70) is now honoured on every model. An unset budget reaches the runner as 0, "the model's own" (ADR 0048).The problem
api.DefaultOptionsfills the image budget with gemma4's 70/1120, so an unset budget and an explicit 70/1120 reached the runners as the same values. The resolvers for models with other bounds read 70/1120 as "unset" and substituted their own:nemotronImageTokenBudgeton llama.cpp;ResolveImageBudgeton MLX: muse-glimmer, qwen3.5 and nemotron_h.ADR 0016 kept this as "a documented limitation — pick an adjacent value". On muse-glimmer it is no longer harmless, because 1120 is the documented default and so the value a client is most likely to send. Measured on MLX (
30b-nvfp4and30b-mxfp8, 2026-10-11, #463), on a 2048×2048 image:image_max_tokensChanges
server:modelOptionsWithEmbeddingBatchDefaultzeroes each bound that neither the request nor the Modelfile set (hasOption, as it already does fordraft_num_predict).llmandmlxrunner/model: only<= 0counts as unset. Any explicit value is honoured, 70 and 1120 included.IMAGE_*_TOKENSis set.nemotron-dynres-patch.mdnow point to it.Tests
New:
TestModelOptionsImageBudgetUnsetIsZero, and a scheduler row: an explicit 70/1120 on nemotron is a different launch, so it reloads.Rewritten: the tests that asserted the sentinel now assert the explicit value (
TestVisionServerArgs,TestMaxImageTokens,TestResolvedImageTokenBudget,TestResolveImageBudgetKeepsTheModelsOwnCeiling,TestImagePatchBounds).TestSchedNeedsReloadImageTokenBudgetmodels an unset load as the server now sends it.Suites:
go test ./api/... ./llm/... ./server/... ./mlxrunner/... ./model/... ./cmd/...pass, exceptTestTokenizerReference. That test fails on this host onv0.40.2-dynrestoo: it cannot create~/.ollama/models, a symlink to an external volume.End to end: the
image_token_optionssweep on a 2048×2048 card (min=2048on a 448×448 card), on production's release build (0.40.2-dynres-0-g5623192) and on this branch (0.40.2-dynres-1-ge4ef7be). Both ran on :11437 under production's idle gate, 2026-10-12. The figures areprompt_eval_count, as printed.muse-glimmer:30b-nvfp4(MLX)muse-glimmer:30b-nvfp4(MLX)gemma4:12b-nvfp4(MLX, control)gemma4:12b-nvfp4(MLX, control)gemma4:12b-nvfp4(MLX, control)muse-glimmer:30b(GGUF) takes no image flags. Every max arm lands at 4096-4101 image tokens on both builds: this branch's sweep, and the release build's smoke run of 2026-10-11.The README's request-options table (#461) describes glimmer's MLX 1120 behaviour. Whichever of this and #461 merges second updates that cell.
macbook-pro-m5-max-128GB/mlx-metalBehaviour change on nemotron_h_omni (GGUF)
image_max_tokens: 1120orimage_min_tokens: 70did nothing there. The resolver read gemma4's defaults as unset and launched the model's own 256/3328.image_max_tokens: 1120alone launches--image-min-tokens 256 --image-max-tokens 1120;image_min_tokens: 70alone launches 70/3328;nullis unset (hasNonNilOption,328a04812). Before that fix,{"image_max_tokens": null}kept the api default and launched nemotron at 70/1120. The CUDA host reported it.🤖 Generated with Claude Code