Skip to content

inkling : pin branch for the Inkling 1 support (ggml-org#25731 at f5e241b) - #371

Closed
danielhanchen wants to merge 74 commits into
base/upstream-0d69255c5from
pin/inkling1
Closed

danielhanchen wants to merge 74 commits into
base/upstream-0d69255c5from
pin/inkling1

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Pin branch for the Inkling 1 support used by the prebuilt pin set.

ggml-org#25731 is now squashed and merged with current master, so its head no longer merges onto the aged release tags the nightly builds from. This branch keeps the Inkling 1 commit the pin set has been verified with, f5e241b (the dde9707 lineage plus the comment trim), as a commit of a PR so pr-set.json can point at it.

danielhanchen and others added 30 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
# Conflicts:
#	ggml/include/ggml-rpc.h
#	ggml/src/ggml-backend-meta.cpp
#	ggml/src/ggml-cuda/ggml-cuda.cu
#	src/llama-model-saver.cpp
#	tests/test-llama-archs.cpp
# Conflicts:
#	ggml/src/ggml-rpc/ggml-rpc.cpp
Resolves the two conflicts left by upstream ggml-org#27764 (chat parsers split into
common/parsers) and ggml-org#26675 (ggml_prec rework):

- common_chat_params_init_inkling moves to common/parsers/inkling.cpp,
  registered in parsers.h and sources.cmake; chat.cpp keeps only the
  template detection branch.
- GGML_PREC_F32_PEDANTIC joins the new ranked ggml_prec scale at 5, below
  GGML_PREC_F32, since it is the stricter contract; ggml_flash_attn_ext_banded
  keeps its declaration next to the flash attention API.
…C_F32_PEDANTIC

Every caller of the deprecated ggml_mul_mat_set_prec /
ggml_flash_attn_ext_set_prec now uses ggml_prec_set_acc (the macOS prebuilt
leg builds with LLAMA_FATAL_WARNINGS, so the deprecation would be fatal
there), and ggml_prec_set_acc accepts GGML_OP_FLASH_ATTN_EXT_BANDED.

With the enum ranked, the CUDA cuBLAS compute-type gate and the CPU, spacemit
and Vulkan flash-attention accumulator checks compare by rank instead of
equality with GGML_PREC_F32, so a pedantic request never falls through to a
lower-precision path. The CUDA mul_mat_id slice carries the acc and src
precision slots, and ggml_cuda_mul_mat_id_needs_sync applies the same
pedantic gate as ggml_cuda_mul_mat_id so a pedantic F32 expert matmul cannot
trip its assertion.
Resolves the conflicts with upstream ggml-org#29535 (K2 Horizon) and ggml-org#29442
(cuBLAS ldc and F16/BF16 src0 chunking):

- Inkling and K2 Horizon both register: parser decl, parser source,
  model mapping case, EOG token, output tensor name. model.unembed
  moves a few lines up the OUTPUT tuple, away from upstream's
  embedding_projection, so pins that carry that line still merge.
- LLAMA_VOCAB_PRE_TYPE_INKLING moves to 62, since upstream claimed 61
  for K2_HORIZON. The id is internal; the GGUF carries
  tokenizer.ggml.pre as a string.
- ggml_cuda_mul_mat_cublas_impl keeps the F32_PEDANTIC GemmEx path and
  passes upstream's ldc to both F32 branches; the pedantic compute-type
  override stays ahead of upstream's F16/BF16 src0 chunking, which it
  cannot overlap (pedantic only applies to F32 src0).
# Conflicts:
#	common/chat-peg-parser.cpp
#	tools/mtmd/clip.cpp
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T08:22:24.484010Z f5e241b PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen

Copy link
Copy Markdown
Member Author

Superseded: the pin set now pins Inkling through ggml-org#32187 (#370).

@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: f5e241b64d

ℹ️ 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 on lines +103 to +105
});

return data;

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 Generate sampling grammar for Inkling tool constraints

For Inkling requests with tool_choice: "required", this initializer returns an empty data.grammar and no grammar triggers. Building tool_section only creates the response parser; it does not constrain sampling. Consequently, common_chat_session::apply_sampling() installs no tool grammar, leaving the model free to generate plain text or invalid arguments despite the required-tool setting. A focused common_chat_templates_apply() probe confirms that the required-tool grammar is empty. Generate the sampling grammar and appropriate triggers from the parser, as the other specialized handlers do.

Useful? React with 👍 / 👎.

Comment on lines +66 to +69
auto text_block = p.optional(p.literal(MSG_MODEL)) +
p.optional(p.literal(TEXT)) +
p.content(p.until_one_of({ THINK, END_MESSAGE, END_SAMPLING })) +
p.optional(p.literal(END_MESSAGE));

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 Incorporate response schemas into the Inkling text branch

When a client requests response_format: json_object or json_schema, the schema reaches this handler through inputs.json_schema, but the handler never reads it and always treats the text body as unrestricted content. The specialized handler also bypasses the automatic parser that would normally incorporate the schema. A session initialized with an object schema currently returns an empty grammar and accepts not JSON as its response content. Add a schema-aware text branch and generate its sampling grammar so structured-output requests enforce the requested format.

Useful? React with 👍 / 👎.

oobabooga pushed a commit to oobabooga/llama.cpp that referenced this pull request Nov 19, 2026
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