compat 906: carry upstream's revert of prop.integrated on HIP — fixes the gfx1151 vision regression - #317
Merged
Conversation
b10864 switched these projectors from bilinear to bicubic in the same hunk that raised gemma4's ceiling from (40,280) to (70,1120), and separately deleted the naive resamplers so every algo now routes through the Pillow-parity path. Measured on gfx1151, gemma4:31b-it-q4_K_M, budget pinned with run_budget_sweep.sh, name_bbox_mean_iou: at 280 and 560 the two builds agree (0.612/0.691, 0.713/0.714), at 1120 it goes 0.728 -> 0.000. prompt_eval_count is identical between builds on every test, so the grid and token count are unchanged and only the pixels differ. 1120 is the only rung that enlarges a 1920x1080 source. Changes the resampler ONLY, leaving (70,1120) alone, so a re-run at 1120 isolates it. Verified: the full series 001/002/004/005/801/903/905 applies to a clean b10864 with plain git apply. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Upstream PR #28604 (d4389a4dd92) reverts c7d8722922a (#24233). Our payload b10864 is 5d806aa25 at 2026-09-08T13:01:03Z; the revert landed at 14:19:53Z the same day, so v0.34.1 carries the defect and not the fix -- we missed it by 78 minutes. Upstream #28211 root-causes it on gfx115x as an MMQ tile-barrier race that produces wrong output with no crash once a decode exceeds n_ubatch, and #27419 reports our exact symptom on our exact silicon: upper image content lost on HIP while Vulkan and CPU are correct. Measured here on gemma4:31b with the budget pinned, name_bbox_mean_iou is 0.728 -> 0.000 at the 1120 rung only; 280 and 560 are equivalent between builds. prompt_eval_count is identical, so the pixels reaching the model are unchanged. Replaces 905, which reverted the b10864 resize-algo flip and is dropped: it was built, verified present in-binary by output-hash diff, and did not fix anything. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Sep 18, 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.
Fixes the vision regression that made ollama 0.34.x unusable on gfx1151, by carrying an upstream revert that landed 78 minutes after our payload was cut.
The defect
Upstream
c7d8722922a(llama.cpp#24233) setinfo.devices[id].integrated = prop.integratedon HIP builds. On an integrated/UMA device that changes which buffer types the backend claims, and llama.cpp#28211 root-causes the consequence as an MMQ tile-barrier race on gfx115x producing wrong output with no crash and no warning, once a decode exceedsn_ubatch.Upstream reverted it in #28604, merged 2026-09-08T14:19:53Z. Our payload b10864 is
5d806aa25, 2026-09-08T13:01:03Z. We are on the wrong side of it by 78 minutes.Two independent upstream reports describe our exact symptom on our exact silicon: #27419 ("upper image content is lost while Vulkan/CPU are correct" — Ryzen AI Max+ 395 / Radeon 8060S / gfx1151 / Qwen3.8-27B) and #28211.
Before and after
Five-model campaign against the 2026-09-17 baseline (#303), same runner, same digests, same environment, one power envelope. Scene bbox IoU:
qwen3.8:27b-q4_K_Mgemma4:31b-it-q4_K_Mnemotron3:33b-q4_K_Mqwen3.6:35b-a3b-q4_k_mgemma4:26b-a4b-it-q4_K_MAll five return to 6/6 · 6/6 · 6/6 boxes/labels/colours and 5/5 · 5/5 · ✅ invoice extraction. Unpatched 0.34.1 scored 0/5 on invoice for three of them.
This satisfies gate clause 4 —
qwen35moe(qwen3.6:35b-a3b) shows 0 degenerate and scores above the baseline.Why it tracked the image-token budget
gemma4:31b, budget pinned per cell withrun_budget_sweep.sh,name_bbox_mean_iou:1120 image tokens push the decode past
n_ubatch; 280 and 560 do not. Since the fork pins--image-max-tokens 1120on every gemma4 launch (#309), every gemma4 vision request on an unpatched 0.34.x build was hitting the broken path.Refuted along the way, each by experiment
Recorded so nobody re-runs them:
GGML_CUDA_CUBLAS_COMPUTE_TYPEf32 / f16 / unset all equally broken, env var verified to reach thellama-serverprocessnum_batch 2048the image decodes in a singledecoding image batch 1/1, n_tokens_batch = 2040, still brokenprompt_eval/eval, fixed nothing. That patch (905) is dropped in this branch rather than left as dead weight.GGML_CUDA_NO_PINNED=1— not a workaround; the runner aborts on load (signal: aborted, core dumped)ollama/ollama:0.34.1-rocmreproduces the regression identicallyprompt_eval_countis identical between builds at every budget rung, so preprocessing and token counts never moved — the corruption is downstream of the image path entirely.Verification
Full series
001/002/004/005/801/903/906applies to a clean b10864 with plaingit apply, and the outcome is checked rather than just the exit code: after applying,grep 'integrated = prop.integrated'returns nothing. Build is 2m38s on the ccache mount.Caveats
gemma4:31bname_bboxreturns to 0.663–0.72 against the baseline's 0.728 — restored, but repeats would be good, especially given the known run-to-run spread on 0.34.x (docs(vision): SOLVED — the 0.34.0 gemma4 vision shift is upstream MLX #3912 #310).qwen3.8multi-image losesq4_bbox_hitwhere the baseline had it; the anchored variant passes. One cell, unrepeated.d4389a4dd92.Cross-platform verification requested in #313 — in particular whether this defect class reaches CUDA unified-memory devices, which bears on gate issue ollama#17475.
🤖 Generated with Claude Code
Recreated from #314, which GitHub closed when the head branch was renamed from
fix/restore-bilinear-resize(a leftover from a refuted hypothesis) tofix/hip-integrated-flag-906. Same commits, same content; #314 carries the earlier discussion.