Skip to content

chore: bump llama.cpp to b10448 - #33

Merged
leehack merged 1 commit into
mainfrom
automation/bump-llama-cpp
Aug 16, 2026
Merged

chore: bump llama.cpp to b10448#33
leehack merged 1 commit into
mainfrom
automation/bump-llama-cpp

Conversation

@leehack

@leehack leehack commented Aug 14, 2026

Copy link
Copy Markdown
Owner

llama.cpp update

Upstream changelog

Release notes for b10448
Details

model: add Kimi-K3 text model (#26185)

  • model: add Kimi-K3 text model

Hybrid KDA (linear) + MLA (full) attention as in Kimi-Linear-48B, plus five
things that architecture does not have:

  1. cross-layer residual attention (attn_res_block_size)
  2. latent MoE (routed experts run at n_expert_latent)
  3. situ activation (replaces SwiGLU everywhere)
  4. MLA output gate (sigmoid gate before o_proj)
  5. full-rank KDA gate (single ssm_g instead of ssm_g_a/ssm_g_b)

K3's text_config reports KimiLinearForCausalLM - the older 48B architecture -
so get_model_architecture routes on the top-level name instead.

The KDA decay gate has two forms, selected by linear_attn_config's
gate_lower_bound. It is not a clamp: when set it swaps the activation entirely
(fla/ops/kda/gate.py), from -exp(A_log)softplus(x) to
lower_bound
sigmoid(exp(A_log)*x). K3 sets it to -5.0; kimi-linear leaves it
unset, so that path is unchanged.

Cross-layer residuals reuse ggml_dsv4_hc_pre for the weighted sum. That op is
CPU + CUDA only, so Metal/Vulkan will fall back per-node until those kernels
exist.

The routed experts ship as compressed-tensors "mxfp4-pack-quantized". That is
bit-compatible with ggml's MXFP4 - same E2M1 code assignment, same E8M0 scale
byte, only the nibble positions within a block differ - so they are repacked
rather than dequantized, losslessly and without a ~5.5 TB bf16 round-trip.
The repack is built lazily because gguf_writer holds every added tensor until
the final write. DeepSeek-V4 was already doing the identical bit-shuffling, so
it now shares the helper.

Verified against Moonshot's own code path (transformers + fla's Triton KDA
kernels) on a tiny model exercising every K3-specific feature. Final-position
logits vs the fp32 reference: 6.7e-05 rel / corr 1.00000000 for both the
chunked and the recurrent delta-net path. MXFP4 blocks dequantize to the source
weights with 0.0e+00 error.

Assisted-By: Claude Opus 5 (1M context) noreply@anthropic.com

  • model: fix ty errors in the Kimi-K3 converter
  • _res_parts buffers (kind, tensor) pairs, not bare tensors
  • get_tensors must return an Iterator, matching ModelBase
  • LazyBase's func takes one argument, so pass the expert loaders through
    args instead of the closure
  • borrowing KimiLinearModel.set_vocab from an unrelated TextModel is
    deliberate and safe, but not expressible in the signature

No behaviour change: the MXFP4 repack still dequantizes to the source weights
with 0.0e+00 error and end-to-end logits are unchanged (8.386e-03 rel,
corr 0.99996630).

Assisted-By: Claude Opus 5 (1M context) noreply@anthropic.com

  • Update conversion/kimi_k3.py

Co-authored-by: Boris Dvorkin b_dvorkin@niuitmo.ru

  • Increase LLAMA_MAX_EXPERTS from 512 to 1024

  • tests : support for Kimi K3 in archs test

  • chat : add Kimi K3 chat format (reasoning, content, typed tool calls)

K3's assistant output is an XTML-ish tagged format built by the template's
open_tag/close_tag macros. Two properties break generic parsing:

  1. The generation prompt ends with open_tag('think'), so the completion
    starts inside the think section with no opening marker in the output
    (thinking_forced_open).
  2. Only <|open|>/<|close|>/<|sep|>/<|end_of_msg|> are special tokens; tag
    names ("think", "response", "message") are ordinary text tokens.

Adds common_chat_params_init_kimi_k3 (PEG_NATIVE) with detection on the
marker trio, reasoning extraction, response unwrapping, and tool-call
parsing of the tools/call/argument tag structure with argument types
taken from the tool schema. Includes the K3 chat template fixture and 9
test-chat cases derived from real generations of the full 2.8T model.

Verified end-to-end against Kimi-K3-Q2_K (GrEarl/Kimi-K3-GGUF) on 8x B200:
content, reasoning_content, streaming deltas, and tool_calls all correct;
finish_reason stop/tool_calls as appropriate.

Co-Authored-By: Claude Fable 5 noreply@anthropic.com

  • chat : add message_delimiters for Kimi K3

Per-role message-start markers for token-level span splitting. User and
assistant messages carry only the role attribute, so their full opener
(through <|sep|>) is used; system and tool messages continue with more
attributes (type=/tool=/index=), so those delimiters stop after the
role's closing quote. Verified against the K3 tiktoken vocabulary that
the closing quote is always a standalone token across all attribute
variants, so the token-level prefix match stays exact.

