Skip to content

mtmd : fix Muse Glimmer vision embedding order - #32433

Merged
ngxson merged 1 commit into
ggml-org:masterfrom
sid-rp:glimmer-legacy-pos-emb
Nov 16, 2026
Merged

ngxson merged 1 commit into
ggml-org:masterfrom
sid-rp:glimmer-legacy-pos-emb

Conversation

@sid-rp

@sid-rp sid-rp commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Overview

Muse Glimmer's vision encoder resizes the learned position-embedding grid in (h, w) order, but the model was trained with h and w swapped. should use pos embedding xy instead of ij. This was missed in the port.
The fix resizes with height and width swapped. Square images are unchanged. Muse Spark Open's vision goes through the same graph, so this fixes it too. Its HF/vLLM/SGLang implementations already use the swapped order.

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES - Used AI to find the code, fix it, run tests and compare against references

@sid-rp
sid-rp requested a review from a team as a code owner November 16, 2026 20:12
@github-actions github-actions Bot added the mtmd Related to multimodal functionality (video/image/audio) label Nov 16, 2026
@ngxson

This comment was marked as outdated.

@ngxson

ngxson commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

closing until we have a truth source of info here

@ngxson ngxson closed this Nov 16, 2026
@ngxson ngxson reopened this Nov 16, 2026
@ngxson

ngxson commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

for visibility: confirmed from meta team

@ngxson
ngxson merged commit 9581154 into ggml-org:master Nov 16, 2026
23 of 32 checks passed
bahooo22 added a commit to bahooo22/llama.cpp that referenced this pull request Nov 16, 2026
Витрина форка обязана идти поверх актуального апстрима, но эта дельта не меняет ни одного
байта в наших бинарниках: мастер не является входом сборки. build_kit.ps1 берёт llama-ногу
из llama-kit (-S $src, строка 1147), а ggml для Страты - из пина llama-3cf
(-DSTRATA_GGML_DIR, строка 1108); в CMakeCache прошлого цикла CMAKE_HOME_DIRECTORY равен
.../llama-kit и .../engine. Поэтому мержим и пушим, а пересборку не делаем: она дала бы те
же самые байты и только заняла бы окно у сетки.

Что изменено?
- tools/mtmd (+1326/-13, 15 файлов): поддержка YuE2-3B из ggml-org#32369 (mtmd-helper-gen.cpp
  +690/-5, mtmd.cpp +330, models/yue2-gen.cpp +89) и порядок vision-эмбеддингов Muse Glimmer
  из ggml-org#32433 (models/muse-glimmer.cpp +9/-1). Нога у нас не компилируется: LLAMA_BUILD_MTMD=OFF.
- common/parsers и common/chat.cpp (+175/-54, 5 файлов): парсер inkling из ggml-org#32381 -
  inkling.cpp +165 вместо удалённого inkling2.cpp (-46), реестр в parsers.h и sources.cmake.
