]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/log
pkg/ggml/sources/llama.cpp
4 weeks agotts: account for the vocoder pass in the timings line (#26733)
Pascal [Fri, 7 Aug 2026 20:35:52 +0000 (22:35 +0200)]
tts: account for the vocoder pass in the timings line (#26733)

get_output runs the waveform work the pipeline defers to it, from a
single trailing window to a full pass depending on the model. Measuring
it keeps the reported total and the audio to process ratio honest.

4 weeks agoallozaur/feat/chat form contenteditable (#26717)
Aleksander Grygier [Fri, 7 Aug 2026 18:40:10 +0000 (20:40 +0200)]
allozaur/feat/chat form contenteditable (#26717)

* feat: Add contenteditable tokenizer for badge/code-chip chat input

* feat: Add source-space undo/redo history for the rich input

* feat: Split text glued to a closing code fence onto its own line

* feat: Add ChatFormContenteditable rich input renderer

* feat : wire the contenteditable into ChatForm with auto-switch gating

4 weeks agotests : speed-up server test suite 3x (#26734)
Georgi Gerganov [Fri, 7 Aug 2026 18:38:32 +0000 (21:38 +0300)]
tests : speed-up server test suite 3x (#26734)

* tests : speed-up test suite 3x

* cont : print 30 slowest tests

4 weeks agoallozaur/feat/chat slash commands (#26716)
Aleksander Grygier [Fri, 7 Aug 2026 18:20:01 +0000 (20:20 +0200)]
allozaur/feat/chat slash commands (#26716)

* base : slash-command/misc foundation - model icon and focus-selector constants

* feat : slash-command picker and command parsing helpers

* refactor : wire command and @-mention pickers into the chat form

* ui : improve model selector keyboard navigation and load/dismiss

* feat: Unify markdown/raw-text rendering under one setting with migration

* fix: Misc fixes - tool-call subtitle, assistant wrap, progress guards

* feat: Clamp and style numeric settings inputs from registry bounds

4 weeks agosycl: coalesce the ssm_conv window loads (#26612)
Titaniumtown [Fri, 7 Aug 2026 18:09:32 +0000 (11:09 -0700)]
sycl: coalesce the ssm_conv window loads (#26612)

test-backend-ops perf -o SSM_CONV on an Arc Pro B70, interleaved A/B against
master, 6 reps, us/run:

  ne_a=[515,3328,1,1] ne_b=[4,3328,1,1]   n_t=512     97.68 -> 52.95   1.85x
  ne_a=[937,8192,1,1] ne_b=[4,8192,1,1]   n_t=934    516.16 -> 276.13  1.87x
  ne_a=[4,3328,1,1]   ne_b=[4,3328,1,1]   n_t=1        2.73 -> 2.71    flat

llama-bench on qwen35 27B Q4_K - Medium (48 of its 64 blocks run ssm_conv),
-ngl 99 -fa 1 -ctk f16 -ctv f16, interleaved passes of r=3:

  -b 2048 -ub 2048  pp2048  1045.1 / 1043.5 / 1043.7 -> 1069.5 / 1066.3 / 1065.9  +2.2%
  -b 2048 -ub 512   pp2048   771.8 /  772.7          ->  785.5 /  786.6           +1.8%
  -b 2048 -ub 512   tg128     23.81 /  23.88         ->   23.87 /  23.86          flat

4 weeks agometal : fix NORM/RMS_NORM for row lengths that leave a partial simdgroup (#26708)
robertomeroni [Fri, 7 Aug 2026 18:09:07 +0000 (20:09 +0200)]
metal : fix NORM/RMS_NORM for row lengths that leave a partial simdgroup (#26708)

ggml_metal_op_norm sized the threadgroup with
`nth = std::min(nth, args.ne00_t)`, which can leave nth not a multiple of
the simdgroup size. The kernels finish their row reduction with a
cross-simdgroup step where each lane of the last simdgroup reads one
per-simdgroup partial sum out of shmem_f32:

    if (tiisg == 0) { shmem_f32[sgitg] = sumf; }
    threadgroup_barrier(mem_flags::mem_threadgroup);
    sumf = shmem_f32[tiisg];
    sumf = simd_sum(sumf);

When the last simdgroup is partial it has fewer lanes than the
threadgroup has simdgroups, so the tail of the partial sums is never
read and the row sum is too small. For ne00_t = 33 nth becomes 33: two
simdgroups, but only one lane in the second, so one of the two partial
sums is dropped. The mean and variance are then wrong for the whole row.

Round ne00_t up to a whole number of simdgroups instead. Rounding up
rather than dropping the clamp keeps the threadgroup as small as
possible: deleting the line would raise nth to the next power of two
(ne00_t = 544 -> 1024 instead of 544), which costs idle lanes on 26 row
lengths below 8192 that were already correct, including 1536 and 3584.

GGML_OP_NORM is affected as well as GGML_OP_RMS_NORM - both dispatch
through ggml_metal_op_norm.

No mainstream LLM hidden size hits this: ne00_t is ne00/4 on the
vectorized path, so 4096, 8192, 2048 and friends all give a multiple of
32. It is reachable from other norm shapes, e.g. 320-channel norms.

Add NORM and RMS_NORM cases for ne0 = 33, 132 and 260 across the
existing eps values. 33 exercises the scalar path and 132/260 the
vectorized one, since only those divide by 4.

Before, on M3 Pro:

    test-backend-ops test -b MTL0 -o NORM        25/50
    test-backend-ops test -b MTL0 -o RMS_NORM    26/51

After:

    test-backend-ops test -b MTL0 -o NORM        50/50
    test-backend-ops test -b MTL0 -o RMS_NORM    51/51
    test-backend-ops test -b MTL0                13943/13943

4 weeks agoui: Filesystem `@mentions` for Chat Form (#26715)
Aleksander Grygier [Fri, 7 Aug 2026 16:45:54 +0000 (18:45 +0200)]
ui: Filesystem `@mentions` for Chat Form (#26715)

* base : @-mention picker foundation - glob search, picker nav, highlight

* feat : @-mention file/folder picker and mention badges in message bubbles

* fix: Imports

* feat : wire the @-mention picker into the chat form

* fix: Bound the glob-search result cache key and prune stale entries

4 weeks agomtmd: fix longest_edge ignoring min/max pixels (#26638)
Xuan-Son Nguyen [Fri, 7 Aug 2026 16:05:15 +0000 (18:05 +0200)]
mtmd: fix longest_edge ignoring min/max pixels (#26638)

* mtmd: fix longest_edge ignoring min/max pixels

* nits

4 weeks agosync : ggml
Georgi Gerganov [Fri, 7 Aug 2026 14:10:39 +0000 (17:10 +0300)]
sync : ggml

4 weeks agoggml : bump version to 0.19.0 (ggml/1581)
Georgi Gerganov [Fri, 7 Aug 2026 14:10:01 +0000 (17:10 +0300)]
ggml : bump version to 0.19.0 (ggml/1581)

4 weeks agoserver : clarify comment in eval_llama_cmpl_schema [no ci] [no release] (#26720)
Daniel Bevenius [Fri, 7 Aug 2026 13:39:33 +0000 (15:39 +0200)]
server : clarify comment in eval_llama_cmpl_schema [no ci] [no release] (#26720)

4 weeks agowebui: load the model selected via ?model= when ?load=true (#26707)
Emanuil Rusev [Fri, 7 Aug 2026 13:31:40 +0000 (16:31 +0300)]
webui: load the model selected via ?model= when ?load=true (#26707)

* webui: load the model selected via ?model=

Opening the WebUI with ?model= selects the model but doesn't load it. The load only starts when you send your first message, so you wait for it then.

This loads it as soon as the page opens, while you're still typing your prompt. It's what the model dropdown already does, and it isn't awaited, so the UI still works while the model loads.

This is the path the Llama macOS app uses to open the WebUI, so it's a common way in.

* webui: gate the load behind ?load=true

Loading on landing is opt-in, so a plain ?model= link behaves as before and doesn't allocate memory on its own.

* webui: name the chat URL params

Collects the query params the chat routes read into a URL_PARAMS constant, instead of repeating the literals across three files. NEW_CHAT_PARAM folds into it.

4 weeks agoui: set npm `min-release-age` to protect against supply-chain attacks (#26711)
Niklas Wenzel [Fri, 7 Aug 2026 12:53:51 +0000 (14:53 +0200)]
ui: set npm `min-release-age` to protect against supply-chain attacks (#26711)

* ui: set npm `min-release-age` to protect against supply-chain attacks

* ui: bump to 7 days

4 weeks agoserver: (router) add LRU scheduler (#26572)
Xuan-Son Nguyen [Fri, 7 Aug 2026 12:46:53 +0000 (14:46 +0200)]
server: (router) add LRU scheduler (#26572)

* add lru_sched

* handle coalescing (req leaves waiting queue)

* add tests

* fix stream case

* address review comments

4 weeks agoserver: (router) do not evict busy models (#26567)
Xuan-Son Nguyen [Fri, 7 Aug 2026 12:39:59 +0000 (14:39 +0200)]
server: (router) do not evict busy models (#26567)

4 weeks agomtmd: stop feeding the text stream again during Qwen3-TTS generation (#26706)
Pascal [Fri, 7 Aug 2026 11:32:52 +0000 (13:32 +0200)]
mtmd: stop feeding the text stream again during Qwen3-TTS generation (#26706)

The reference implementation has two mutually exclusive prompt layouts.
In non streaming mode the prefill carries the whole utterance text plus
tts_eos summed with codec_pad, and the trailing text hidden collapses to
a single tts_pad row. In streaming mode the prefill carries only the
first text token and the trailing rows stream the rest of the text
followed by tts_eos.

The pipeline built the non streaming prefill but the streaming overlay,
so the talker saw the utterance a second time during generation and read
it twice before emitting codec_eos.

The overlay is now the single tts_pad row that matches the prefill.

4 weeks agoggml : add aarch64 HWCAP fallbacks and fix fp16 variant detection (#25554)
Kilian Hu [Fri, 7 Aug 2026 11:07:10 +0000 (13:07 +0200)]
ggml : add aarch64 HWCAP fallbacks and fix fp16 variant detection (#25554)

* ggml : add fallback definitions for missing aarch64 HWCAP bits

* ggml : require HWCAP_ASIMDHP for the aarch64 fp16 cpu variants

Also rename has_fp16_va to has_fp16, the field gates the whole FEAT_FP16
extension, scalar and vector half-precision arithmetic together.

4 weeks agoui: read model modalities from the router model list (#26709)
Pascal [Fri, 7 Aug 2026 10:07:58 +0000 (12:07 +0200)]
ui: read model modalities from the router model list (#26709)

* ui: read model modalities from the router model list

The router advertises input modalities for every model, loaded or not.
Reading them at list build time lets the UI accept image and audio
uploads for a model selected through ?model=, which has no /props yet.

* enum

4 weeks agoMitigate crashing issue on Windows MSYS2 UCRT64 environment (GCC 16.1.0) (#26555)
Masato Nakasaka [Fri, 7 Aug 2026 09:17:16 +0000 (02:17 -0700)]
Mitigate crashing issue on Windows MSYS2 UCRT64 environment (GCC 16.1.0) (#26555)

4 weeks agosycl: fix UE4M3 parsing (#25608)
Chris Lee [Fri, 7 Aug 2026 05:28:53 +0000 (23:28 -0600)]
sycl: fix UE4M3 parsing (#25608)

The NVFP4 quantization format stores a scaling factor for every group of
16 weights, packed into a single UE4M3 byte.

The SYCL GPU code was converting these scale values using the E4M3 path,
but that's *signed*, and these are unsigned values.

4 weeks agosycl: *glu flat path (#26354)
Titaniumtown [Fri, 7 Aug 2026 05:24:40 +0000 (22:24 -0700)]
sycl: *glu flat path (#26354)

* tests: add SWIGLU perf cases

perf mode had no GLU coverage. Adds SWIGLU at 17408 columns, 512 and
2048 tokens, f16 and f32, with the operands both fused and split.

* sycl: consolidate fused-GLU kernels

They differed only in which op_* they called, so take the op as an argument and share a common launcher.
Their block sizes were all 256, so launch geometry is unchanged;
SYCL_GELU_BLOCK_SIZE and SYCL_SILU_BLOCK_SIZE lose their last users so are dropped.

* sycl: contiguous fast path for the fused GLU ops

o0 == n and o1 == n collapse the de-interleave index math to the
identity, so dispatch a flat kernel in that case. It fires for
ggml_glu_split with packed operands; a fused [gate|up] tensor keeps the
strided path. test-backend-ops perf -o SWIGLU on an Arc Pro B70: split
+14% f16 and +4% f32, fused unchanged.

4 weeks agosycl : Support DSv4 OPs: LIGHTNING_INDEXER,DSV4_HC_COMB,DSV4_HC_POST,DSV4_HC_PRE...
Neo Zhang [Fri, 7 Aug 2026 05:22:23 +0000 (13:22 +0800)]
sycl : Support DSv4 OPs: LIGHTNING_INDEXER,DSV4_HC_COMB,DSV4_HC_POST,DSV4_HC_PRE (#26568)

* support DSv4 OPs: LIGHTNING_INDEXER,DSV4_HC_COMB,DSV4_HC_POST,DSV4_HC_PREwq

* update ops.md

* fix format issue

4 weeks agosycl : update guide Q&A and script for device setting (#26442)
Neo Zhang [Fri, 7 Aug 2026 05:18:47 +0000 (13:18 +0800)]
sycl : update guide Q&A and script for device setting (#26442)

4 weeks agosycl : fix error Error OP FLASH_ATTN_EXT on arc770 (#26441)
Neo Zhang [Fri, 7 Aug 2026 05:17:56 +0000 (13:17 +0800)]
sycl : fix error Error OP FLASH_ATTN_EXT on arc770 (#26441)

4 weeks agosycl : enhance OP set_rows to support all missed data types (#26515)
Neo Zhang [Fri, 7 Aug 2026 04:52:52 +0000 (12:52 +0800)]
sycl : enhance OP set_rows to support all missed data types (#26515)

* support fp16 to fp16/fp32

* support all missed data types in set_rows

* refactor the code to support all data types

4 weeks agocuda: fix warnings for unused variable/function (#26688)
David Friehs [Fri, 7 Aug 2026 04:51:56 +0000 (06:51 +0200)]
cuda: fix warnings for unused variable/function (#26688)

4 weeks agoci: abort if build requirements are missing (#26368)
Niklas Wenzel [Fri, 7 Aug 2026 04:50:48 +0000 (06:50 +0200)]
ci: abort if build requirements are missing (#26368)

1. Abort CI if build requirements are missing.
2. Add check to make sure Git LFS has been configured.
3. Add trailing newlines to log messages.

4 weeks agometal : avoid `threadgroup` matrix array instantiation in kernel_lightning_indexer...
JamePeng [Fri, 7 Aug 2026 04:49:14 +0000 (12:49 +0800)]
metal : avoid `threadgroup` matrix array instantiation in kernel_lightning_indexer (#26646)

- In MSL, declaring an array of matrix types like `threadgroup half4x4` causes
a 'no matching constructor' compilation error because MSL matrix types do not
have zero-argument default constructors and threadgroup variables cannot have
initializers.

- Fix this by declaring a POD `threadgroup half` array instead and casting
to `threadgroup half4x4 *` for matrix indexing.

Signed-off-by: JamePeng <redacted>
4 weeks agomtmd: add chunk save/load function (#26645)
Xuan-Son Nguyen [Thu, 6 Aug 2026 17:46:40 +0000 (19:46 +0200)]
mtmd: add chunk save/load function (#26645)

* mtmd: add chunk save/load function

* nits

* add tests

* rn _MAX --> _COUNT

4 weeks agoserver: fix empty response for /cors-proxy (#26656)
Xuan-Son Nguyen [Thu, 6 Aug 2026 13:07:22 +0000 (15:07 +0200)]
server: fix empty response for /cors-proxy (#26656)

4 weeks agoconvert : fix DeepseekV4 rope parameters with transformers 5.x (#26673)
Sigbjørn Skjæret [Thu, 6 Aug 2026 13:06:52 +0000 (15:06 +0200)]
convert : fix DeepseekV4 rope parameters with transformers 5.x (#26673)

4 weeks agomodel-loader : fix quantized reshaped tensor strides (#26672)
Georgi Gerganov [Thu, 6 Aug 2026 12:21:44 +0000 (15:21 +0300)]
model-loader : fix quantized reshaped tensor strides (#26672)

4 weeks agoconvert : accept "ExaoneMoeForCausalLM" arch spelling (#26660)
Csaba Kecskemeti [Thu, 6 Aug 2026 10:56:04 +0000 (03:56 -0700)]
convert : accept "ExaoneMoeForCausalLM" arch spelling (#26660)

4 weeks agoci : onboard AMD ROCm CI with gfx1151 fixes (#26544)
Jim Wu [Thu, 6 Aug 2026 08:43:26 +0000 (01:43 -0700)]
ci : onboard AMD ROCm CI with gfx1151 fixes (#26544)

* ci: prepare for amd rocm ci

Signed-off-by: Aaron Teo <redacted>
* ci: fix editorconfig-checker

Signed-off-by: Aaron Teo <redacted>
* ci: fix device not recognised

Signed-off-by: Aaron Teo <redacted>
* ci: rename gpu-amd to gpu-hip

Signed-off-by: Aaron Teo <redacted>
* ci: gpu-hip to gpu-rocm

haha

Signed-off-by: Aaron Teo <redacted>
* CUDA: allow integrated-GPU host output buffer in debug assert

On integrated GPUs (APUs), the scheduler can legitimately place a graph
node's output on the host-visible buffer, which ggml_cuda_compute_forward
already handles. The debug assert in ggml_cuda_graph_evaluate_and_capture
required every node output to be on the device buffer, so a debug build
aborts on such a node (e.g. attn_residual ADD -> ROCm_Host on RDNA3.5).
The source-tensor assert directly below already permits this via the
integrated + cuda_host exception; apply the same exception to the node's
own output buffer. Debug-only; no effect on release/compute.

Fixes test-recurrent-state-rollback on gfx1151 (Strix Halo).

* ci: enable unified memory for ROCm gfx1151 job

Work around a coherence issue on integrated RDNA3.5 (gfx1151) where GPU
kernels reading mmap-loaded weights can return incorrect output, which
makes test-llama-archs (and real inference) intermittently wrong.
GGML_CUDA_ENABLE_UNIFIED_MEMORY=1 uses managed memory, which restores
coherence. Remove once the underlying ROCm/HIP issue is fixed.

* test-llama-archs: skip jamba on HIP backend

jamba produces incorrect output (~0.55 NMSE vs CPU) on the HIP backend on
RDNA3.5 (gfx1151); the SSM kernels need separate investigation. Skip it
for now, matching the existing per-backend carve-outs (WebGPU), so the
ROCm CI can run the test for the remaining architectures.

* ci: use HIP_LAUNCH_BLOCKING for ROCm gfx1151 job

The gfx1151 ROCm CI job produced incorrect inference output (qwen3 perplexity ~88 vs ~9.4) due to an async-execution correctness issue in the HIP path. Serializing kernel launches with HIP_LAUNCH_BLOCKING=1 restores correctness. This replaces the earlier GGML_CUDA_ENABLE_UNIFIED_MEMORY workaround, which did not fix batched inference.

* test-backend-sampler: skip top-k subtests on HIP backend

The ROCm backend does not support the TOP_K/ARGSORT op at vocab scale (no CUB; bitonic argsort is capped at ncols <= 1024), so top-k/top-p backend samplers cannot be offloaded. The penalties, set_sampler, mixed, and top_p subtests assert that offload happened, so they fail on HIP. Skip them until TOP_K is supported on the ROCm backend.

* Update tests/test-backend-sampler.cpp

Co-authored-by: Aaron Teo <redacted>
* Update tests/test-backend-sampler.cpp

Co-authored-by: Georgi Gerganov <redacted>
---------

Signed-off-by: Aaron Teo <redacted>
Co-authored-by: Aaron Teo <redacted>
Co-authored-by: Jim Wu <redacted>
Co-authored-by: Aaron Teo <redacted>
Co-authored-by: Georgi Gerganov <redacted>
4 weeks agomodel-conversion : add --model-name to conversion scripts (#26665)
Daniel Bevenius [Thu, 6 Aug 2026 07:38:06 +0000 (09:38 +0200)]
model-conversion : add --model-name to conversion scripts (#26665)

This commit adds the --model-name flag to the causual and embedding
model conversion scripts.

The motivation for this is that this is the name used for the metadata
field general.name and it can be useful to specify this explicitely if
the default (the basename of the model path) is not what we want.

4 weeks agovulkan: fix submission batching size, add debug tools for diagnosing causes of Device...
Ruben Ortlam [Thu, 6 Aug 2026 07:24:13 +0000 (09:24 +0200)]
vulkan: fix submission batching size, add debug tools for diagnosing causes of DeviceLost drivers errors (#26371)

* vulkan: add debug tooling to get more information about a DeviceLost error

* fix submission threshold applied too late

* use logging macros, throw instead of aborting

* clean up circular dependency

4 weeks agomtmd/ggml: add ggml_build_forward_order (#26649)
Pascal [Wed, 5 Aug 2026 22:47:59 +0000 (00:47 +0200)]
mtmd/ggml: add ggml_build_forward_order (#26649)

* ggml: add ggml_build_forward_order

ggml_build_forward_expand marks the tensor and all its ancestors for
compute, so using it as a pure ordering hint (keeping q, k and v
together) defeats ggml_build_forward_select: the unselected branch is
forced to run with inputs that were never uploaded. In the mtmd audio
graph this makes GEN_WAV calls execute the GEN_CODE branch with a
stale inp_code0, hitting the get_rows bound assert on CPU.

Add ggml_build_forward_order, which inserts nodes without the compute
flag; the flag is restored when the branch is actually selected.
Switch the q/k/v hints in clip_graph::build_attn to it.

* nit: reduce comments (AGENTS.md)

4 weeks agoserver: harden the file_glob_search directory walk (#26626)
Pascal [Wed, 5 Aug 2026 19:31:54 +0000 (21:31 +0200)]
server: harden the file_glob_search directory walk (#26626)

* server: don't walk Windows junctions in file_glob_search

std::filesystem reports a junction as a plain directory, so the symlink
guard misses it and a junction pointing back at an ancestor is walked
until the path length gives out

read the reparse tag and treat a symlink and a mount point as links,
leaving any other reparse point walkable so cloud placeholders and dedup
stubs still get searched

look junk directory names up case insensitively on Windows, where NTFS
makes Build the same directory as build

test that a junk directory stays selectable while its contents stay out
of search results

* server: report a directory the walk could not read

a directory that fails to open or to iterate was skipped in silence, so
a caller got a listing that looked complete while a whole subtree was
missing: a path over the platform limit, a volume going away, a name the
filesystem rejects

skip_permission_denied never reaches this path, so an error here is an
incomplete answer rather than a deliberate omission, and it now sets the
truncated flag

* server: simplify the file_glob_search listing plumbing

return a small result struct instead of two out params and a caller path
that only fed an error string, taking list_entries from six parameters
down to three

scope the error code to the directory being read, act on the status code
the entry lookups already returned, and treat an unreadable link state as
a link so the walk never descends on a guess

check the deadline when a directory is popped, not only per entry, so a
tree of empty directories cannot outlive the budget

read the path parameter once, and reject an invalid limit the way an
invalid type is already rejected, instead of silently falling back

normalize the resolved path, so a "." or ".." a caller typed reaches
neither git nor the client, and return the generic path form with '/'
separators on every platform, so the base sent to clients no longer needs
a local fixup

* ui: expire cached picker searches

the cache grew for the lifetime of the component: entries went stale
after the TTL but were never removed, so every distinct query typed in a
session stayed in memory

drop expired entries when a new result is stored

* server: address review from @ngxson

trim comments to one line each, and drop two that restate the code

rename junk_lookup_name to get_effective_name, and move it and the link
check to private static members next to junk_dir_names

merge the Windows and Linux link checks into one is_link, so symlinks are
checked everywhere and junctions only add to it on Windows

* server: convert tool paths as UTF-8 on Windows

a narrow path uses the active code page there, so a file name came back
mangled and a path with an accent could not be opened at all

convert explicitly at every crossing between a std::string, which always
carries UTF-8 here, and fs::path

read the home directory through the wide environment, since the narrow
one returns the profile path in the active code page too

the walker no longer normalizes separators by hand, since paths now come
back in generic form

* server: fold the platform branch inside console_output_to_utf8

match the shape of the other helpers, one definition with the #if inside,
instead of two definitions wrapped in #if and #else

inline the single caller helper and trim the comment

4 weeks agotests: re-enable MiniMax M3 in `test-llama-archs` (#26633)
Niklas Wenzel [Wed, 5 Aug 2026 15:58:34 +0000 (17:58 +0200)]
tests: re-enable MiniMax M3 in `test-llama-archs` (#26633)

4 weeks agomtmd: Unlimited-OCR fix max_tiles, setting in converter (#25614)
Saba Fallah [Wed, 5 Aug 2026 13:30:14 +0000 (15:30 +0200)]
mtmd: Unlimited-OCR fix max_tiles, setting in converter (#25614)

4 weeks agogrammar : degrade max repetition >= 2000 to unbounded (#26613)
Aldehir Rojas [Wed, 5 Aug 2026 12:39:10 +0000 (07:39 -0500)]
grammar : degrade max repetition >= 2000 to unbounded (#26613)

4 weeks agomtmd: support multi-row batching for deepseek-ocr (#26154)
Xuan-Son Nguyen [Wed, 5 Aug 2026 11:34:52 +0000 (13:34 +0200)]
mtmd: support multi-row batching for deepseek-ocr (#26154)

* mtmd: support multi-row batching for deepseek-ocr

* mtmd: weave deepseek-ocr rows in one shot instead of per row (#26615)

---------

Co-authored-by: Saba Fallah <redacted>
4 weeks agofit: Fix memory allocation for MTP layers (#26605)
Sergey Malinin [Wed, 5 Aug 2026 11:29:45 +0000 (14:29 +0300)]
fit: Fix memory allocation for MTP layers (#26605)

4 weeks agosecurity : clarify about AI-generated reports (#26579)
Xuan-Son Nguyen [Wed, 5 Aug 2026 11:27:06 +0000 (13:27 +0200)]
security : clarify about AI-generated reports (#26579)

* security : clarify about AI-generated reports

* nits

* nits 2

4 weeks agoserver: Adding spec-decode counters to /metrics endpoint (#26389)
Bhavik Sharda [Wed, 5 Aug 2026 10:36:01 +0000 (16:06 +0530)]
server: Adding spec-decode counters to /metrics endpoint (#26389)

* * server: add spec-decode counters to /metrics endpoint

* server: fixed review comments and now aligned param names exactly with vLLM.

5 weeks agoconvert: Add endianness conversion for Q1 and TQ2 quantizations (#26618)
Andreas Krebbel [Wed, 5 Aug 2026 10:06:09 +0000 (12:06 +0200)]
convert: Add endianness conversion for Q1 and TQ2 quantizations (#26618)

* Add endianness conversion for Q1 and TQ2 quantizations

* lint

---------

Co-authored-by: Sigbjørn Skjæret <redacted>
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>