Co-Authored-By: Claude Fable 5 noreply@anthropic.com

  • fix: apply nits from @ngxson and text fixes from @danielhanchen

  • tests : added missing hyperparameters and tensors for Kimi K3 in test-llama-archs

  • chore : move overly verbose header file comments to Kimi K3 source file

  • tests : re-enabled KIMI_K3 in test-llama-archs for WebGPU backend

  • model-saver : emit kda_gate_lower_bound for Kimi K3

Quick fix. The Kimi K3 loader reads kda_gate_lower_bound and gates a graph branch on it (it scales the KDA gate when the bound is above -INFINITY), but the model
saver never wrote the key, so a save->load roundtrip silently dropped it back to the -INFINITY default and changed the model's output. The real K3 config sets gate_lower_bound = -5.0.

I propose to emit it from the saver, and set it to -5.0 in the test-llama-archs K3 case so the roundtrip check exercises it (the roundtrip fails without the saver line).

  • Refactor conditional for model architecture check

  • tests : re-enabled (again) KIMI_K3 and MINIMAX_M3 in test-llama-archs for WebGPU backend

  • fix code comments

  • add template on conversion

  • move repack_mxfp4_blocks to model base

  • nits

  • add_value_length

  • optimize res_stack construction

  • nits


Co-authored-by: Boris Dvorkin b_dvorkin@niuitmo.ru
Co-authored-by: Stanisław Szymczyk sszymczy@gmail.com
Co-authored-by: Deepankar Singh singh.deepankar39@gmail.com
Co-authored-by: Claude Fable 5 noreply@anthropic.com
Co-authored-by: Caleb DeLeeuw caleb.deleeuw@gmail.com
Co-authored-by: Xuan Son Nguyen son@huggingface.co

Website:

macOS/iOS:

Linux:

Android:

Windows:

openEuler:

  • DISABLED
  • openEuler x86 (310p)
  • openEuler x86 (910b, ACL Graph)
  • openEuler aarch64 (310p)
  • openEuler aarch64 (910b, ACL Graph)

UI:

Commit range