- tools/server (+25/-9, 3 файла): схема и контекст под новые mtmd-модели, README.
- conversion и gguf-py (+244/-1, 5 файлов): yue2.py +234, granite.py учитывает
  max_position_embeddings (ggml-org#32436), inkling2.py (ggml-org#32430).
- models/templates (+259, 2 файла): jinja-шаблоны Inkling и Inkling-2-Small.
- tests (+99, 2 файла): test-chat.cpp под новый парсер, печать исключения в test-runner.cpp.
- ggml/src/ggml-opencl (+112/-1): ядро A7 Q4_K non-MoE и фиксы bin flash-attention prefill
  (ggml-org#30948, ggml-org#32110); у нас GGML_OPENCL=OFF.
- src/llama-grammar.cpp (+2), tools/tts (+6/-2, 2 файла), docs/multimodal/tts.md (+48),
  skills/code-review/SKILL.md (+5).
- всего: 38 файлов, +2301/-80, бинарных нет (git diff --cached --numstat).

Зачем?
Держать форк-витрину на актуальной базе апстрима, чтобы следующий синк комплекта (перелиновка
kit-all-sync) решался по замеру, а не по накопившемуся отставанию. Заодно зафиксировано, что
наш CUDA-путь от этого мержа не зависит: из дельты в компилируемых путях только common/ и
src/llama-grammar.cpp, а мастер в сборку не входит вовсе.

Замеры?
- merge-tree refs/heads/master + refs/remotes/origin/master (9581154): rc=0, конфликтных
  путей 0, предсказанное дерево d7b1ac7 - мерж начат только после этого гейта.
- git merge --no-commit --no-ff: rc=0, «Automatic merge went well»; неразрешённых файлов 0.
- git diff --cached --numstat: 38 записей, +2301/-80, бинарных 0 (E:/tmp/sync3_numstat.txt,
  цифровые группы выше взяты из него же, не из памяти).
- база мержа 4303cd9; до мержа master == fork/master == 77802f1, status --porcelain пуст.
- страховка refs/tags/backup/llama-master-pre-sync3-2026-11-17 = 77802f1, только локально.
- стенд на момент мержа: планировщиков 0, python-носителей 0, движков 0, compute-процессов на
  карте 0 (носитель wait_captures_drain_2026-11-17.ps1 -Check в 02:34); компиляции не было.
- leakcheck --prose по этому файлу - последний вызов перед commit -F тем же носителем; при
  находках или rc=2 коммит не делается.

Принятый остаток?
- Пересборка комплекта и перелиновка kit-all-sync (29 файлов в компилируемых путях, 0
  конфликтов в них, 8 конфликтов вне сборки в .github/workflows) - отдельное окно со сборкой;
  живые серверы остаются на sync1636, build-dir.txt не тронут.
- Сетка: закрыто 38 клеток из 50, 7 cliff и 5 дыр на llama-ноге (мера grid16_gap по обоим
  дневным журналам) - их добирают очереди съёмки, а не этот коммит.
- За пользователем: CI-аппрувы и описания PR; пуш master сделан этим прогоном по явному
  разрешению «push слияний - пуш разрешаю».

Итог
Витрина догнала апстрим, не коснувшись бинарников. Точное значение дерева сверяется с
предсказанием merge-tree в том же прогоне носителя, а приёмка пуша - по полному хешу из
ls-remote, так что «мерж чистый» остаётся проверенным фактом, а не обещанием.

---

EN: sync: llama master took 9 upstream commits, no rebuild

The fork showcase has to sit on top of current upstream, yet this delta does not change a
single byte of our binaries: master is not a build input. build_kit.ps1 takes the llama leg
from llama-kit (-S $src, line 1147) and the ggml for Strata from the pinned llama-3cf
(-DSTRATA_GGML_DIR, line 1108); last cycle's CMakeCache reports CMAKE_HOME_DIRECTORY as
.../llama-kit and .../engine. So we merge and push, and skip the rebuild - it would produce
the same bytes while stealing the window from the grid.

What changed?
- tools/mtmd (+1326/-13, 15 files): YuE2-3B support from ggml-org#32369 (mtmd-helper-gen.cpp
  +690/-5, mtmd.cpp +330, models/yue2-gen.cpp +89) and Muse Glimmer vision embedding order
  from ggml-org#32433 (models/muse-glimmer.cpp +9/-1). We do not compile this leg: LLAMA_BUILD_MTMD=OFF.
- common/parsers and common/chat.cpp (+175/-54, 5 files): inkling parser from ggml-org#32381 -
  inkling.cpp +165 replacing the deleted inkling2.cpp (-46), registry in parsers.h and
  sources.cmake.
- tools/server (+25/-9, 3 files): schema and context for the new mtmd models, README.
- conversion and gguf-py (+244/-1, 5 files): yue2.py +234, granite.py honours
  max_position_embeddings (ggml-org#32436), inkling2.py (ggml-org#32430).
- models/templates (+259, 2 files): jinja templates for Inkling and Inkling-2-Small.
- tests (+99, 2 files): test-chat.cpp for the new parser, exception message in test-runner.cpp.
- ggml/src/ggml-opencl (+112/-1): A7 Q4_K non-MoE kernel and the bin flash-attention prefill
  fixes (ggml-org#30948, ggml-org#32110); we build with GGML_OPENCL=OFF.
- src/llama-grammar.cpp (+2), tools/tts (+6/-2, 2 files), docs/multimodal/tts.md (+48),
  skills/code-review/SKILL.md (+5).
- total: 38 files, +2301/-80, no binary files (git diff --cached --numstat).

Why?
Keep the fork showcase on a current upstream base so that the next kit sync (relining
kit-all-sync) is decided by measurement rather than by accumulated lag. This also records
that our CUDA path does not depend on the merge: within the delta only common/ and
src/llama-grammar.cpp live in compiled paths, and master is not a build input at all.

Verified?
- merge-tree refs/heads/master + refs/remotes/origin/master (9581154): rc=0, zero
  conflicting paths, predicted tree d7b1ac7 - the merge started only after this gate.
- git merge --no-commit --no-ff: rc=0, "Automatic merge went well"; zero unresolved files.
- git diff --cached --numstat: 38 entries, +2301/-80, 0 binary
  (E:/tmp/sync3_numstat.txt - every number group above comes from it, not from memory).
- merge base 4303cd9; before the merge master == fork/master == 77802f1, status clean.
- safety ref refs/tags/backup/llama-master-pre-sync3-2026-11-17 = 77802f1, local only.
- stand at merge time: 0 queue schedulers, 0 python carriers, 0 engines, 0 compute processes
  on the GPU (wait_captures_drain_2026-11-17.ps1 -Check at 02:34); nothing was compiled.
- leakcheck --prose on this file is the last call before commit -F in the same carrier; on
  findings or rc=2 the commit does not happen.

Accepted remainder?
- Kit rebuild and relining kit-all-sync (29 files in compiled paths, 0 conflicts there, 8
  conflicts outside the build in .github/workflows) - a separate window with a build; live
  servers stay on sync1636 and build-dir.txt is untouched.
- Grid: 38 of 50 cells closed, 7 cliffs and 5 holes on the llama leg (grid16_gap over both
  daily journals) - capture queues close those, not this commit.
- Up to the user: CI approvals and PR descriptions; the master push was performed by this
  run under the explicit permission "merges may be pushed".

Result
The showcase caught up with upstream without touching the binaries. The resulting tree is
compared byte-exactly against the merge-tree prediction in the same carrier run, and the
push is accepted via a full hash from ls-remote, so "the merge is clean" stays a measured
fact rather than a promise.
fencerJP pushed a commit to fencerJP/llama-apu that referenced this pull request Nov 21, 2026
Annieren pushed a commit to Annieren/llama.cpp-upstream that referenced this pull request Nov 23, 2026
Nindaleth pushed a commit to Nindaleth/llama.cpp that referenced this pull request Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mtmd Related to multimodal functionality (video/image/audio)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants