Skip to content

Carry ggml-org#25731 (TML Inkling) merged onto b10369 - #99

Closed
danielhanchen wants to merge 14 commits into
inkling-25731-upstream-basefrom
inkling-25731-b10369
Closed

Carry ggml-org#25731 (TML Inkling) merged onto b10369#99
danielhanchen wants to merge 14 commits into
inkling-25731-upstream-basefrom
inkling-25731-b10369

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

scripts/unsloth/pr-set.json pins ggml-org/llama.cpp#25731 (TML Inkling) at 0a9841fa63. That pin stopped merging when the aged base moved to b10369, which landed mtmd: support pocket-tts (#26871). Both PRs touch the same two mtmd files, so the nightly prebuild aborts on the merge and every arch in the mix is lost, not just Inkling.

Preflight run: https://github.com/unslothai/llama.cpp/actions/runs/31593981533

This branch is 0a9841fa63 with b10369 merged into it and the two conflicts resolved by hand, so the pin set merges again. It carries no changes of my own beyond the resolution.

The conflicts

tools/mtmd/clip.cpp, in has_standard_layers. This is an and-chain of "the projector is not X". Inkling adds PROJECTOR_TYPE_INKLING, pocket-tts adds PROJECTOR_TYPE_POCKETTTS_GEN. Resolved to the union of all four terms, so each side still excludes exactly what it meant to exclude:

const bool has_standard_layers = (
    model.proj_type != PROJECTOR_TYPE_GEMMA3NV &&
    model.proj_type != PROJECTOR_TYPE_INKLING &&
    model.proj_type != PROJECTOR_TYPE_QWEN3TTS_SPKENC &&
    model.proj_type != PROJECTOR_TYPE_POCKETTTS_GEN);

tools/mtmd/clip-model.h. The merge base for this hunk is empty: both sides only append new struct definitions at the same point. Inkling adds inkling_hmlp_layer, pocket-tts adds clip_seanet and clip_flow_net. Kept all three. additive_merge.py refuses this one and is right to, since each side also touched the shared closing brace, so it cannot prove the hunk is a pure addition.

Checks

  • No conflict markers remain, and inkling_hmlp_layer, clip_seanet and clip_flow_net are each defined exactly once.
  • PROJECTOR_TYPE_INKLING and PROJECTOR_TYPE_POCKETTTS_GEN are both still declared and still mapped in clip-impl.h.
  • Builds clean: llama-server, llama-mtmd-cli and test-sampling at -DCMAKE_BUILD_TYPE=Release -DGGML_NATIVE=ON -DLLAMA_BUILD_TESTS=ON, with no warnings from either resolved file.
  • Full pin set replayed onto b10369 in pr-set.json order with this commit substituted for the old pin: #24423 clean, this branch clean, #70 additive, #91 clean, #95 clean.

The base branch is b10369 itself, so the diff here is only the Inkling work, matching the arrangement used by #70 and #91.

Once ggml-org#25731 is rebased upstream, or a base tag carries it, the pin should move back to the upstream commit and this branch can be deleted.

danielhanchen and others added 14 commits July 18, 2026 08:09
Hybrid attention model: 55 sliding-window plus 11 global layers, banded
content-dependent relative position bias instead of RoPE, per-layer short
convolution state, fine-grained MoE (256 experts top-6 plus 2 shared),
attention log-scaling past 128K, 1M context.

Includes the GGML_OP_FLASH_ATTN_EXT_BANDED operator (CPU and CUDA, fused
into the MMA flash attention kernel with an fp16 accumulator overflow
guard), HF to GGUF conversion, chat template with typed content block
parsing (interleaved thinking, narration and tool calls), mmproj vision
and audio support, and backend op tests at production shapes.
# Conflicts:
#	ggml/src/ggml-cuda/mmq.cuh
#	src/llama-model-saver.cpp
#	src/llama-vocab.h
Upstream 910196f renamed common_chat_params::thinking_end_tag to
thinking_end_tags and changed it from std::string to a vector, so
data.thinking_end_tag = END_MESSAGE no longer compiles.
# Conflicts:
#	src/llama-arch.cpp
ggml-org#25731 stopped merging when b10369 landed pocket-tts (ggml-org#26871), which
touched the same two mtmd files. Both conflicts are unions:

  clip-model.h: empty merge base, each side only appends structs. Kept the
  inkling hmlp layer and the pocket-tts seanet/flow-net blocks.

  clip.cpp: has_standard_layers is an and-chain of "proj_type is not X". The
  PR adds INKLING, upstream adds POCKETTTS_GEN. Kept both terms, so each side
  still excludes what it meant to exclude.

additive_merge.py refuses both, correctly: each side also touched the shared
closing line, so it cannot prove they are pure additions.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8e3420dd68

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/mtmd/mtmd-image.cpp
Comment on lines +645 to +647
mtmd_inkling_image_preproc_out mtmd_image_preprocess_inkling(
const clip_image_u8 & img,
resize_algo algo) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove the unused Inkling preprocessing API

A repo-wide search finds mtmd_image_preprocess_inkling only in this definition and its header declaration; the runtime instead constructs mtmd_image_preprocessor_inkling in mtmd.cpp and calls the separate implementation near line 1001. Keeping this second approximately 80-line preprocessing path and result type creates two subtly different implementations that can drift without affecting tests or production, so remove it and retain the existing preprocessor class.

AGENTS.md reference: AGENTS.md:L80-L82

Useful? React with 👍 / 👎.

Comment thread conversion/inkling.py
Comment on lines +110 to +113
eos_id = int(self.hparams.get("eos_token_id", 200006))
if eos_id < 199998:
# HF-port configs re-save generic bos/eos defaults; the real EOS lives at 199998+
eos_id = 200006

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Pin Inkling EOS to the end-sampling token

When a re-saved config supplies a high-valued but incorrect eos_token_id, such as 200010 for <|end_message|>, this condition accepts it unchanged even though the code immediately below documents 200006 as the sole end-of-generation token. The vocabulary loader also recognizes <|content_model_end_sampling|> as EOG, so such a conversion makes both markers stop generation; a response can then terminate at the first block separator, for example after its thinking block and before its visible answer. Validate or force the configured ID to the actual end-sampling token rather than accepting every ID above 199997.

Useful? React with 👍 / 👎.

Comment thread ggml/include/ggml.h
GGML_OP_FILL,

GGML_OP_FLASH_ATTN_EXT,
GGML_OP_FLASH_ATTN_EXT_BANDED,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve RPC op numbers when adding banded attention

Inserting this value in the middle of ggml_op renumbers FLASH_ATTN_BACK, SSM_CONV, and every later operation serialized through rpc_tensor.op. The RPC handshake accepts peers with the same major/minor regardless of patch version, so a new client connected to a 5.0.0 server, or an old client connected to this server, completes negotiation and then has these operations decoded as the wrong enum values. Append the new operation without shifting existing wire values, or make the protocol negotiation reject this incompatible enum layout.

Useful? React with 👍 / 👎.

@danielhanchen

Copy link
Copy Markdown
Member Author

Not needed. I resolved the conflicts on ggml-org#25731 itself, so #100 repins straight to the upstream commit instead of carrying a copy here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants