]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/log
pkg/ggml/sources/llama.cpp
5 weeks agovendor : apply patches for subprocess.h (#26606)
Xuan-Son Nguyen [Wed, 5 Aug 2026 09:26:20 +0000 (11:26 +0200)]
vendor : apply patches for subprocess.h (#26606)

5 weeks agoui: show generation statistics by default in chat settings (#26624)
Aleksander Grygier [Wed, 5 Aug 2026 09:03:23 +0000 (11:03 +0200)]
ui: show generation statistics by default in chat settings (#26624)

5 weeks agobuild : remove GGML_METAL_USE_BF16 from all build scripts (#26604)
Niklas Wenzel [Wed, 5 Aug 2026 08:44:34 +0000 (10:44 +0200)]
build : remove GGML_METAL_USE_BF16 from all build scripts (#26604)

5 weeks agoui: Update vulnerable packages + cleanup Storybook config (#26607)
Aleksander Grygier [Wed, 5 Aug 2026 06:06:37 +0000 (08:06 +0200)]
ui: Update vulnerable packages + cleanup Storybook config (#26607)

* chore: Upgrade Storybook

* chore: Bump package-lock

* chore: bump vitest to 4.1.10

* ui: bump fast-uri to 3.1.5

* ui: bump ip-address to 10.4.0

* ui: bump js-yaml to 4.3.1

* ui: bump immutable to 5.1.9

* ui: bump postcss to 8.5.25

* ui: bump brace-expansion to safe versions

* ui: bump sharp to 0.35.3 via override

* ui: bump body-parser to 2.3.0

* ui: bump vite to 7.3.6 and esbuild to 0.28.1

Assisted-by: Claude Sonnet
* ui: bump hono to 4.13.0

* ui: bump dompurify to 3.4.13

* ui: bump @sveltejs/kit to 2.70.2

* ui: bump @modelcontextprotocol/sdk to 1.30.0

* ui: bump valibot to 1.4.2 via override

* chore: Remove legacy setup file

* refactor: Nits cleanup

5 weeks agoPrefer npm ci over install for security (#26601)
Evan Huus [Tue, 4 Aug 2026 22:14:22 +0000 (18:14 -0400)]
Prefer npm ci over install for security (#26601)

5 weeks agoserver: decode Windows OEM output to UTF-8 in built-in tools (#26597)
Pascal [Tue, 4 Aug 2026 20:24:55 +0000 (22:24 +0200)]
server: decode Windows OEM output to UTF-8 in built-in tools (#26597)

a child process writes in the OEM code page, which is not UTF-8 on a
western Windows install, so accented output reaches the JSON layer as
invalid bytes and gets replaced there, silently losing the characters

run() spawns without a console, so the child never inherits the console
code page and GetOEMCP is the one that applies

decode with MB_ERR_INVALID_CHARS so a wrong code page returns the text
untouched instead of emitting replacement characters, and pass text that
already decodes as UTF-8 through so a child emitting UTF-8 is never
decoded twice

the check drops an incomplete trailing sequence before validating, since
a streamed chunk can end in the middle of a multi-byte character

5 weeks agomtmd: correcting duplicate empty audio chunks for short inputs (#26536)
Abhinay Krishna [Tue, 4 Aug 2026 20:05:56 +0000 (16:05 -0400)]
mtmd: correcting duplicate empty audio chunks for short inputs (#26536)

* correcting duplicate empty audio chunks for short inputs

* tests.sh code restored

5 weeks agosampler : remove "full-context windows" from history-based samplers (#26524)
Oliver Simons [Tue, 4 Aug 2026 18:28:55 +0000 (20:28 +0200)]
sampler : remove "full-context windows" from history-based samplers (#26524)

* Resolve -1 to 1024 instead of ctx-len for samplers

Because of backend-sampling we initialize samplers before the complete
llama_context is there. Therefore, we cannot infer the resolved context
length yet at the time we construct the samplers.

* Shared default of 64 for history-based samplers, remove context_size

5 weeks agogguf-split: Add option to delete split parts during merge (#26538)
Guilherme Quintino [Tue, 4 Aug 2026 18:27:47 +0000 (19:27 +0100)]
gguf-split: Add option to delete split parts during merge (#26538)

* Add delete-files option to split parameters

Added a new option to delete split files during execution to free up disk space.

* Add test for delete files on merge option

* Fix tests

* Update tools/gguf-split/gguf-split.cpp

Co-authored-by: Sigbjørn Skjæret <redacted>
* Update tools/gguf-split/gguf-split.cpp

Co-authored-by: Sigbjørn Skjæret <redacted>
* Uncomment tests

* Improvements to address PR comments

* Fix formatting

* Fix formatting

* Rename --delete-files to --delete-splits

* Comment tests

* Move delete inside loop

* style cleanup

---------

Co-authored-by: Sigbjørn Skjæret <redacted>
5 weeks agoui: CWD for agent (#26518)
Aleksander Grygier [Tue, 4 Aug 2026 17:05:48 +0000 (19:05 +0200)]
ui: CWD for agent (#26518)

* server : extend file_glob_search for UI pickers

* ui : add per-conversation working directory with picker

* ui : add path navigation and search scope to cwd picker

Treat path-like queries (starting with / or ~) as directory navigation
instead of glob-matching the whole query: search the parent for the last
segment, and descend into an exactly-typed directory by listing its
children. Show the effective search scope in the footer and auto-search
on open so the current directory and its siblings appear immediately.

Assisted-by: Claude
* db : persist per-call tool cwd on tool result messages

* ui : abbreviate tool paths under home with a tilde

* ui : show the per-call cwd on exec shell rows

* ui : clarify the synthetic cwd message for the model

* ui : reuse the trailing cwd row on a repeated pick

* ui : don't jump when a cwd row is injected mid-chat

* chore: Formatting

* refactor: Cleanup comments

* ui : unify working directory naming and add a synthetic-message flag

* ui : render synthetic cwd rows without a scroll jump

* ui : decouple the working directory picker into utils and sub-components

* ui : add get_info tool call block

* chore: Formatting

* refactor: Cleanup

* refactor: Cleanup

* refactor: Cleanup

* fix: UI

* server : harden file_glob_search listing (kind enum, timeout, symlink guard, absolute base)

* ui : use persisted isSynthetic flag for cwd rows, drop legacy formats

* ui : cache picker search, fail visibly on native resolve

* ui : escape glob metacharacters in picker search glob

* ui : simplify auto-scroll pin

* chore: Format

* fix: Use `SvelteMap`

* refactor: Post-review fixes

* ui: accept Windows roots in the working directory picker

recognize a drive root (C:) and a UNC share (//host/share) as path
navigation, alongside the POSIX root and ~, so a query like D:\repos
lists that directory instead of glob-matching it under the home dir

split below the root, so a bare drive resolves to its root rather than
to a drive-relative prefix

rewrite backslashes into forward slashes only when the query carries a
Windows root, since a backslash is a legal POSIX filename character

paths keep travelling with forward slashes, which is what the server
returns and what Windows accepts

---------

Co-authored-by: Pascal <redacted>
5 weeks agomtmd: support Qwen3-TTS (note: breaking change to llama-tts binary) (#26254)
Xuan-Son Nguyen [Tue, 4 Aug 2026 15:26:15 +0000 (17:26 +0200)]
mtmd: support Qwen3-TTS (note: breaking change to llama-tts binary) (#26254)

* convert text model

* main model load ok

* convert encoder ok

* speaker encoder loading ok

* speaker enc graph

* adapt vocab for backbone (with some tricks)

* add suppress_tokens

* poc new mtmd gen api

* convert code_predictor to gguf

* load gen_code model ok

* add clip_encode

* wire up

* code gen cgraph init version

Co-authored-by: Pascal <redacted>
* code2wav convert to gguf

* code2wav graph ok

* wire up in/out

* (wip) subgraph

* wire up

* wip, correct code2wav

* demo (to be removed)

* code2wav preserve kv between calls

* demo voice clone

* llama: add llama_model_get_tok_embd

* mtmd_helper_gen_audio API

* fix clamp cold prefix

Co-authored-by: Pascal <redacted>
* fuse snake op

Co-authored-by: Pascal <redacted>
* demo: use proper sampling

* update dev docs

* polymorphism helper

* revamp llama-tts binary

* update docs

* fix compile

* fix lint

* nits

* add guide + docs

* more timings info

* clean up code comments

* security fixes

* update docs

* use ggml_build_forward_select, clean up comments

* fix ci

* use ISO 639-1 language code

* rename CODE2WAV --> GEN_WAV, update docs

* clean up

* clean up tts.cpp

* add seq_id

* add step_prompt()

* mtmd_helper_model_can_chat

* clean up comments

---------

Co-authored-by: Pascal <redacted>
5 weeks agomodels : fix dflash wo_a reshape on load (#26577)
Georgi Gerganov [Tue, 4 Aug 2026 13:56:49 +0000 (16:56 +0300)]
models : fix dflash wo_a reshape on load (#26577)

5 weeks agoci: fix pre-built binaries no longer working on macOS 15 and below (#26375)
Niklas Wenzel [Tue, 4 Aug 2026 13:03:38 +0000 (15:03 +0200)]
ci: fix pre-built binaries no longer working on macOS 15 and below (#26375)

* ci: fix pre-built binaries no longer working on macOS 15 and below

* ci: add macOS deployment target to disabled KleidiAI build

5 weeks agospeculative : refactor enabled configs common_speculative_init (#26510)
Daniel Bevenius [Tue, 4 Aug 2026 11:17:15 +0000 (13:17 +0200)]
speculative : refactor enabled configs common_speculative_init (#26510)

This commit contains a suggestion to reduce some code duplication in
common_speculative_init when adding the enabled speculative decoding
configurations.

No tests were added but the existing server tests still passes with this
change:
```console
$ ./tests.sh unit/test_speculative.py -v -x
```

5 weeks agogguf-py: validate n_dims and guard against uint64 overflow in reader (#25401)
hcl [Tue, 4 Aug 2026 09:12:48 +0000 (17:12 +0800)]
gguf-py: validate n_dims and guard against uint64 overflow in reader (#25401)

The Python GGUF reader lacked two guards the C++ loader has:
- n_dims read as uint32 with no GGML_MAX_DIMS bound -> crafted file with
  huge n_dims triggers oversized memmap read / OOM.
- np.prod(dims) on uint64 wraps silently -> a crafted dims triple can
  overflow to a tiny element count, passing an undersized read through.

Add a GGML_MAX_DIMS check and compute the element count with Python ints.

Fixes #25378

5 weeks agosync : ggml
Georgi Gerganov [Tue, 4 Aug 2026 08:54:13 +0000 (11:54 +0300)]
sync : ggml

5 weeks agoggml : bump version to 0.18.1 (ggml/1578)
Georgi Gerganov [Tue, 4 Aug 2026 08:44:52 +0000 (11:44 +0300)]
ggml : bump version to 0.18.1 (ggml/1578)

5 weeks agoconvert : add missing return after setting tekken vocab (#25947)
Angel Galindo [Tue, 4 Aug 2026 08:41:18 +0000 (01:41 -0700)]
convert : add missing return after setting tekken vocab (#25947)

5 weeks agovulkan backend ops: implemented GATED_LINEAR_ATTN (#25601)
Pranav Uttarkar [Tue, 4 Aug 2026 08:40:54 +0000 (03:40 -0500)]
vulkan backend ops: implemented GATED_LINEAR_ATTN (#25601)

* vulkan : add GATED_LINEAR_ATTN op

* docs : update Vulkan ops

* vulkan : remove unused GLA spec constant

* Updated ops.md

* ops.md update

5 weeks agovocab : validate plamo2 byte tokens (#26511)
Sigbjørn Skjæret [Tue, 4 Aug 2026 08:40:02 +0000 (10:40 +0200)]
vocab : validate plamo2 byte tokens (#26511)

* validate plamo2 byte tokens

* --typo

5 weeks agoconvert : import bytes_to_unicode from convert_slow_tokenizer (#26217)
Caleb DeLeeuw [Tue, 4 Aug 2026 07:34:30 +0000 (00:34 -0700)]
convert : import bytes_to_unicode from convert_slow_tokenizer (#26217)

bytes_to_unicode was removed from transformers.models.gpt2.tokenization_gpt2
in huggingface/transformers#40936, but it had already been copied into
transformers.convert_slow_tokenizer in huggingface/transformers#30334
(transformers 4.54.1), so import it directly from there.

Applies the same fix to chatglm.py.

5 weeks agomodel : allow reshape of tensors during load (#26531)
Georgi Gerganov [Tue, 4 Aug 2026 06:06:44 +0000 (09:06 +0300)]
model : allow reshape of tensors during load (#26531)

5 weeks agollama : move n_vocab from llama_sampler_data to penalty_sampler (#26520)
Oliver Simons [Tue, 4 Aug 2026 06:02:49 +0000 (08:02 +0200)]
llama : move n_vocab from llama_sampler_data to penalty_sampler (#26520)

This matches how it is done for logit_bias and mirostat samplers, see
https://github.com/ggml-org/llama.cpp/pull/25262#discussion_r3703951151

5 weeks agoci: fix vulkan llvmpipe runs (#26533)
Eve [Tue, 4 Aug 2026 03:28:57 +0000 (03:28 +0000)]
ci: fix vulkan llvmpipe runs (#26533)

5 weeks agosycl: parallelize the non-contiguous concat kernel (#25852)
Titaniumtown [Tue, 4 Aug 2026 02:08:05 +0000 (19:08 -0700)]
sycl: parallelize the non-contiguous concat kernel (#25852)

* sycl: parallelize the non-contiguous concat kernel

Launch geometry only: the non-contiguous concat kernel launched a single-lane
work-group (1, 1, 1), now it will launch a (1, 1, SYCL_CONCAT_BLOCK_SIZE) one.

SYCL_CONCAT_BLOCK_SIZE is defined in `ggml/src/ggml-sycl/presets.hpp`.

llama-bench (Arc Pro B70, Qwen3.6-27B-UD-Q4_K_XL, -fa on, q8_0 KV),
on top of upstream master: pp2048 920 -> 1006 t/s (+9.4%)

* sycl: cap non-contiguous concat block at ne0

* sycl: make non-contiguous concat block width env-tunable (GGML_SYCL_CONCAT_BLOCK_SIZE)

* Revert "sycl: make non-contiguous concat block width env-tunable (GGML_SYCL_CONCAT_BLOCK_SIZE)"

This reverts commit 2709909e790d298cc0746950caff16ad8ecf9d6f.

5 weeks agoExtended SYCL oneDNN SDPA to non-FP16 KV caches (Q4_0–Q8_0 and FP32) (#25874)
Ozymandias_EBON [Tue, 4 Aug 2026 02:07:23 +0000 (21:07 -0500)]
Extended SYCL oneDNN SDPA to non-FP16 KV caches (Q4_0–Q8_0 and FP32) (#25874)

* sycl: extend oneDNN SDPA to Q4_0-Q8_0 and F32 KV caches

Extends the oneDNN SDPA path (PR #25222) to handle non-F16 KV caches by
dequantizing or converting K/V to dense FP16 on-device before feeding
them into the SDPA graph. The fused systolic kernel then runs identically
to the native FP16 path.

Supported KV types:
  - Q4_0, Q4_1, Q5_0, Q5_1, Q8_0: to_fp16_sycl / to_fp16_nc_sycl
  - F32: cont_to_f16_sycl<float>
  - BF16 and IQ types are excluded (no conversion kernel available)

Gate: non-F16 requires K >= 1024 and Q >= 32 (prefill only).
F16 KV runs at any length (existing behavior).

Also includes the stream sync fix (stream->wait_and_throw() unconditional,
PR #25741 by @malsbat) and removal of V_is_K_view aliasing (K and V are
always dequantized to separate buffers).

Co-Authored-By: Claude <redacted>
* docs: drop GGML_SYCL_FA_DEBUG from SYCL.md (not shipped in this PR)
Co-Authored-By: Claude <redacted>
---------

Co-authored-by: Claude <redacted>
5 weeks agochat : add new template for DeepSeek V4 Flash 0731 (#26398)
Thiago Padilha [Mon, 3 Aug 2026 22:59:11 +0000 (19:59 -0300)]
chat : add new template for DeepSeek V4 Flash 0731 (#26398)

* common/chat: update DeepSeek V4 templates

Align the DeepSeek V4 templates with the official encoders while keeping parser behavior out of this change.

- Default drop_thinking for DeepSeek V4 history so prior thinking is omitted unless preserve_reasoning is requested or tools are present.
- Add structured output response-format instructions to the V4 templates and pass the schema into template rendering.
- Add a separate Flash 0731 template for the updated high and max reasoning effort mapping.
- Cover reasoning effort, drop_thinking, structured output prompts, preserved reasoning, continuations, and empty tool arguments in template rendering tests.

Official references:
https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash/blob/main/encoding/encoding_dsv4.py
https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-0731/blob/main/encoding/encoding_dsv4.py

Assisted-by: Codex
* Fix deepseek v4 0731 template selection

* remove unneeded lower normalization

* Fix DSML parser to consume the tool call separator

* address aldehir requests

* address aldehir comment

5 weeks agovendor : update cpp-httplib to 0.52.0 (#26485)
Alessandro de Oliveira Faria (A.K.A.CABELO) [Mon, 3 Aug 2026 22:30:42 +0000 (19:30 -0300)]
vendor : update cpp-httplib to 0.52.0 (#26485)

5 weeks agovendor : update BoringSSL to 0.20260803.0 (#26523)
Alessandro de Oliveira Faria (A.K.A.CABELO) [Mon, 3 Aug 2026 18:31:15 +0000 (15:31 -0300)]
vendor : update BoringSSL to 0.20260803.0 (#26523)

5 weeks agomodel : support MTP in GLM-4.7-Flash (#24868)
jacekpoplawski [Mon, 3 Aug 2026 18:27:52 +0000 (20:27 +0200)]
model : support MTP in GLM-4.7-Flash (#24868)

5 weeks agotests: add model resolution test on synthetic repo listings (#26172)
Pascal [Mon, 3 Aug 2026 16:58:15 +0000 (18:58 +0200)]
tests: add model resolution test on synthetic repo listings (#26172)

* tests: add model resolution test on synthetic repo listings

Include download.cpp and arg.cpp inside a namespace with hf_cache
monkey patched to serve hardcoded listings, so the resolution and the
model handler assembly are tested end-to-end through the real CLI
parsing, without modifying the tested code and without network access.

Covers the primary, shard, mmproj, sidecar and preset resolution on
layouts mimicking real vendor conventions, replays every case on
permutations of the listing to assert determinism, and asserts the
final wired paths for the spec type auto-selection, the -md precedence
and the fallback suppression.

* tests: keep model resolution checks active and let the handler resolve

Replace assert with a REQUIRE macro alive in Release builds, key the
fake hf_cache by repo id so the real handler init resolves every plan
itself, check the exact shard sets, restrict the permutation exception
to the order dependent picks, and cover dflash and eagle3.

* tests: fix model resolution build on fatal warnings CI and Windows

The namespaced copy of the sources leaves many static functions unused
in this TU, exempt it from the unused warnings. Pre-include the
windows headers so arg.cpp does not pull them inside the namespace.
Declare the renamed copies of the download.h functions, verbatim from
the header and renamed in sync by the macros, so missing declaration
and missing prototype warnings are satisfied on every toolchain.

* tests: fix winsock inclusion order for the model resolution test

WIN32_LEAN_AND_MEAN and winsock2.h before windows.h, so http.h does
not redefine the socket types afterwards.

* tests: link cpp-httplib to the model resolution test

The test compiles its own copy of download.cpp, which calls httplib
directly, and the private link of llama-common does not propagate the
symbols under lld-link.

* common_http_client

* common: finish the http client wrapper

Add the virtual Head, Get and Post methods and the passthrough
setters to the common_http_client skeleton, move follow_location
into the constructor, expose the underlying client for the ranged
pull path, and rename the missed common_http_client_init call sites.

* tests: rewrite model resolution on the http client stub

Replace the namespace inclusion of the sources by a plain TU: the
common_http_client factory returns a stub serving hardcoded HF API
responses, so the real hf_cache parsing, resolution and CLI handler
run against synthetic listings in an isolated cache directory.

Failures print the named case, the reordering and the actual versus
expected values, the assembly cases use the full command line as
context, and the empty result cases are checked once to keep the
logs short.

* tests: fix the model resolution on Windows and the builds without TLS

Assert the exact expected paths composed like the cache does instead of
suffix matching on forward slashes, set the environment portably, and
serve the stub through an http endpoint so the builds rejecting the
https scheme still reach it. Pause the log so the negative cases can be
replayed on every reordering.

* tests: make the model resolution failures self explanatory

Resume the paused log before the failure report so the CI shows why
the tested code bailed, and format the stub oids portably.

* common: hold the http client factory behind exported functions

The factory was an inline variable, and the Windows shared builds
export functions but not data, so the executable and the DLL each had
their own instance: the stub installed by the test was invisible to
the library, which reached for the real endpoint and resolved nothing.
Route the creation through functions compiled into the library and
format the stub oids portably.

* common: add the http client factory source missed in the previous commit

* common: typedef the http client factory callback

Address review from @ngxson

* tests: serve the model resolution repos over the loopback

Replace the client stub by a real httplib server bound to the
loopback, so no C++ object crosses the module boundary anymore and
the library exercises its own client and transport end to end. The
debug shared build on Windows crashed inside the stubbed path.

* common: add portable common_get_env and common_set_env helpers

Address review from @ngxson

* common: drop the http client factory left without a caller

The loopback server made the stub substitution unnecessary, the client
init builds the real client directly again.

* common: read the model endpoint through the env helpers

* nit: drop the stub leftovers from the model resolution test

* common: align common_set_env and isolate the test cache per run

The POSIX branch now behaves like _putenv_s, so the helper has a single
contract on every platform, and common_get_env already reads an unset and
an empty variable alike.

The model resolution test keys its cache directory on the loopback port,
where two concurrent runs on the same machine used to share one directory
and the initial cleanup of either wiped the other.

* tests: move the model resolution server into main

* tests: support the DSpark sidecar resolution

* common: revert the http client to the plain httplib client

address review from @ngxson

---------

Co-authored-by: Xuan Son Nguyen <redacted>
5 weeks agoserver: add get_info tool (#26522)
Xuan-Son Nguyen [Mon, 3 Aug 2026 16:51:02 +0000 (18:51 +0200)]
server: add get_info tool (#26522)

* server: add get_info tool

* fix --rpc in docs

* server: harden get_info probe result handling

Report the OS as unknown when the probe process fails to spawn or times
out, so the diagnostic text from run() is never returned as an OS name.
Strip the probe output on both ends, which also drops the blank line
that ver prints before the version on Windows. Name the output and
timeout limits, and report an unreadable working directory as unknown
instead of an empty string.

* server: simplify get_info result handling

Drop the named limits and the working directory error branch, keeping
the probe result handling to a single expression.

---------

Co-authored-by: Pascal <redacted>
5 weeks agovocab : validate default special token ids (#26506)
Sigbjørn Skjæret [Mon, 3 Aug 2026 15:40:53 +0000 (17:40 +0200)]
vocab : validate default special token ids (#26506)

5 weeks agoggml: use dynamic allocation for split graph inputs (#22789)
AgoraPete [Mon, 3 Aug 2026 15:03:14 +0000 (17:03 +0200)]
ggml: use dynamic allocation for split graph inputs (#22789)

* ggml: use dynamic allocation for split graph inputs

Replace fixed-size GGML_SCHED_MAX_SPLIT_INPUTS arrays with dynamically
allocated buffers in the backend scheduler. This fixes crashes when
loading wide MoE models (Gemma 4, Qwen MoE, Mixtral, DeepSeek) on
multi-backend setups where graph splits exceed 30 input tensors.

- split->inputs: dynamic array with grow-on-demand
- sched->graph_inputs: dynamic array with grow-on-demand
- graph_size calculation now uses actual input count instead of fixed constant

* cont : clean-up

---------

Co-authored-by: Georgi Gerganov <redacted>
5 weeks agoopencl: route large q6_K lm_head to the flat GEMV (#26427)
Hongqiang Wang [Mon, 3 Aug 2026 14:36:19 +0000 (07:36 -0700)]
opencl: route large q6_K lm_head to the flat GEMV (#26427)

* add a direct size condition for `large` weights; the original
  dimension condition is insufficient -- q6_K lm_head for gemma-4 E2B
  has [1536, 262144], which is big enough to slowdown gemv_noshuffle but
  does not satisfy the dimension condition (ne0 >= 2048)

5 weeks agograph : fix unused input tensors in minimax m3 graph (#26519)
Georgi Gerganov [Mon, 3 Aug 2026 14:32:01 +0000 (17:32 +0300)]
graph : fix unused input tensors in minimax m3 graph (#26519)

5 weeks agomodel: M3: Move MSA into a new memory implementation (#26338)
timkhronos [Mon, 3 Aug 2026 13:30:08 +0000 (15:30 +0200)]
model: M3: Move MSA into a new memory implementation (#26338)

* Move MSA logic from llama-kv-cache into llama-kv-cache-msa

* cont : minor

* cont : ws fix

---------

Co-authored-by: Georgi Gerganov <redacted>
5 weeks agollama : allocate indexer cache only in "full" indexer layers (#26474)
fairydreaming [Mon, 3 Aug 2026 12:56:30 +0000 (14:56 +0200)]
llama : allocate indexer cache only in "full" indexer layers (#26474)

Co-authored-by: Stanisław Szymczyk <redacted>
5 weeks agoCUDA: Add backend sampler for penalties sampler (#25262)
Konrad Moren [Mon, 3 Aug 2026 12:26:09 +0000 (14:26 +0200)]
CUDA: Add backend sampler for penalties sampler (#25262)

* sampling: enhance penalty handling in common_sampler_init

- Set default value for penalty_last_n based on model context if not specified.
- Ensure penalty_last_n and n_prev are non-negative.
- Update llama_sampler_penalties structure to inherit from llama_sampler_backend and add backend input handling for penalties.
- Implement backend initialization and application logic for penalties, including frequency and presence adjustments.

* tests: add backend penalties sampling tests and utility functions

- Introduced `accept_prompt` and `unique_prompt_tokens` functions to handle prompt acceptance and token uniqueness.
- Implemented `compare_penalties_logits` to compare logits from backend and CPU samplers with penalties.
- Added `test_backend_penalties_sampling` to validate backend penalties with various configurations.
- Enhanced the test suite for better coverage of penalty handling in sampling.

* sampling: add support for top-k penalties in backend sampling

* sampling: add fix to ensure  stable numerical results. Preserve masked logits as -Inf and no longer generate NaN.

* sampling: enhance penalty comparison tests with masking penalties logic

* add comments on padding

* sampling: add comments on modifications

* add the unit test to cover masked-out token as -INF

* validate repeat penalty to ensure it is finite and greater than 0; add tests for invalid values

* refactor: test functions to share logic and be less verbose

* add test to cover case where previously penalized token is not part of candidates

* remove comments

* remove redundant penalty_last_n initialization and validation in common_sampler_init

* add support for penalties in sampler chain with configurable positions

* add validation for penalty parameters and enhance tests for non-finite values

* add context parameter to common_sampler_init and set default for penalty_last_n

* add llama_n_ctx parameter to common_sampler_init for improved sampler initialization

* replace penalty_last_n x n_candidates comparison matrix with a vocabulary-sized count tensor

* add tests for backend penalties sampling without filler entries , token_count.size() == n_active == n_max == 64

* add test for backend penalties sampling  after top-p with large history window

* remove as unused

* add is_disabled method, tensor logits reshape, add rest review suggestions

* clarify comment

5 weeks agoCUDA: Fix data-races when reusing SMEM in block_reduce (#26385)
Oliver Simons [Mon, 3 Aug 2026 12:22:44 +0000 (14:22 +0200)]
CUDA: Fix data-races when reusing SMEM in block_reduce (#26385)

* CUDA: Fix data-races when reusing block_reduce

block_reduce currently doesn't resync after reading from SMEM, causing
potential data-races when reusing SMEM for multiple reductions.

One may consider simply always adding this in block_reduce, but this
comes at a potential perf cost

* double-buffering for single-row softmax

* double-buffering for norm as well

* Add comment

* Add explanatory comment to block_reduce

* Specify need for + do memory barrier only in multi-warp scenario

* Implement review-suggestion from @gaugarg-nv

5 weeks agoserver: add notice for upcoming default port change 8080 --> 9931 (#26508)
Xuan-Son Nguyen [Mon, 3 Aug 2026 10:45:24 +0000 (12:45 +0200)]
server: add notice for upcoming default port change 8080 --> 9931 (#26508)

* server: add notice for upcoming default port change 8080 --> 6631

* add link to PR

* correct to 9931

5 weeks agoserver: (tools) add x-tool-cwd header (#26420)
Xuan-Son Nguyen [Mon, 3 Aug 2026 08:47:21 +0000 (10:47 +0200)]
server: (tools) add x-tool-cwd header (#26420)

* server: (tools) add x-tool-cwd header

* reuse str_to_lower from server-models

5 weeks agomodel: MTP support for Qwen3-Next (#25589)
Masashi Yoshimura [Mon, 3 Aug 2026 08:15:01 +0000 (17:15 +0900)]
model: MTP support for Qwen3-Next (#25589)

* mtp for qwen3nex

* fix for python type-check

* Fix to compute num_mtp from directly mtp layer

* define opt_num_mtp_layers in _QwenMtpMixin and fix some comments

* Fix for python type check

* Update gguf-py/gguf/constants.py

Co-authored-by: Sigbjørn Skjæret <redacted>
* rebase and add load_mtp flags

* Update src/models/qwen3next.cpp

Co-authored-by: Sigbjørn Skjæret <redacted>
* Update src/models/qwen3next.cpp

Co-authored-by: Sigbjørn Skjæret <redacted>
---------

Co-authored-by: Sigbjørn Skjæret <redacted>
5 weeks agollama : MTP support for DeepSeek V3.2 (#26457)
fairydreaming [Mon, 3 Aug 2026 06:25:01 +0000 (08:25 +0200)]
llama : MTP support for DeepSeek V3.2 (#26457)

* llama : MTP support for DeepSeek V3.2

* model : no need to include MTP layers during DeepSeek V3.2 model type discovery

---------

Co-authored-by: Stanisław Szymczyk <redacted>
5 weeks agometal: implement DSv4 Lightning Indexer (#25893)
Thiago Padilha [Mon, 3 Aug 2026 04:33:37 +0000 (01:33 -0300)]
metal: implement DSv4 Lightning Indexer (#25893)

* metal: implement F16 Lightning Indexer

- Implement GGML_OP_LIGHTNING_INDEXER for 128-dimensional, 64-head inputs
  with F32 queries and weights plus F16 keys and masks.
- Add tiled and tail kernels and test KV lengths around 8- and 64-element
  boundaries.

llama-bench (--mmap 1, -fa 1, -p 512, -n 128; d=0/10k/20k/30k):

Before:
- pp512: 153.73 ± 0.87 t/s
- tg128: 8.91 ± 0.04 t/s
- pp512 @ d10000: 73.90 ± 0.39 t/s
- tg128 @ d10000: 8.66 ± 0.03 t/s
- pp512 @ d20000: 45.83 ± 0.18 t/s
- tg128 @ d20000: 8.26 ± 0.03 t/s
- pp512 @ d30000: 33.40 ± 0.21 t/s
- tg128 @ d30000: 7.94 ± 0.01 t/s

After:
- pp512: 155.19 ± 0.91 t/s
- tg128: 8.95 ± 0.04 t/s
- pp512 @ d10000: 86.95 ± 0.69 t/s
- tg128 @ d10000: 9.00 ± 0.05 t/s
- pp512 @ d20000: 62.01 ± 0.45 t/s
- tg128 @ d20000: 8.68 ± 0.04 t/s
- pp512 @ d30000: 49.18 ± 0.33 t/s
- tg128 @ d30000: 8.60 ± 0.02 t/s

Assisted-by: Codex
* metal: stage Lightning Indexer K tiles

- Stage and dequantize K in F16 threadgroup memory before simdgroup matrix loads.
- Zero-fill partial tiles and guard stores so all KV segments use the same numerical path.
- Support F32, F16, BF16, Q4_0, Q4_1, Q5_0, Q5_1, and Q8_0 K caches.

llama-bench (--mmap 1, -fa on, -p 512, -n 128; d=0/10k/20k):

- pp512: 160.38 +/- 1.01 t/s
- tg128: 9.08 +/- 0.03 t/s
- pp512 @ d10000: 88.37 +/- 0.46 t/s
- tg128 @ d10000: 9.07 +/- 0.04 t/s
- pp512 @ d20000: 62.53 +/- 0.46 t/s
- tg128 @ d20000: 8.84 +/- 0.03 t/s

Assisted-by: Codex
* dedup Lightning Indexer constants, fix flaky test

* cont : fix whitespace

---------

Co-authored-by: forforever73 <redacted>
Co-authored-by: Georgi Gerganov <redacted>
5 weeks agometal : add SILU_BACK (#25982)
Talha Adnan [Sun, 2 Aug 2026 19:39:28 +0000 (14:39 -0500)]
metal : add SILU_BACK (#25982)

* feat(silu_back): implemented silu_back op for f32

* fix(silu_back): removed redundant asserts in ggml-metal-ops.cpp function ggml_metal_op_silu_back.

5 weeks agometal : add F16 support for bin ops (#26465)
Georgi Gerganov [Sun, 2 Aug 2026 19:28:17 +0000 (22:28 +0300)]
metal : add F16 support for bin ops (#26465)

5 weeks agoopencl: limit local workgroup size for GLU operation (#26383)
mgroeber9110 [Sun, 2 Aug 2026 18:44:00 +0000 (20:44 +0200)]
opencl: limit local workgroup size for GLU operation (#26383)

5 weeks agometal: implement DeepSeek V4 hyper-connections (#26459)
Georgi Gerganov [Sun, 2 Aug 2026 18:06:02 +0000 (21:06 +0300)]
metal: implement DeepSeek V4 hyper-connections (#26459)

- Implement GGML_OP_DSV4_HC_COMB, GGML_OP_DSV4_HC_PRE, and
  GGML_OP_DSV4_HC_POST with SIMDgroup register and shuffle optimized kernels.
- Add Metal dispatch and support plumbing and test the production Sinkhorn
  iteration count and embedding width.

Assisted-by: Codex
Co-authored-by: Thiago Padilha <redacted>
5 weeks agocommon: support the DSpark sidecar resolution (#26458)
Pascal [Sun, 2 Aug 2026 17:25:27 +0000 (19:25 +0200)]
common: support the DSpark sidecar resolution (#26458)

The dspark- files resolve like the other speculative sidecars: the
-hfd tag applies to them, a requested sidecar resolves without a full
model at the tag, and an explicit -md selection disables the discovery.
When no type is requested, dspark outranks dflash in the auto-selection
since its sidecar carries the extra Markov head.

5 weeks agoconvert: add option to create separate dspark GGUF (#26452)
Aman Gupta [Sun, 2 Aug 2026 15:16:31 +0000 (23:16 +0800)]
convert: add option to create separate dspark GGUF (#26452)

* convert: add option to create separate dspark GGUF

* add --no-nextn

* fix convert bug

5 weeks agoopencl: bugfix increment ref_count in ggml_backend_opencl_init() (#26162)
akleine [Sun, 2 Aug 2026 13:43:00 +0000 (15:43 +0200)]
opencl: bugfix increment ref_count in  ggml_backend_opencl_init() (#26162)

Incrementing `ref_count` at the beginning is important later
in the `free()` method of the `ggml_backend_opencl_context` at program end.
If we do not increment the `ref_count`, the result would be -1 here,
and consequently, the profiling data would not be flushed and written.
( #ifdef GGML_OPENCL_PROFILING )

5 weeks agoDeepseekV4 MTP + DSpark (#25784)
Aman Gupta [Sun, 2 Aug 2026 12:55:34 +0000 (20:55 +0800)]
DeepseekV4 MTP + DSpark (#25784)

5 weeks agochat : add qwen3 specialized parser (#26252)
Aldehir Rojas [Sun, 2 Aug 2026 09:13:20 +0000 (04:13 -0500)]
chat : add qwen3 specialized parser (#26252)

* Add tagged thinking tool parser

* chat : refactor and add permute helper

* cont : add support for <tool_call> omission

* cont : update tool delimiters

* cont : add comment for qwen3-coder

* cont : fix trigger pattern for <function

---------

Co-authored-by: Bart de Boer <redacted>
5 weeks agosycl: fix classification of iGPUs (#26105)
KyleHagy [Sun, 2 Aug 2026 07:10:32 +0000 (00:10 -0700)]
sycl: fix classification of iGPUs (#26105)

5 weeks agomodel : load MiMo V2 MTP tensors only if used (#26412)
Sigbjørn Skjæret [Sun, 2 Aug 2026 07:03:05 +0000 (09:03 +0200)]
model : load MiMo V2 MTP tensors only if used (#26412)

5 weeks agoggml-webgpu: add support for f16 repeat (#26307)
Masashi Yoshimura [Sun, 2 Aug 2026 06:28:31 +0000 (15:28 +0900)]
ggml-webgpu: add support for f16 repeat (#26307)

5 weeks agotest: fix some CI errors (#26415)
Xuan-Son Nguyen [Sat, 1 Aug 2026 22:16:29 +0000 (00:16 +0200)]
test: fix some CI errors (#26415)

5 weeks agovulkan: extend topk_moe fusion to support sqrt(softplus) (#26124)
Jeff Bolz [Sat, 1 Aug 2026 19:18:07 +0000 (14:18 -0500)]
vulkan: extend topk_moe fusion to support sqrt(softplus) (#26124)

5 weeks agovendor : update BoringSSL to 0.20260730.0 (#26353)
Alessandro de Oliveira Faria (A.K.A.CABELO) [Sat, 1 Aug 2026 18:53:00 +0000 (15:53 -0300)]
vendor : update BoringSSL to 0.20260730.0 (#26353)

5 weeks agoagents: clarify comment style and jinja knowledge (#26405)
Xuan-Son Nguyen [Sat, 1 Aug 2026 16:45:46 +0000 (18:45 +0200)]
agents: clarify comment style and jinja knowledge (#26405)

* agents: clarify comment style and jinja knowledge

* improve Security review a bit

5 weeks agocli : persist reasoning_content in chat history (#26362)
Nico [Sat, 1 Aug 2026 16:03:32 +0000 (12:03 -0400)]
cli : persist reasoning_content in chat history (#26362)

* cli : persist reasoning_content in chat history

llama-cli collected reasoning from the stream for display but only
stored assistant content in messages, so --reasoning-preserve could
not re-inject prior thoughts on later turns.

5 weeks agomtmd: add minicpmv46 downsample (#25993)
tc-mb [Sat, 1 Aug 2026 11:38:36 +0000 (19:38 +0800)]
mtmd: add minicpmv46 downsample (#25993)

* add minicpmv46 downsample

Signed-off-by: tc-mb <redacted>
* put downsample mode inside gguf.

Signed-off-by: tc-mb <redacted>
* build mtmd_image_preprocessor_llava_uhd

Signed-off-by: tc-mb <redacted>
* fix code

Signed-off-by: tc-mb <redacted>
* add convert

Signed-off-by: tc-mb <redacted>
* add 4x ignore vit merger

Signed-off-by: tc-mb <redacted>
---------

Signed-off-by: tc-mb <redacted>
5 weeks agochat : enable tool call in thinking for DS4 (#26269)
Piotr Wilkin (ilintar) [Sat, 1 Aug 2026 05:13:07 +0000 (07:13 +0200)]
chat : enable tool call in thinking for DS4 (#26269)

5 weeks agovulkan: add POOL_1D op (#25431)
Anand Patil [Fri, 31 Jul 2026 14:48:58 +0000 (09:48 -0500)]
vulkan: add POOL_1D op (#25431)

* vulkan : add pool1d push constants and pipeline field

Declared data structures needed for POOL1D OP, which are the vk_op_pool1d_push_constants struct and pipeline_pool1d_f32 field.

* vulkan : add pool1d compute shader

Added pool1d.comp for Vulkan backend mirroring the existing pool2d shader.

* vulkan : add full GGML_OP_POOL_1D support

Added pipeline creation and op dispatch for 1D pooling in the Vulkan backend.

* vulkan : fix pool1d shader logic

Registered pool1d_f32 in vulkan-shaders-gen.cpp and fixed tensor dimension indices and avg pool scale.

* vulkan : fix pool1d end boundary crash and expand test coverage

Fixed an issue where the shader crashed when the end boundary was negative when k0 < p0. Also, added more test cases related to this fix.

5 weeks agovulkan: Introduce driver version check for Windows Intel GPU to mitigate crashing...
Masato Nakasaka [Fri, 31 Jul 2026 14:26:37 +0000 (23:26 +0900)]
vulkan: Introduce driver version check for Windows Intel GPU to mitigate crashing (#25192)

* Removed crash guard for Intel

Crash fixed from driver 32.0.101.8860

* Added driver version check for windows

* Change to convert from driverVersion rather than string

* No need to use signed

* Refactor

* allow GPU other than Xe2+

* adjusted function body position

5 weeks agomtmd: add n_embd_head (#26342)
Xuan-Son Nguyen [Fri, 31 Jul 2026 13:30:19 +0000 (15:30 +0200)]
mtmd: add n_embd_head (#26342)

Co-authored-by: Daniel Han <redacted>
5 weeks agoSupport rotated kv cache quant (#26180)
timkhronos [Fri, 31 Jul 2026 13:06:40 +0000 (15:06 +0200)]
Support rotated kv cache quant (#26180)

5 weeks agollama : load MTP tensors only if they are really used (#26296)
fairydreaming [Fri, 31 Jul 2026 12:57:02 +0000 (14:57 +0200)]
llama : load MTP tensors only if they are really used (#26296)

* llama : load MTP tensors only if they are really used

* llama : skip loading MTP (if not used) in remaining models that support MTP

---------

Co-authored-by: Stanisław Szymczyk <redacted>
5 weeks agovulkan: update vulkan sdk to 1.4.357.0 (#26303)
Jeff Bolz [Fri, 31 Jul 2026 12:27:03 +0000 (13:27 +0100)]
vulkan: update vulkan sdk to 1.4.357.0 (#26303)

5 weeks agoserver: correct accepted tokens when need draft token replay (#26320)
Ruixiang Wang [Fri, 31 Jul 2026 08:16:17 +0000 (10:16 +0200)]
server: correct accepted tokens when need draft token replay (#26320)

* spec: correct accepted tokens when need draft token replay

* cont : naming

---------

Co-authored-by: Georgi Gerganov <redacted>
5 weeks agocuda: extract Q2_0 elements via __byte_perm (#25603)
David Friehs [Fri, 31 Jul 2026 08:15:44 +0000 (10:15 +0200)]
cuda: extract Q2_0 elements via __byte_perm (#25603)

5 weeks agoSYCL: add oneMKL GEMM flash attention for XMX-accelerated prompt proc… (#25025)
Ozymandias_EBON [Fri, 31 Jul 2026 07:43:16 +0000 (02:43 -0500)]
SYCL: add oneMKL GEMM flash attention for XMX-accelerated prompt proc… (#25025)

* SYCL: add oneMKL GEMM flash attention for XMX-accelerated prompt processing

* fattn-mkl: fix interleaved dst layout in normalize kernel

- Fix mkl_fa_normalize_head: use interleaved dst layout
  ((query * n_q_heads + head) * DV) matching TILE's
  flash_attn_combine_results. Previously used dense head-major
  layout which wrote head outputs to wrong addresses, corrupting
  attention for all models except Qwen3.6-27B (where GQA=6 heads
  were sparse enough to avoid visible overlap).

- Remove 7 redundant stream->wait() calls — SYCL in-order queue
  already serializes pure SYCL kernel dependencies. Retain only
  the 4 MKL GEMM ↔ SYCL handshake barriers (oneMKL GEMM uses its
  own internal queue that does not respect SYCL in-order).

- Remove unused dst_row_stride, diagnostic clutter, and dead
  K/V hex dump (fa_diag block in fattn-mkl.cpp).

- Add MKL_FA_DISABLE=1 env var for A/B testing.
- Add FA-DISP watchdog (MKL_FA_DEBUG=1) and FA-DIAG output
  fingerprint (MKL_FA_DIAG=1) in fattn.cpp.

Tested: Gemma-4-26B, Gemma-4-31B, Qwen3.6-27B, Qwen3.6-35B-A3B
Perf (B70/Battlemage, 32K, q8_0 KV):
  Gemma-4-26B:  1473 t/s MKL vs 746 TILE (1.97x)
  Qwen3.6-27B:   609 t/s MKL vs 330 TILE (1.85x)

Co-Authored-By: Claude Code on DeepSeek-v4-Pro
* Thank you for the review feedback: rename env vars, use GGML_LOG_INFO, document in SYCL.md

Completed the following:
- Rename MKL_FA_DISABLE → GGML_SYCL_ENABLE_MKL_FA (inverted: 0 to disable)
- Rename MKL_FA_DEBUG → GGML_SYCL_MKL_FA_DEBUG
- Rename MKL_FA_DIAG → GGML_SYCL_MKL_FA_DIAG
- Replace fprintf(stderr, ...) / fflush(stderr) with GGML_LOG_INFO() macro
- Document all three env vars in docs/backend/SYCL.md under Runtime
- Add comment explaining MKL FA activation trigger (flash-attn + quantized
  KV cache + batch-size >= 1024 + n_kv >= 1024)

Resolves review feedback from arthw.
Again, thank you!!!

Co-Authored-By: Claude Code on DeepSeek-v4-Pro
* Thank you for the review feedback round 2: use ggml_sycl_get_env, remove dup waits, gate perf macros

- Replace raw getenv() with ggml_sycl_get_env() in all 4 env-var checks
  (fattn.cpp: GGML_SYCL_ENABLE_MKL_FA, GGML_SYCL_MKL_FA_DEBUG,
   GGML_SYCL_MKL_FA_DIAG; fattn-mkl.cpp: GGML_SYCL_MKL_FA_DEBUG)
- Remove duplicated stream->wait() before ev.wait_and_throw() in GEMM
  KQ and GEMM VKQ — ev.wait_and_throw() already waits for completion
- Gate MKL_ACCUM macro behind do_print so timing accumulators are
  no-ops in normal operation
- Remove redundant MIT/Intel copyright header from fattn-mkl.cpp
- Remove unused #include <cfloat>
- Expand SYCL.md MKL FA docs with step-by-step activation trigger
  and example llama-cli command

Again, thank you!!!

Co-Authored-By: Claude Code on DeepSeek-v4-Pro
* fattn-mkl: enable MKL FA for all KV cache types

Remove the quantized-only restriction on MKL activation — the MKL
kernel converts any non-F16 K/V to F16 via to_fp16_sycl before GEMM,
so F16 (default), BF16, and F32 caches all benefit from XMX hardware
acceleration.  The type restriction was an unnecessary gate.

Before (F16/BF16 default cache + FA on at 32K prefill): ~356 t/s (TILE path)
After:  ~670 t/s (MKL path, matching quantized-cache baseline)

Minimal change: two conditions removed, one comment updated in fattn.cpp.
No kernel or conversion code changes — the dequant pipeline already
covers all types.

* fattn-mkl: rename mkl_disable -> mkl_enable for clarity

* fattn-mkl: refine MKL FA dispatch gates

Three changes:
1. Remove quantized-only restriction - MKL FA activates for all
   KV cache types (F16 default, BF16, F32, quantized).  The MKL
   kernel converts non-F16 K/V via to_fp16_sycl before GEMM.
2. Rename mkl_disable -> mkl_enable to match env var
   (GGML_SYCL_ENABLE_MKL_FA).
3. Replace batch-size threshold with Q->ne[1] >= 32 gate.
   Keeps TG (Q=1) and MTP drafts (Q=3-8) on VEC path where
   fused kernel beats MKL launch overhead.  Routes all
   multi-token prefill through XMX-accelerated GEMM.

Production data confirms Q patterns: 1-8 TG, 32-127 cache reuse,
128+ full reprocess.  At 32K F16/BF16 FA-on: 356 -> 670 t/s.

* ggml-sycl: fix F16 cache + MKL FA multi-turn corruption; add gate guards

Two changes:

1. Always copy F16 K/V to dense row-major buffers before MKL GEMM.
   Previously F16 was read in-place with raw tensor strides. During
   multi-turn conversations, the accumulated KV cache had different
   stride properties than a fresh prefill, producing corrupted outputs.
   Now dense F16 gets a fast memcpy; interleaved (Gemma) gets a strided
   copy kernel. This matches what the quantized paths already did through
   to_fp16_sycl.

2. Gate MKL FA on unsupported op params (max_bias, logit_softcap, batch
   dim mismatch) and pathological F16 strides (nb[1] not a multiple of
   ne[0]*2). These conditions would previously crash inside the MKL
   kernel. Pathological strides (test-only) and ALiBi/softcap fall
   through to TILE/VEC which handle them correctly.

The stride check uses modulo rather than equality, so both dense
(nb1 == ne0*2) and interleaved (nb1 == H * ne0*2) pass — all real
models use these layouts. Only test cases with overlapping rows
(nb1=32 or nb1=75 for ne0=40) are blocked.

Thanks to hmscider for the oneDNN FA PR (#25222) which surfaced the
same insight: always normalize inputs to contiguous F16 before GEMM.

Co-Authored-By: Claude Code using DeepSeek-V4-Pro <redacted>
* fattn-mkl: fix quant+GQA KV strides, tighten MKL gate, add K>=1024 tests

Adding K>=1024 flash-attn test cases surfaced several MKL bugs:

- Quant K/V with a padded seq-view (real KV cache) used the wrong
  strides in the dequant path... only the true Gemma interleave
  layout should reconstruct strides. nb[2] vs ne[1]*nb[1]
- Gate was firing on shapes the kernel doesn't handle: head_dim < 64
  or not a multiple of 64, MHA, attention sinks, and
  bf16 decode... fell through to vec which no bf16 case.

Gate MKL to the validated envelope: gqa>=2, head_dim 64 through 512
(has to be a multiple of 64) with matching K/V head size, mask,
no sinks/alibi/softcap... everything else falls back to tile.
Covers Qwen Dense/MoE and Gemma4 Dense/MoE

Ran test-backend-ops -o FLASH_ATTN_EXT: 3641/3641 pass.
Perplexity unchanged... 6.7267 MKL vs 6.7290 stock using
Qwen 27b q5_k_xl

* Update ggml/src/ggml-sycl/fattn.cpp

Co-authored-by: Neo Zhang <redacted>
* Update ggml/src/ggml-sycl/fattn.cpp

Co-authored-by: Neo Zhang <redacted>
* Update ggml/src/ggml-sycl/fattn.cpp

Co-authored-by: Neo Zhang <redacted>
* fattn-mkl: bound attention scratch so it doesn't grow with batch or context... also dropped the bf16 comment in fattn.cpp per arthw review.

* Update ggml/src/ggml-sycl/fattn-mkl.cpp

Co-authored-by: Neo Zhang <redacted>
* Update ggml/src/ggml-sycl/fattn-mkl.cpp

Co-authored-by: Neo Zhang <redacted>
* apply arthw suggestions: enum for dequant modes, macro for wg_size, env-var one-liners

---------

Co-authored-by: Claude Code using DeepSeek-V4-Pro <redacted>
Co-authored-by: Neo Zhang <redacted>
5 weeks ago[SYCL] support the missed types in cpy (#26005)
Neo Zhang [Fri, 31 Jul 2026 07:25:16 +0000 (15:25 +0800)]
[SYCL] support the missed types in cpy (#26005)

* support the missed types in cpy

* use correct funct

* rm unused code

5 weeks agollama : enforce the same K and V cache types for DeepSeek V4; enable FA if V cache...
fairydreaming [Fri, 31 Jul 2026 07:03:30 +0000 (09:03 +0200)]
llama : enforce the same K and V cache types for DeepSeek V4; enable FA if V cache is quantized (#25871)

* llama : enforce the same K and V cache types for DeepSeek V4; enable FA if V cache is quantized

* llama : enforce the same K and V cache types for MLA models

---------

Co-authored-by: Stanisław Szymczyk <redacted>
5 weeks agoggml-zendnn : group matmul direct API for mul_mat_id (#25918)
Sachin Sharma [Fri, 31 Jul 2026 06:40:52 +0000 (12:10 +0530)]
ggml-zendnn : group matmul direct API for mul_mat_id (#25918)

* ggml-zendnn : group matmul API for mul_mat_id

* ggml-zendnn : scale MUL_MAT_ID fallback threshold by expert count

5 weeks agosycl : support dev2dev memcpy by DEV2DEV_MEMCPY_FORWARD (#26234)
Neo Zhang [Fri, 31 Jul 2026 06:20:28 +0000 (14:20 +0800)]
sycl : support dev2dev memcpy by DEV2DEV_MEMCPY_FORWARD (#26234)

Co-authored-by: Neo Zhang Jianyu <redacted>
5 weeks ago[SYCL] Support q2 mul_mat (#26231)
Neo Zhang [Fri, 31 Jul 2026 06:19:41 +0000 (14:19 +0800)]
[SYCL] Support q2 mul_mat (#26231)

* support q2_0 in mul_mat

* support more q2_0 case

5 weeks agosycl: fuse RMS_NORM + MUL (#26015)
Titaniumtown [Fri, 31 Jul 2026 06:17:53 +0000 (23:17 -0700)]
sycl: fuse RMS_NORM + MUL (#26015)

5 weeks agoggml-webgpu: improve flash_attn_vec for quantized KV at long contexts (#25956)
Masashi Yoshimura [Fri, 31 Jul 2026 06:08:40 +0000 (15:08 +0900)]
ggml-webgpu: improve flash_attn_vec for quantized KV at long contexts (#25956)

* improve fa of quantized kv cache

* Fix some bugs and some comments.

* fix v type check and some comments

* Fix build error caused by rebasing

* editorconfig checking pass

5 weeks agomtmd: add lanczos resize method [no release] (#26341)
Xuan-Son Nguyen [Thu, 30 Jul 2026 19:59:49 +0000 (21:59 +0200)]
mtmd: add lanczos resize method [no release] (#26341)

5 weeks agoserver: support inp embd to generate next token (#26313)
Xuan-Son Nguyen [Thu, 30 Jul 2026 19:40:38 +0000 (21:40 +0200)]
server: support inp embd to generate next token (#26313)

* server: support embd for sampled token

* fix ~server_batch()

5 weeks agovulkan: Support quantized concat (#25684)
Jeff Bolz [Thu, 30 Jul 2026 18:11:32 +0000 (19:11 +0100)]
vulkan: Support quantized concat (#25684)

5 weeks agoTest support for alternative conv layout (#25617)
pmaybank [Thu, 30 Jul 2026 17:14:16 +0000 (18:14 +0100)]
Test support for alternative conv layout (#25617)

* add  bool cwhn = true to conv_2d test cases

* add layout check at graph building time

* extend layout checks for conv2d.cu kernel

* in CPU back-end kernel needs to be stored contiguously to prevent test failures with cwhn=1

* trim white space

* do op support check in vulkan backend

* fix CI failure and vulkan run-time assert failure by introducing new graph build-time check in ggml_backend_vk_device_supports_op

* add additional check in support_op function for Vulkan to fix run-time assert failure

5 weeks agollama-context : sync pending async copies before clearing embd_seq (#25676)
o7si [Thu, 30 Jul 2026 16:48:00 +0000 (00:48 +0800)]
llama-context : sync pending async copies before clearing embd_seq (#25676)

5 weeks agotests : avoid building get-model.cpp many times (#26317)
Georgi Gerganov [Thu, 30 Jul 2026 16:34:04 +0000 (19:34 +0300)]
tests : avoid building get-model.cpp many times (#26317)

* tests : remove get-model.cpp

* tests : fix quant type selection

5 weeks agoggml-cuda: Allow transpose-free gemmv computation (#26171)
Robert Esclapez [Thu, 30 Jul 2026 13:39:46 +0000 (15:39 +0200)]
ggml-cuda: Allow transpose-free gemmv computation (#26171)

When matrix's weights are shaped 1xK is leverage a transpose-free
computation to use mat_mul_vec_f.

5 weeks agoreadme : refresh (#26280)
Georgi Gerganov [Thu, 30 Jul 2026 13:14:37 +0000 (16:14 +0300)]
readme : refresh (#26280)

* docs : center badges and links, remove Hot topics

- Use <div align="center"> for GitHub-compatible centering
- Add dev branches and compile times links
- Remove Hot topics section

Assisted-by: llama.cpp:Qwen3.6-27B
* readme : remove sections

* docs : center badges, remove Hot topics, extract sections, remove tools

- Use <div align="center"> for GitHub-compatible centering
- Add dev branches and compile times links
- Add lib llama API and llama-server REST API links
- Remove Hot topics section
- Remove Recent API changes section
- Extract XCFramework section into docs/xcframework.md
- Extract Completions section into docs/completions.md
- Extract Obtaining and quantizing models into docs/models.md
- Remove tools usage sections (llama-cli, llama-server, etc.)
- Move Contributing section to the end

Assisted-by: llama.cpp:Qwen3.6-27B
* cont : arrange links

* cont : fix ws

* cont : remove seminal papers

* cont : change sample model

* cont : trim-down contributing section

* cont : sort backends alphabetically

* cont : words

* cont : add fig captions

* docs : models words

* readme : shorter caption

* cont : fix typo

* cont : add window frame to screenshot

5 weeks agosync : ggml
Georgi Gerganov [Thu, 30 Jul 2026 12:43:44 +0000 (15:43 +0300)]
sync : ggml

5 weeks agoggml : bump version to 0.18.0 (ggml/1576)
Georgi Gerganov [Thu, 30 Jul 2026 12:42:47 +0000 (15:42 +0300)]
ggml : bump version to 0.18.0 (ggml/1576)

5 weeks agoCUDA: add Q2_0 support (#25707)
Pasha Khosravi [Thu, 30 Jul 2026 09:33:25 +0000 (02:33 -0700)]
CUDA: add Q2_0 support (#25707)

5 weeks agoRemove custom cpu op from the M3 graph, express with stock ops (#26297)
timkhronos [Thu, 30 Jul 2026 08:30:18 +0000 (10:30 +0200)]
Remove custom cpu op from the M3 graph, express with stock ops (#26297)

5 weeks agometal: fix memory unwire if model is freed without any GPU operations (#26082)
Niklas Wenzel [Thu, 30 Jul 2026 08:11:27 +0000 (10:11 +0200)]
metal: fix memory unwire if model is freed without any GPU operations (#26082)

* metal: fix memory leak if model is freed without any GPU operations

* metal: run dummy work only if residency sets are used

* metal: wrap function in #if defined

* metal: measure system-wide wired memory in test

* metal: always build regression test

Co-authored-by: YiChen Lv <redacted>
---------

Co-authored-by: YiChen Lv <redacted>
5 weeks agoui: IndexedDB and Conversations data fixes (#26278)
Aleksander Grygier [Thu, 30 Jul 2026 08:10:37 +0000 (10:10 +0200)]
ui: IndexedDB and Conversations data fixes (#26278)

* fix: single-flight conversations store init

* refactor: remove unused legacy-migration util

* fix: make createSystemMessage transactional

* fix: delete message branches cascading on edit/regenerate

* fix: stop stamping lastModified on conversation metadata updates

* fix: count cascaded forks in bulk delete toast, bulkify deleteAll

* refactor: drop redundant conversation list respreads

* refactor: create conversation in a single write

* fix: use table constant in toggleConversationPin

* fix: keep the system message placeholder out of the edit form

* fix: keep focus in the system message editor after opening it

* fix: focus the main chat form after submitting a system message

* fix: update timestamp of the correct conversation on stream completion

5 weeks agoggml : Fix issue with kleidiai ci and stringop overflow warning (#26277)
Jonathan Clohessy [Thu, 30 Jul 2026 06:17:30 +0000 (07:17 +0100)]
ggml : Fix issue with kleidiai ci and stringop overflow warning (#26277)

Signed-off-by: Jonathan Clohessy <redacted>
5 weeks ago[UT] enhance UT to show all real unsupported backends (#25234)
Neo Zhang [Thu, 30 Jul 2026 06:04:58 +0000 (14:04 +0800)]
[UT] enhance UT to show all real unsupported backends (#25234)

* enhance UT to show real unsupported backends

* cont : simplify

---------

Co-authored-by: Georgi Gerganov <redacted>
5 weeks agomimo2: address MTP review feedback (#26228)
Tunahan [Thu, 30 Jul 2026 03:55:58 +0000 (05:55 +0200)]
mimo2: address MTP review feedback (#26228)

Co-authored-by: tnhnyc <redacted>
5 weeks agofix: increase greeting spacing on md screens (#26287)
Aleksander Grygier [Wed, 29 Jul 2026 17:25:13 +0000 (19:25 +0200)]
fix: increase greeting spacing on md screens (#26287)

5 weeks agollama: move suppress_tokens handling to common/sampling (#26276)
Xuan-Son Nguyen [Wed, 29 Jul 2026 16:02:30 +0000 (18:02 +0200)]
llama: move suppress_tokens handling to common/sampling (#26276)

* llama: move suppress_tokens handling to common/sampling

* address security issues

* rm has_logit_bias

5 weeks agoggml-cuda : disable MMQ on devices with less than 48 KiB shared memory (#26141)
Kakaru [Wed, 29 Jul 2026 12:27:35 +0000 (20:27 +0800)]
ggml-cuda : disable MMQ on devices with less than 48 KiB shared memory (#26141)

ggml_cuda_should_use_mmq() selects MMQ purely from the quantization
type. The current MMQ configurations are designed and maintained against
a minimum of 48 KiB per-block shared memory, the limit provided by
NVIDIA Pascal GPUs and later. On devices that report less, no supported
MMQ tile fits and mul_mat_q_switch_J() aborts when every tile size
exceeds the device's per-block shared memory budget.

Disable MMQ when smpbo < 48 KiB so the caller falls back to the BLAS
path instead of hitting GGML_ABORT. Some current MUSA QY1 devices
report only 28 KiB and are covered by this guard.

Reproduced on a Moore Threads MTT S70 (arch mp_21, 28 KiB shared memory
per block) with an RWKV-7 0.1B Q8_0 model:

  $ llama-bench -m rwkv7-g1d-0.1b-Q8_0.gguf -p 128 -n 0
  J_best=0
  ggml/src/ggml-cuda/template-instances/../mmq.cuh:1521: fatal error
  (core dumped)

Only prefill (batch > 1) is affected; token generation is fine. After
the fix the same device falls back to the BLAS path:

  Q8_0    pp128 1470.7 t/s, tg8 55.3 t/s   (was: abort)
  FP16    unchanged
  Q4_K_M  unchanged

This matches a -DGGML_CUDA_FORCE_CUBLAS=ON build (pp128 1464.2 t/s),
which confirms the fallback path is the one being taken.

This is not MUSA-specific: any device with less than 48 KiB per-block
shared memory is affected.

Co-authored-by: KakaruHayate <redacted>