Commits from b10375 to b10448 (first 80)
  • spec : update speculative-simple (#26904) (f785fc9)
  • cuda : add warp-per-row wkv7 kernel for single-token decode (#26111) (5988633)
  • CUDA: only disable CUDA graphs when mul_mat_id actually needs a stream sync (#26802) (ebb546b)
  • ci : add missing release check (#26923) (7b13a84)
  • chat : fix muse-glimmer detection of tool calls after EOM (#26879) (0b1bad1)
  • opencl: use flat mv q5_k when weight exceeds image1d_buffer_t limit (#26880) (cb27fe9)
  • convert : handle per_layer_config in Gemma4 (transformers 5.15) (#26882) (6eff593)
  • wavtokenizer-dec : bound posnet/convnext block_count against n_layer_all (#26892) (55f453b)
  • vulkan: add TQ2_0 (ternary) support (#25850) (a7cd2f0)
  • tests : update speculative params (#26925) (a4a4c51)
  • opencl: default FA c8 cluster width to 16 on X1E (#26433) (89e0aa6)
  • ui: add read_media tool (#25877) (4dd1275)
  • server : support slot save/restore with media inputs (#26640) (5d9e5ac)
  • cmake : add config version support (ggml/1582) (13fd0bb)
  • sync : ggml (af05a42)
  • model : disallow integer dflash sliding_window_pattern (#26900) (ece98b8)
  • kleidiai: Add runtime feature detection mechanism for aarch64/kleidiai (#26076) (132753b)
  • gguf : harden loader against malformed tensor dims and metadata types (#25596) (d8a8bea)
  • cmake : introduce semantic versioning (#26839) (680a9ae)
  • disable rocm cache (#26962) (7a9ff95)
  • ci : disable ubuntu-rocm (#26969) (9558fa4)
  • ci: fix thread sanitizer + remove ccache (#26927) (84e908c)
  • common: add system-level config file (#26118) (8e7f22b)
  • ui: Constants refactor (#26908) (e21152d)
  • ggml : fix arm builds, unused var (#26991) (1f368f3)
  • refactor: Clean up UI types (#26909) (a6040c9)
  • ui: Stores architecture improvements (#26910) (094e53d)
  • ui: Move styles/ to $lib scope (#26950) (f2efd64)
  • ui: Clean up contexts, remove prop drilling from Chat Form Actions (#26951) (d86c7d6)
  • ggml-hip : remove -funsafe-math-optimizations (#26696) (e79e4bf)
  • server: refactor + correctness fixes for metrics (#26920) (decaf50)
  • sycl : enhance concat to support Q4_0, Q4_1, Q5_0, Q5_1, Q8_0 (#26800) (d415e65)
  • sycl : Add DMMV ESIMD Q3_K kernel (#26251) (8efbf65)
  • sycl: fuse UNARY(silu|sigmoid|softplus) + MUL (#26411) (1ee1cd9)
  • sycl: remove separate fp32 type promotion in gemm non-oneDNN path (#26372) (154d57a)
  • ggml-cpu/ops: vectorize flash-attention V-cache F16 to F32 conversion (#26947) (eeae28b)
  • spec: enable backend sampling for both dflash & dspark (#26958) (0d0bfcd)
  • common : auto-detect spec type from draft GGUF metadata (#26814) (f65e568)
  • metal : add TQ2_0 support (#26980) (4a84b0a)
  • spec : auto-detect mtp draft model type (#27005) (1d2869c)
  • server : serve index.html with no-cache (#27006) (981184e)
  • chat : fix LFM2 tool call arg name prefix ambiguity (#26960) (2606220)
  • [SYCL] Support host pinned mem to improve SYCL Host-to-Device Memory Access (#26789) (a97123e)
  • OpenVINO: Qwen3.5, memory optimization, and test-recurrent-state-rollback (#26952) (aee56b3)
  • ui: fix VITE_PUBLIC_SERVER variable reading (#24845) (9c5531e)
  • refactor: Naming (#27001) (fa4ec45)
  • ui: Refactor data-attrs constants, enum for bool strings (#27002) (bdffafa)
  • common: apply CPU parameters across tools (#27026) (a94d563)
  • dflash : clarify output logging of target_layer_ids (#27013) (2bacf9e)
  • sycl: fuse the gated-delta-net state writeback cpy (#26643) (3d93885)
  • ggml: force single thread on wasi (#25686) (c6f6a92)
  • sycl: fuse mul_mat(gate) + mul_mat(up) + GLU for q4_K dense FFN (#26779) (6509138)
  • tests : replace personal home directory paths with generic placeholders (#27043) (885c5bb)
  • server: allow accessing /metrics and /slots during llama_decode() (#27041) (77918ca)
  • llama : allow virtual igpu devices (#26953) (4c1a0af)
  • ggml : recurrent state rollback for ggml_ssm_scan (#26623) (1692f9e)
  • ggml : bump version to 0.20.0 (ggml/1584) (06ae232)
  • sync : ggml (9b05354)
  • chat : pass reasoning_effort to template (7e4c0a9)
  • jinja : fix quadratic cost in gather_string_parts (#27034) (9e40df6)
  • mtmd, common: various fixes (#27071) (6fed9f6)
  • model : add support for MiniMaxText01ForCausalLM and MiniMaxM1ForCausalLM (#27018) (16d222f)
  • mtmd: fix Granite4 Vision image sequence assembly (#26653) (9d57ce4)
  • Fixed gating logic for problematic Intel driver version (7b38cb7)
  • fixed indent (6b4344e)
  • common: migrate the deprecated --mmap/--no-mmap to --load-mode (#26934) (0177dcc)
  • vulkan: add SHMEM_STRIDE_PAD/APPLY_SLM_A_RESHAPE for coopmat1 on Intel Xe (#25380) (9b0a2ce)
  • fix: check gguf array type before reading (#27075) (27df919)
  • common: support --models-dir loading MTP assistant models (#24431) (5f754ea)
  • vendor : update cpp-httplib to 0.53.1 (#27103) (77140d2)
  • vendor: update BoringSSL to 0.20260813.0 (#27099) (adb55e5)
  • server: re-design yield_to_queue thread model (#27133) (22b8e31)
  • model: add Kimi-K3 text model (#26185) (ad1de39)

Web bridge review focus

Please pay extra attention to upstream changes touching:

  • WebGPU, WASM, Emscripten, pthreads, or memory64 build behavior
  • ggml backend APIs used by the bridge
  • model loading, tokenizer, chat template, context/state persistence, or cache semantics
  • CMake/build flags that can affect the generated JS/WASM artifacts

Validation

  • Emscripten build passed
  • Browser WebGPU/state-persistence smoke passed
  • Generated bridge artifacts include wasm32 and memory64 outputs
  • No stale hard-coded llama.cpp tag remains in CI/publish defaults

Automation behavior

This PR is managed from the stable branch automation/bump-llama-cpp. If another llama.cpp release appears before merge, the scheduled workflow updates this same PR instead of opening a duplicate. The workflow skips if a non-automation PR already changes llama_cpp.version.

Copilot AI lite review requested due to automatic review settings August 14, 2026 05:12

Copilot AI 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.

Pull request overview

Updates the pinned upstream ggml-org/llama.cpp version used by this repository’s WebGPU/WASM bridge builds, moving the dependency baseline forward to the b10423 release.

Changes:

  • Bump llama_cpp.version from b10375 to b10423.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@leehack leehack changed the title chore: bump llama.cpp to b10423 chore: bump llama.cpp to b10435 Aug 15, 2026
@leehack
leehack force-pushed the automation/bump-llama-cpp branch from a6feda5 to d6435b0 Compare August 15, 2026 03:58
@leehack leehack changed the title chore: bump llama.cpp to b10435 chore: bump llama.cpp to b10448 Aug 16, 2026
@leehack
leehack force-pushed the automation/bump-llama-cpp branch from d6435b0 to 6396f98 Compare August 16, 2026 04:06
@leehack
leehack merged commit 8d815a7 into main Aug 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants