]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/log
pkg/ggml/sources/llama.cpp
4 months agoserver: tests: fetch random media marker via /apply-template (#21962) (#21980)
Pascal [Thu, 16 Apr 2026 17:46:21 +0000 (19:46 +0200)]
server: tests: fetch random media marker via /apply-template (#21962) (#21980)

* server: tests: fetch random media marker via /apply-template (#21962 fix)

* server: allow pinning media marker via LLAMA_MEDIA_MARKER env var

get_media_marker() checks LLAMA_MEDIA_MARKER at first call and uses it
as-is if set, falling back to the random marker otherwise.

Tests no longer need to fetch the marker dynamically via /apply-template:
the fixture sets LLAMA_MEDIA_MARKER=<__media__> so the hardcoded prompts
work as before.

Address review feedback from ngxson

* server: make get_media_marker() thread-safe via magic statics

Use a C++11 static local with a lambda initializer instead of a global
static with an empty-check. The runtime guarantees initialization exactly
once without explicit locking.

Address review feedback from ggerganov

* nits

* nits

4 months agomodel : refactor QKV into common build_qkv and create_tensor_qkv helpers (#21245)
PikaPikachu [Thu, 16 Apr 2026 15:41:34 +0000 (23:41 +0800)]
model : refactor QKV into common build_qkv and create_tensor_qkv helpers (#21245)

* model : refactor QKV into common build_qkv and create_tensor_qkv helpers

* model : extend build_qkv to bert/mpt/dbrx/olmo/lfm2/nemotron-h/granite-hybrid/gemma3n-iswa/t5-dec and fix wqkv_s

4 months agomodel : support NVFP4 tensors for Gemma4 (#21971)
Sigbjørn Skjæret [Thu, 16 Apr 2026 14:51:47 +0000 (16:51 +0200)]
model : support NVFP4 tensors for Gemma4 (#21971)

* support nvfp4 tensors for Gemma4

* add wo_s to build_attn

* add wo_s to build_attn

* fix glm4

4 months agocodeowners: add team member comments (#21714)
Ruben Ortlam [Thu, 16 Apr 2026 10:13:11 +0000 (12:13 +0200)]
codeowners: add team member comments (#21714)

4 months agoConvert: Fix NemotronH Config Parsing (#21664)
Anav Prasad [Thu, 16 Apr 2026 10:11:45 +0000 (10:11 +0000)]
Convert: Fix NemotronH Config Parsing (#21664)

* fix NemotronH vocab loading by using trust_remote_code for unsupported config patterns

* fix NemotronH tokenizer loading by overriding set_vocab with trust_remote_code

4 months agoggml: add graph_reused (#21764)
Aman Gupta [Thu, 16 Apr 2026 09:21:28 +0000 (17:21 +0800)]
ggml: add graph_reused (#21764)

* ggml: add graph_reused

* use versioning instead of reuse flag

* increment version with atomic

* use top bits for split numbering

* add assert

* move counter to ggml.c

* set uid in split_graph only

* fix windows

* address further review comments

* get next_uid rather than doing bit manipulation

* rename + add comment about uid

4 months agometal: Implement ROLL op (#21946)
Kusha Gharahi [Thu, 16 Apr 2026 08:54:37 +0000 (03:54 -0500)]
metal: Implement ROLL op (#21946)

* nix: support unified apple-sdk

* Impl roll op for Metal

* Revert "nix: support unified apple-sdk"

This reverts commit abfa473360471532c547de8b202c780507924d4b.

* update ops.md

* update op docs

4 months agoggml-cpu: add 128-bit RVV implementation for Quantization Vector Dot (#20633)
rehan-10xengineer [Thu, 16 Apr 2026 08:15:15 +0000 (13:15 +0500)]
ggml-cpu: add 128-bit RVV implementation for Quantization Vector Dot (#20633)

* ggml-cpu: add 128-bit impls for i-quants, ternary quants

* ggml-cpu: add 128-bit impls for iq2_xs, iq3_s, iq3_xxs, tq2_0

Co-authored-by: Rehan Qasim <redacted>
* ggml-cpu: refactor; add rvv checks

---------

Co-authored-by: taimur-10x <redacted>
Co-authored-by: Rehan Qasim <redacted>
4 months agoggml : implemented simd_gemm kernel for riscv vector extension (#20627)
rehan-10xengineer [Thu, 16 Apr 2026 08:14:26 +0000 (13:14 +0500)]
ggml : implemented simd_gemm kernel for riscv vector extension (#20627)

Co-authored-by: Rehan Qasim <redacted>
4 months agodevops : added spirv-headers to nix (#21965)
Yuannan [Thu, 16 Apr 2026 08:12:52 +0000 (08:12 +0000)]
devops : added spirv-headers to nix (#21965)

4 months agoggml-webgpu: compute pass batching and removing profiling overhead (#21873)
Reese Levine [Thu, 16 Apr 2026 08:12:19 +0000 (01:12 -0700)]
ggml-webgpu: compute pass batching and removing profiling overhead (#21873)

* Update register tiling matmul to use f32 accumulation

* fix profiling code

* Fix register tiling matmul for chrome, i'm blaming dawn

* Update batch tuning value for iOS

* compile fix

* Fix use of new load function

* Move to a single query set for GPU profiling

* Move to batching compute passes when not profiling

* Refactor build_multi

* remove iOS throttling now that we're batching compute passes

4 months agoci : Use ggml-org/ccache-action on RISC-V as well (#21632)
Ludovic Henry [Thu, 16 Apr 2026 08:11:25 +0000 (10:11 +0200)]
ci : Use ggml-org/ccache-action on RISC-V as well (#21632)

4 months ago[SYCL] Fix Q8_0 reorder: garbage on 2nd prompt + crash on full VRAM (#21638)
Katostrofik [Thu, 16 Apr 2026 05:34:05 +0000 (01:34 -0400)]
[SYCL] Fix Q8_0 reorder: garbage on 2nd prompt + crash on full VRAM (#21638)

* [SYCL] Fix Q8_0 reorder: add missing dequantize path for GEMM

The Q8_0 reorder optimization (#21527) was missing a reorder-aware
dequantizer for the GEMM code path used during prompt processing.
After token generation reordered Q8_0 weights (via DMMV/MMVQ), the
next prompt processing pass would read them with the standard
dequantizer, producing garbage output.

Add dequantize_block_q8_0_reorder() and wire it into both
ggml_get_to_fp16_sycl() and ggml_get_to_fp32_sycl(), matching the
pattern already used by Q4_0, Q4_K, and Q6_K.

Fixes #21589

AI (Claude) was used to assist with root cause investigation and
writing the kernel code. All code was human-reviewed and tested
on real hardware.

* SYCL: fix reorder crash when device memory is full

The reorder optimization allocates a temporary buffer the full size of
the weight tensor on the device. When VRAM is nearly full (large models
on a single GPU), this allocation fails and the subsequent memcpy crashes
on a NULL pointer.

Fix: try device allocation first, fall back to host memory if device
memory is full. The reorder kernel still works correctly reading from
host memory over PCIe. This is slower for the one-time reorder (~21 t/s
vs ~38 t/s on Intel Arc Pro B70), but the optimization is preserved for
all subsequent inference. If both device and host allocation fail, skip
the reorder and fall back to the unoptimized kernel path.

Also fixes a bug where opt_for_reorder() marked tensors as reordered
even when the reorder was skipped due to allocation failure. This caused
DMMV/MMVQ kernels to read the original AoS data as if it were SoA,
producing garbage output or NaN results.

Tested on Intel Arc Pro B70 (32GB) with Q8_0, Q4_K_M models. Coding was
AI-assisted (Claude), reviewed and tested on hardware by a human.

Fixes #20478

* SYCL: add RAII temp buffer class + macro guard for host fallback

Replace sycl_ext_malloc_with_fallback/sycl_ext_free_fallback free
functions with sycl_reorder_temp_buffer RAII class. The host_fallback
bool is now a private member, and cleanup happens automatically at
scope exit.

Add GGML_SYCL_HOST_MEM_FALLBACK cmake option (default ON) to guard
the host memory fallback code path. Device access to host memory
requires Linux kernel 6.8+ (Ubuntu 26.04+); users on older kernels
can set -DGGML_SYCL_HOST_MEM_FALLBACK=OFF to disable it.

Addresses arthw's review on PR #21638.

Co-Authored-By: Claude Opus 4.6 (1M context) <redacted>
* SYCL: document GGML_SYCL_HOST_MEM_FALLBACK build option in SYCL.md

Co-Authored-By: Claude Opus 4.6 (1M context) <redacted>
* SYCL: add reorder-aware DMMV dequantizers for Q4_K and Q6_K

Q4_K and Q6_K had reorder support for MMVQ and GEMM paths but not
DMMV. When the DMMV path encountered reordered data it would abort.

Add DMMV kernels that read from the SOA reorder layout for both
types. Same math as the non-reorder versions, different memory
access pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <redacted>
---------

Co-authored-by: Claude Opus 4.6 (1M context) <redacted>
4 months agoserver: use random media marker (#21962)
Xuan-Son Nguyen [Wed, 15 Apr 2026 21:52:22 +0000 (23:52 +0200)]
server: use random media marker (#21962)

* server: use random media marker

* nits

* remove legacy <__image__> token

* revert special char in random

4 months agovulkan: optimize im2col (#21713)
Ruben Ortlam [Wed, 15 Apr 2026 17:04:51 +0000 (19:04 +0200)]
vulkan: optimize im2col (#21713)

* vulkan: improve im2col memory write layout

* cap workgroups

* minimal device tuning

* use vendor_id instead of subgroup size

4 months agocuda: Q1_0 initial backend (#21629)
Pasha Khosravi [Wed, 15 Apr 2026 16:38:38 +0000 (09:38 -0700)]
cuda: Q1_0 initial backend (#21629)

* [cuda] initial Q1_0 backend

* remove unused code, fix AMD MMA guard

* attempt to support dp4a

* Apply suggestions from code review

Co-authored-by: Johannes Gäßler <redacted>
---------

Co-authored-by: Johannes Gäßler <redacted>
4 months agoggml-webgpu: Fix dequantization helpers to not pass in pointers (#21872)
Reese Levine [Wed, 15 Apr 2026 16:14:40 +0000 (09:14 -0700)]
ggml-webgpu: Fix dequantization helpers to not pass in pointers (#21872)

* Fix dequantization helpers to not pass in pointers

* Increase XIELU precision

4 months agoCUDA: require explicit opt-in for P2P access (#21910)
Johannes Gäßler [Wed, 15 Apr 2026 14:01:46 +0000 (16:01 +0200)]
CUDA: require explicit opt-in for P2P access (#21910)

4 months agoCUDA: manage NCCL communicators in context (#21891)
Johannes Gäßler [Wed, 15 Apr 2026 13:58:40 +0000 (15:58 +0200)]
CUDA: manage NCCL communicators in context (#21891)

* CUDA: manage NCCL communicators in context

* add check that all backends are CUDA

* remove unused vector, limit init to > 1 GPUs

* fix warnings

* fix cuda device, cache allreduce

4 months agorpc : add native RDMA transport for RPC backend (RoCEv2) (#20590)
Valeriy Dubov [Wed, 15 Apr 2026 13:44:02 +0000 (16:44 +0300)]
rpc : add native RDMA transport for RPC backend (RoCEv2) (#20590)

4 months agodocs: more extensive RoPE documentation [no ci] (#21953)
Xuan-Son Nguyen [Wed, 15 Apr 2026 12:45:16 +0000 (14:45 +0200)]
docs: more extensive RoPE documentation [no ci] (#21953)

* more extensive ggml_rope documentation

* add more docs

* nits

4 months agoci: disable test-backend-ops on Vulkan llvmpipe run and resture default timeout ...
Ruben Ortlam [Wed, 15 Apr 2026 08:55:21 +0000 (10:55 +0200)]
ci: disable test-backend-ops on Vulkan llvmpipe run and resture default timeout (#21901)

4 months agoautoparser: support case of JSON_NATIVE with per-call markers (test case: Reka-Edge...
Piotr Wilkin (ilintar) [Wed, 15 Apr 2026 08:51:50 +0000 (10:51 +0200)]
autoparser: support case of JSON_NATIVE with per-call markers (test case: Reka-Edge) (#21892)

4 months agoread n_ctx back after making llama_context (#21939)
Matt [Wed, 15 Apr 2026 07:24:57 +0000 (00:24 -0700)]
read n_ctx back after making llama_context (#21939)

4 months agohexagon: optimization for HMX mat_mul (#21554)
Yiwei Shao [Tue, 14 Apr 2026 21:09:03 +0000 (14:09 -0700)]
hexagon: optimization for HMX mat_mul (#21554)

* hexagon: add async HMX worker

Introduce hmx-worker (dedicated thread for HMX compute) to overlap HMX
matmul with HVX dequant/DMA stages in the pipeline path, replacing the
previous synchronous HMX calls that blocked the main thread.

* hexagon: cost-based VTCM chunk search for out-stationary matmul

* hexagon: fix futex race in hmx_worker_drain
Store the boolean to local variable avoid atomic load twice

* hex-mm: hmx optimize scatter/transpose and use HMX intrinsics

* hex-vmem: drop vmem limit a touch under 3GB on v73

* hexagon: add fwd declaration of htp_context

* hex-hmx: replace hmx-worker with hmx-queue that mimics dma-queue interface

Simplifies the overall implemantion, reduces thread wakeup roundtrips.

* hex-mm: add debug log to hmx work func called from hmx-queue

* Update hmx-queue.h

Co-authored-by: Max Krasnyansky <redacted>
---------

Co-authored-by: Kim-Chyan Gan <redacted>
Co-authored-by: Max Krasnyansky <redacted>
Co-authored-by: Max Krasnyansky <redacted>
4 months agoggml : remove ggml-ext.h (#21869)
Xuan-Son Nguyen [Tue, 14 Apr 2026 14:32:58 +0000 (16:32 +0200)]
ggml : remove ggml-ext.h (#21869)

* ggml: correct placement of ggml-ext.h

* ggml : remove ggml-ext.h

---------

Co-authored-by: Georgi Gerganov <redacted>
4 months agometal : fix FA support logic (#21898)
Georgi Gerganov [Tue, 14 Apr 2026 14:32:29 +0000 (17:32 +0300)]
metal : fix FA support logic (#21898)

4 months agomtmd: add mtmd_image_tokens_get_decoder_pos() API (#21851)
Xuan-Son Nguyen [Tue, 14 Apr 2026 14:07:41 +0000 (16:07 +0200)]
mtmd: add mtmd_image_tokens_get_decoder_pos() API (#21851)

* mtmd: add mtmd_image_tokens_get_decoder_pos() API

* consistent naming

* fix build

4 months agovulkan: Programmatically add RoundingModeRTE to all shaders when the device supports...
Jeff Bolz [Tue, 14 Apr 2026 13:17:45 +0000 (15:17 +0200)]
vulkan: Programmatically add RoundingModeRTE to all shaders when the device supports it (#21572)

* vulkan: Programmatically add RoundingModeRTE to all shaders when the device supports it

* use FetchContent to get SPIRV-Headers

* Fetch spirv-headers unconditionally

* remove fetchcontent, rely on installed headers

* fix ubuntu job

* Update docs/build.md

4 months agoci : re-enable mac workflows (#21894)
Georgi Gerganov [Tue, 14 Apr 2026 12:58:09 +0000 (15:58 +0300)]
ci : re-enable mac workflows (#21894)

* ci : re-enable mac workflows

* vulkan : fix compile warning

4 months agometal : add XIELU unary op (#20802)
Seyoung Jeong [Tue, 14 Apr 2026 12:43:59 +0000 (21:43 +0900)]
metal : add XIELU unary op (#20802)

4 months agovendor : update BoringSSL to 0.20260413.0 (#21881)
Adrien Gallouët [Tue, 14 Apr 2026 11:25:09 +0000 (13:25 +0200)]
vendor : update BoringSSL to 0.20260413.0 (#21881)

Signed-off-by: Adrien Gallouët <redacted>
4 months agoggml : fix ARM NEON nvfp4 dot product on non-dotprod targets (#21559)
Richard Davison [Tue, 14 Apr 2026 11:23:45 +0000 (13:23 +0200)]
ggml : fix ARM NEON nvfp4 dot product on non-dotprod targets (#21559)

4 months agocmake: fix CMP0194 warning on Windows with MSVC (#21630)
texasich [Tue, 14 Apr 2026 10:47:56 +0000 (05:47 -0500)]
cmake: fix CMP0194 warning on Windows with MSVC (#21630)

* cmake: fix CMP0194 warning on Windows with MSVC

Set CMP0194 policy to NEW before project() call in ggml/CMakeLists.txt to suppress the "MSVC is not an assembler for language ASM" warning introduced in CMake 4.1.

The ggml project enables ASM globally for Metal (macOS) and KleidiAI (ARM) backends. On Windows/MSVC, no assembler sources are used, but CMake 4.1+ warns because cl.exe is not a valid ASM compiler.

This follows the same pattern used in ggml-vulkan (CMP0114, CMP0147).

Closes ggml-org/llama.cpp#20311

* cmake: apply cisc's formatting suggestion

---------

Co-authored-by: texasich <redacted>
4 months agoggml-webgpu: Update register tiling matmul to use f32 accumulation (#21644)
Reese Levine [Tue, 14 Apr 2026 10:46:41 +0000 (03:46 -0700)]
ggml-webgpu: Update register tiling matmul to use f32 accumulation (#21644)

* Update register tiling matmul to use f32 accumulation

* fix profiling code

* Fix register tiling matmul for chrome, i'm blaming dawn

* Update batch tuning value for iOS

* compile fix

* Fix use of new load function

4 months agocommon: skip reasoning budget sampler when no budget is requested (#21870)
Berk Idem [Tue, 14 Apr 2026 10:43:06 +0000 (06:43 -0400)]
common: skip reasoning budget sampler when no budget is requested (#21870)

* common: skip reasoning budget sampler when no budget is requested

After I added thinking_start_tag / thinking_end_tag for gemma4 in #21697, the reasoning budget sampler gets unconditionally created even when no budget is configured (the default -1). The same applies to kimi_k2, lfm2, lfm2_5, and ministral_3 which also set these tags. The budget gets converted to INT_MAX, so the sampler never actually forces any tokens but still runs per-token checks (start tag matching in IDLE state, token-to-piece conversion + UTF-8 checks in COUNTING state).

More importantly, the mere existence of the sampler (non-null rbudget) disables backend sampling. Backend sampling lets the GPU select tokens directly, avoiding a full logits transfer from GPU to CPU every token. This could explain the 30% speed regression reported in #21784 (98 t/s to 70 t/s on Vulkan).

So I added a reasoning_budget_tokens >= 0 check to the sampler creation condition. When the budget is unlimited, the sampler is not created, backend sampling stays enabled, and no per-token overhead is added. When a budget is explicitly set (0, 128, 1024, etc.), the sampler is created and works as before.

* common: preserve rbudget when grammar is lazy

Following up on the review feedback on #21870: keep the reasoning budget sampler when grammar_lazy is true, so the thinking-block grammar suppression from #20970 still works when tools are in use. This way, we only skip the sampler when both no budget is set AND grammar is not lazy.

4 months agovulkan: Support GGML_TYPE_NVFP4 (#21455)
Jeff Bolz [Tue, 14 Apr 2026 09:34:23 +0000 (11:34 +0200)]
vulkan: Support GGML_TYPE_NVFP4 (#21455)

This adds nvfp4 support for get_rows, dequant, and mul_mat(_id). For
mul_mat, it does not add support for the dp4/q8_1 path, it's all via
fp16/fp32.

4 months agoserver: support OAI /v1/audio/transcriptions API (#21863)
Xuan-Son Nguyen [Tue, 14 Apr 2026 09:09:52 +0000 (11:09 +0200)]
server: support OAI /v1/audio/transcriptions API (#21863)

* server: support OAI /v1/audio/transcriptions API

* address autoreview comments

* correct default response_format value

4 months agocommon/gemma4 : handle parsing edge cases (#21760)
Aldehir Rojas [Mon, 13 Apr 2026 23:18:18 +0000 (18:18 -0500)]
common/gemma4 : handle parsing edge cases (#21760)

4 months agodocs: listing qwen3-asr and qwen3-omni as supported (#21857)
Xuan-Son Nguyen [Mon, 13 Apr 2026 20:28:17 +0000 (22:28 +0200)]
docs: listing qwen3-asr and qwen3-omni as supported (#21857)

* docs: listing qwen3-asr and qwen3-omni as supported

* nits

4 months agochat: dedicated DeepSeek v3.2 parser + "official" template (#21785)
Piotr Wilkin (ilintar) [Mon, 13 Apr 2026 20:23:53 +0000 (22:23 +0200)]
chat: dedicated DeepSeek v3.2 parser + "official" template (#21785)

4 months agoci: Also exempt 'security' tag from auto-close (#21844)
Christian Kastner [Mon, 13 Apr 2026 17:18:44 +0000 (19:18 +0200)]
ci: Also exempt 'security' tag from auto-close (#21844)

4 months agovulkan: Flash Attention DP4A shader for quantized KV cache (#20797)
Ruben Ortlam [Mon, 13 Apr 2026 12:21:31 +0000 (14:21 +0200)]
vulkan: Flash Attention DP4A shader for quantized KV cache (#20797)

* use integer dot product for quantized KV flash attention

* small improvements

* fix SHMEM_STAGING indexing

* add missing KV type quants

* fixes

* add supported quants to FA tests

* readd fast paths for <8bit quants

* fix mmq gate and shmem checks

4 months agocommon : add download cancellation and temp file cleanup (#21813)
Adrien Gallouët [Mon, 13 Apr 2026 09:18:23 +0000 (11:18 +0200)]
common : add download cancellation and temp file cleanup (#21813)

Signed-off-by: Adrien Gallouët <redacted>
4 months agoserver: Expose build_info in router mode (#21835)
Gaspard Petit [Mon, 13 Apr 2026 09:14:42 +0000 (05:14 -0400)]
server: Expose build_info in router mode (#21835)

4 months agoCUDA: Limit DeviceSegmentedSort to immediate mode (#21718)
Oliver Simons [Mon, 13 Apr 2026 09:14:06 +0000 (11:14 +0200)]
CUDA: Limit DeviceSegmentedSort to immediate mode (#21718)

* CUDA: Limit DeviceSegmentedSort to immediate mode

DeviceSegmentedSort is currently not capturable in a cuda graph. Hence,
we have to go for the slower DeviceSegmentedRadixSort in that case.

Perf numbers on RTX Pro 6000 Blackwell Max-Q:
DeviceSegmentedRadixSort in graph mode (i.e. CUDA Graphs)

  ARGSORT(type=f32,ne=[2048,512,1,1],order=1):                 12291 runs -   105.94 us/run -     8192 kB/run -   73.75 GB/s
  ARGSORT(type=f32,ne=[4096,512,1,1],order=1):                 10245 runs -   115.08 us/run -    16384 kB/run -  135.77 GB/s
  ARGSORT(type=f32,ne=[8192,512,1,1],order=1):                  5125 runs -   221.22 us/run -    32768 kB/run -  141.26 GB/s
  ARGSORT(type=f32,ne=[16384,512,1,1],order=1):                 2565 runs -   430.98 us/run -    65536 kB/run -  145.02 GB/s
  ARGSORT(type=f32,ne=[32768,512,1,1],order=1):                 1028 runs -  1185.83 us/run -   131072 kB/run -  105.41 GB/s
  ARGSORT(type=f32,ne=[65536,512,1,1],order=1):                  387 runs -  2748.62 us/run -   262144 kB/run -   90.95 GB/s

DeviceSegmentedSort in immediate mode

  ARGSORT(type=f32,ne=[2048,512,1,1],order=1):                 16388 runs -    71.17 us/run -     8192 kB/run -  109.78 GB/s
  ARGSORT(type=f32,ne=[4096,512,1,1],order=1):                 12294 runs -    81.38 us/run -    16384 kB/run -  192.00 GB/s
  ARGSORT(type=f32,ne=[8192,512,1,1],order=1):                  5125 runs -   240.81 us/run -    32768 kB/run -  129.77 GB/s
  ARGSORT(type=f32,ne=[16384,512,1,1],order=1):                 2565 runs -   406.60 us/run -    65536 kB/run -  153.71 GB/s
  ARGSORT(type=f32,ne=[32768,512,1,1],order=1):                 1285 runs -   873.23 us/run -   131072 kB/run -  143.15 GB/s
  ARGSORT(type=f32,ne=[65536,512,1,1],order=1):                  516 runs -  2288.46 us/run -   262144 kB/run -  109.24 GB/s

* Add test case for dispatch to DeviceSegmentedRadixSort

We currently lack a way to force graph mode in CUDA, patch callback to
invoke ggml_backend_compare_graph_backend twice to enforce each test to
run in graph mode

4 months agomtmd: use causal attn for gemma 4 audio (#21824)
Xuan-Son Nguyen [Mon, 13 Apr 2026 07:47:55 +0000 (09:47 +0200)]
mtmd: use causal attn for gemma 4 audio (#21824)

4 months agowebui: add setting for first-line chat titles (#21797)
Rohan Jain [Mon, 13 Apr 2026 07:30:46 +0000 (13:00 +0530)]
webui: add setting for first-line chat titles (#21797)

* webui: add setting for first-line chat titles

Add an opt-in setting (`titleGenerationUseFirstLine`) to use the first
non-empty line of a prompt as the generated conversation title.

Previously, the complete multi-line prompt was being used, which created
long titles for complex queries. Coupled with
"Ask for confirmation before changing conversation title", the dialog
would overflow.

* Update tools/server/webui/src/lib/utils/text.ts

Co-authored-by: Aleksander Grygier <redacted>
* Update tools/server/webui/src/lib/utils/text.ts

Co-authored-by: Aleksander Grygier <redacted>
* webui: Run build to update the bundle

As requested in:
https://github.com/ggml-org/llama.cpp/pull/21797#pullrequestreview-4094935065

* webui: Fix missing import for NEWLINE_SEPARATOR

---------

Co-authored-by: Aleksander Grygier <redacted>
4 months agowebui: MCP Diagnostics improvements (#21803)
Aleksander Grygier [Mon, 13 Apr 2026 05:58:38 +0000 (07:58 +0200)]
webui: MCP Diagnostics improvements (#21803)

* Add MCP Connection diagnostics and CORS hint to web-ui

* tidy up test

* webui: Refactor and improve MCP diagnostic logging

---------

Co-authored-by: evalstate <redacted>
4 months agoRemove extra conditional check on debug mode. (#21798)
Masashi Yoshimura [Mon, 13 Apr 2026 03:13:04 +0000 (12:13 +0900)]
Remove extra conditional check on debug mode. (#21798)

4 months agosycl: disable Q1_0 in backend and cleanup unused variables (#21807)
Akarshan Biswas [Mon, 13 Apr 2026 01:44:58 +0000 (07:14 +0530)]
sycl: disable Q1_0 in backend and cleanup unused variables (#21807)

4 months agomtmd: fix crash when sending image under 2x2 pixels (#21711)
Sergiu [Sun, 12 Apr 2026 21:59:21 +0000 (00:59 +0300)]
mtmd: fix crash when sending image under 2x2 pixels (#21711)

4 months agomtmd: qwen3 audio support (qwen3-omni and qwen3-asr) (#19441)
Xuan-Son Nguyen [Sun, 12 Apr 2026 21:57:25 +0000 (23:57 +0200)]
mtmd: qwen3 audio support (qwen3-omni and qwen3-asr) (#19441)

* add qwen3a

* wip

* vision ok

* no more deepstack for audio

* convert ASR model ok

* qwen3 asr working

* Apply suggestions from code review

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

* Apply suggestions from code review

Co-authored-by: Sigbjørn Skjæret <redacted>
* fix bad merge

* fix multi inheritance

---------

Co-authored-by: Sigbjørn Skjæret <redacted>
4 months agoconvert : force f16 or f32 on step3-vl conv weights (#21646)
Sigbjørn Skjæret [Sun, 12 Apr 2026 17:22:29 +0000 (19:22 +0200)]
convert : force f16 or f32 on step3-vl conv weights (#21646)

4 months agomtmd: add gemma 4 test (vision + audio) [no ci] (#21806)
Xuan-Son Nguyen [Sun, 12 Apr 2026 14:29:03 +0000 (16:29 +0200)]
mtmd: add gemma 4 test (vision + audio) [no ci] (#21806)

* mtmd: add gemma 4 test (vision + audio)

* add to docs

4 months agomtmd: add Gemma 4 audio conformer encoder support (#21421)
Stephen Cox [Sun, 12 Apr 2026 12:15:26 +0000 (00:15 +1200)]
mtmd: add Gemma 4 audio conformer encoder support (#21421)

* mtmd: add Gemma 4 audio conformer encoder support

Add audio processing for Gemma 4 E2B/E4B via a USM-style Conformer.

Architecture:
- 12-layer Conformer: FFN → Self-Attention → Causal Conv1D → FFN → Norm
- Subsampling Conv Projection: 2x Conv2D(stride=2) with LayerNorm
- Full self-attention with sinusoidal RPE and sliding window mask (24)
- Logit softcapping at 50.0, ClippableLinear clamping
- Output: 1024 → 1536 → RMSNorm → multimodal embedder

Mel preprocessing (dedicated mtmd_audio_preprocessor_gemma4a):
- HTK mel scale, 128 bins, magnitude STFT, mel_floor=1e-3
- Standard periodic Hann window (320 samples), zero-padded to FFT size
- Semicausal left-padding (frame_length/2 samples)
- Frame count matched to PyTorch (unfold formula)
- No pre-emphasis, no Whisper-style normalization
- Mel cosine similarity vs PyTorch: 0.9998

Key fixes:
- Tensor loading dedup: prevent get_tensor() from creating duplicate
  entries in ctx_data. Fixed with std::set guard.
- ClippableLinear clamp_info loading moved after per-layer tensors.
- Sliding window mask (24 positions) matching PyTorch context_size.
- Skip Whisper normalization for Gemma4 mel output.

Tested on E2B and E4B with CPU and Vulkan backends.
Transcribes: "Glad to see things are going well and business is starting
to pick up" (matching ground truth).

Ref: #21325

4 months agofix: Proper messages rendering for "Show raw output" (#21672)
Aleksander Grygier [Sun, 12 Apr 2026 11:08:11 +0000 (13:08 +0200)]
fix: Proper messages rendering for "Show raw output" (#21672)

4 months agodocs: add guide on how to add multimodal support (#21778)
Xuan-Son Nguyen [Sun, 12 Apr 2026 11:02:38 +0000 (13:02 +0200)]
docs: add guide on how to add multimodal support (#21778)

* docs: add guide on how to add multimodal support

* nits

4 months agoCUDA: skip compilation of superfluous FA kernels (#21768)
Johannes Gäßler [Sat, 11 Apr 2026 16:52:11 +0000 (18:52 +0200)]
CUDA: skip compilation of superfluous FA kernels (#21768)

4 months agomtmd : add MERaLiON-2 multimodal audio support (#21756)
Sirui He [Sat, 11 Apr 2026 12:15:48 +0000 (20:15 +0800)]
mtmd : add MERaLiON-2 multimodal audio support (#21756)

* mtmd : add MERaLiON-2 multimodal audio support

Adds support for A*STAR's MERaLiON-2 audio-language model (3B and 10B)
to the multimodal framework.

Architecture:
- Whisper large-v2 encoder for audio feature extraction
- Gated MLP adaptor: ln_speech -> frame stack (x15) -> Linear+SiLU -> GLU -> out_proj
- Gemma2 3B / 27B decoder

The mmproj GGUF is generated via convert_hf_to_gguf.py --mmproj on the full
MERaLiON-2 model directory (architecture: MERaLiON2ForConditionalGeneration).
The decoder is converted separately as a standard Gemma2 model after stripping
the text_decoder. weight prefix.

New projector type: PROJECTOR_TYPE_MERALION

Supports tasks: speech transcription (EN/ZH/MS/TA), translation, spoken QA.

Model: https://huggingface.co/MERaLiON/MERaLiON-2-3B
       https://huggingface.co/MERaLiON/MERaLiON-2-10B

* simplify comments in meralion adaptor

* meralion: use format_tensor_name, ascii arrows in comments

4 months agoopencl: add basic support for q5_k (#21593)
shaofeiqi [Sat, 11 Apr 2026 08:46:19 +0000 (01:46 -0700)]
opencl: add basic support for q5_k (#21593)

* opencl: add general q5_k mv

* opencl: add flattened Q5_K mv and general Q5_K mm

* opencl: fix Q5_K unit tests

4 months agoTP: fix Qwen 3 Next data split (#21732)
Johannes Gäßler [Sat, 11 Apr 2026 07:23:42 +0000 (09:23 +0200)]
TP: fix Qwen 3 Next data split (#21732)

4 months agoggml : fix a few instances of missing GGML_TYPE_Q1_0 cases (#21716)
Sigbjørn Skjæret [Sat, 11 Apr 2026 06:45:00 +0000 (08:45 +0200)]
ggml : fix a few instances of missing GGML_TYPE_Q1_0 cases (#21716)

4 months agopy : Bump typer to latest to fix huggingface_hub issue (#21701)
Bartowski [Sat, 11 Apr 2026 06:44:15 +0000 (02:44 -0400)]
py : Bump typer to latest to fix huggingface_hub issue (#21701)

4 months agoCUDA: also store node->src ne/nb for graph equality (#21736)
Aman Gupta [Sat, 11 Apr 2026 02:30:30 +0000 (10:30 +0800)]
CUDA: also store node->src ne/nb for graph equality (#21736)

4 months agofix: Fix broken structured output when using $refs in json_schema (#21699)
Galunid [Fri, 10 Apr 2026 23:26:36 +0000 (01:26 +0200)]
fix: Fix broken structured output when using $refs in json_schema (#21699)

4 months agohexagon: add support for linux on snapdragon (#21707)
Todor Boinovski [Fri, 10 Apr 2026 22:57:23 +0000 (15:57 -0700)]
hexagon: add support for linux on snapdragon (#21707)

* hexagon: add support for debian on ex2

* hexagon: add -fvectotize to c/c++ cmake flags

* hexagon: remove trailing white space

* update onboarding steps

* hexagon: update linux setup documentation

* hexagon: update intallation scripts

* Hexagon: update docs

* hexagon: update onboarding scripts

---------

Co-authored-by: Zack Li <redacted>
4 months agohexagon: improved Op queuing, buffer and cache management (#21705)
Max Krasnyansky [Fri, 10 Apr 2026 22:47:43 +0000 (15:47 -0700)]
hexagon: improved Op queuing, buffer and cache management (#21705)

* hexagon: introduce op request batching and rewrite buffer managment

The host now prepares batches of requests and dispatches them via a single dspqueue message.

Buffers are mapped explicitly by NPU while processing batches.

* hex-dma: disable l2 bypass since to work around new issue due to no flushes between Ops

* hex-utils: add explicit l2flush and l2clear helpers

* hex-opreq: use fine-grain per tensor l2 management

* hex-opreq: avoid redundant invalidates for tensors we already flushed

* hex-opreq: update debug messages

* htp-opreq: reuse ops_context

* hex-opreq: do not flush or invalidate cache lines beyond buffer boundry

* hex-opreq: fix errors in log message

* Revert "hex-opreq: do not flush or invalidate cache lines beyond buffer boundry"

This reverts commit 8b7f0a55a750a6430ce4eb1874c7feb3d720056d.

* hexagon: limit l2 flushes to 1MB which covers l2 cache

* hex-opreq: limit cache flush to 4MB

Looks like 4MB cont. vitual space should cover the 1MB cache.

* hexagon: drop cache flush size to 2MB

* hex-opreq: start reworking opreq packing

* hex-opreq: introduce new way of packing opbatch where tensors are stored separately

* hex-opreq: add a simple fastrpc call to force unmap all buffers

* hex-l2flush: somehow 2MB does not seem robust, also cleanup step size to use line-size

* hex-opreq: bump opreq batch size to 256

* hex-mm: place src1 spad at the top of vtcm for easy reuse

* hex-ops: introduce internal types and disable src1 reuse for now

Nothing new just formalizing the repack / qyn.quant types we've been using.

* htp-opreq: use tensor pointers instead of copies

* hex-opreq: introduce more robust way for tracking vtcm/spad reuse

This removes the SKIP_QUANTIZE flag that became fragile with the addition of HMX and other ops.

* hex-cumsum: fix error post opreq merge

* hex-opreq: move request batch handling into the session

Prepping everything for using dspqueue buffers and doing that inside the session is much cleaner.

* hex-mm: yet another fix for src1 reuse when we're mixing hmx/hvx

* hex-bufs: introduce pinned mmapings and use non-pinned ones for model buffers

* hex-buf: add support for allocating shared/pinned buffer for opreqs

* hex-opbatch: make opbatches configurable

* hex-naming: better name for ggml_hexagon_shared_buffer

* hex-naming: add session->c_name() helper

* hex-opbatch: start using shm but still copy for now

* hex-opbatch: use shared buffer for packing opbatch

* hex-opbatch: beter naming for opbatch related classes and code

* hex-opbatch: reuse batched tensors with same data/dims/strides

* hex-opbatch: update logging

* hex-opbatch: add support for vmem limit for op batching

* hex-opbatch: update htp side to properly support dynamic mmap/unmap

* hex-opbatch: add OB and OQ params for run-completion script and fix the asserts in batch processing

* hex-opbatch: fixed src1 handling in act ops

* hex-act: fix empty src1 handling in swiglu and friends

Simplify preamble macro while at it

* hex-mm: minor fix vtcm and dma handling in matmul

cleaning up some left-overs from merges

* hex-opbatch: allocate extra 1KB for dspqueue overhead

* hexagon: fix softmax for non-aligned tensors and cleanup vtcm alloc

* hex-mm: properly handle hmx_disabled flag

* hex-ops: update comments

* hex-ops: add debug output for get/set-rows

* hex-mmap: optimize un/mapping of buffers

* hex-opreq: global cache flush and invalidate beyond 128KB threshold

* hex-ops: add super simple opfilter regex for debugging

If an Op matches the regex hex backend will reject it.

* hex-opbatch: wireup newer ops missed in merge and update main switch to detect this in future

* hexagon: improved vtcm acquision to remove inter-op overhead

Fully compatible with QNN-HTP coex

* hex-mm: fixed hvx fallback path

* hex-mm: lower the vmem threshold a bit further to ~3GB

* hexagon: update debug & error logs

This also fixes an issue with newer llvm merging repack and non-repack
functions. We use those pointer to distinguish between buffer types.

* hexagon: move ops context into main context

Just a cleanup. We don't need separate contexts at this point.

* hex-opbatch: cleanup naming and headers for opbatch and related descriptors

* hex-fa: it's now better to enable FA during TG to reduce graph splits

* hexagon: remove GGML_HEXAGON_EXPERIMENTAL env var

It's no longer useful. Please use more flexible GGML_HEXAGON_OPFILTER to disable Ops
if needed for debugging or validation.

* hexagon: fixed editorconfig check

* Update ggml/src/ggml-hexagon/ggml-hexagon.cpp

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

Co-authored-by: Trivikram Reddy <redacted>
Co-authored-by: Sigbjørn Skjæret <redacted>
4 months agocommon : better align to the updated official gemma4 template (#21704)
Aldehir Rojas [Fri, 10 Apr 2026 21:12:53 +0000 (16:12 -0500)]
common : better align to the updated official gemma4 template (#21704)

4 months agocommon : add callback interface for download progress (#21735)
Adrien Gallouët [Fri, 10 Apr 2026 20:17:00 +0000 (22:17 +0200)]
common : add callback interface for download progress (#21735)

Signed-off-by: Adrien Gallouët <redacted>
4 months agomodel : make Gemma 4 shared-KV tail attn_k tensors optional on load (#21739)
MoonRide303 [Fri, 10 Apr 2026 19:45:50 +0000 (21:45 +0200)]
model : make Gemma 4 shared-KV tail attn_k tensors optional on load (#21739)

4 months agoggml-webgpu: support non-square subgroup matrix configs for Intel GPUs (#21669)
Rithik Sharma [Fri, 10 Apr 2026 17:52:38 +0000 (10:52 -0700)]
ggml-webgpu: support non-square subgroup matrix configs for Intel GPUs (#21669)

4 months agoggml-webgpu: address quantization precision and backend lifecycle managment (#21521)
Chen Yuan [Fri, 10 Apr 2026 17:52:01 +0000 (13:52 -0400)]
ggml-webgpu: address quantization precision and backend lifecycle managment (#21521)

* ggml(webgpu): fix the busy-polls in Emscripten  in the waitAny after #20618, and remove the busy webgpu log

* Merge with upstream

* Fix GET_ROWS packed integer NaN when using f16 as memory buffer in shader quants

* Update Unary wgsl EXP and EXPM1 for f16 stability

* Fix GET_ROWS IQ4_XS strcut for NaN f16 canonicalization

* Fix numerical percision for unary sqrt when working with f16

* Fix NaN canonicalization for packed integers using f16

* Update err threshold for binary div ops when using f16

* backend: Keep one Dawn/WebGPU instance alive for the lifetime of the static backend

* clean: uncomment existing code logs

* clean: clean the unncessary debug info

* Refactor and generalize dequant helpers

* Remove deprecated quant structs

* Refactor shader defines to reduce repetition

* Remove error override for F16 type

* fix: fix the accidential removal of the proper initialization of ctx

* clean: clean legacy and format code

* fix: did not modify tests ops

---------

Co-authored-by: Jeremy J. Hartmann <redacted>
4 months agoserver : ignore --alias when using --models-preset (#21380)
Adrien Gallouët [Fri, 10 Apr 2026 15:42:56 +0000 (17:42 +0200)]
server : ignore --alias when using --models-preset (#21380)

I'm not sure what the purpose of keeping `--alias` was when using
`--models-preset`, but the result is really weird, as shown in the
following logs:

    $ build/bin/llama-server --models-preset preset.ini --alias "Gemma 4 E4B UD Q8_K_XL"
    ...
    init: using 31 threads for HTTP server
    srv   load_models: Loaded 2 cached model presets
    srv   load_models: Loaded 1 custom model presets from preset.ini
    main: failed to initialize router models: alias 'Gemma 4 E4B UD Q8_K_XL' for model 'angt/test-split-model-stories260K:F32' conflicts with existing model name

So I propose to simply ignore `--alias` too in this case. With this
commit, the server starts in routing mode correctly.

Signed-off-by: Adrien Gallouët <redacted>
4 months agocommon : fix when loading a cached HF models with unavailable API (#21670)
Adrien Gallouët [Fri, 10 Apr 2026 14:37:46 +0000 (16:37 +0200)]
common : fix when loading a cached HF models with unavailable API (#21670)

Signed-off-by: Adrien Gallouët <redacted>
5 months agocommon: mark --split-mode tensor as experimental (#21684)
Johannes Gäßler [Fri, 10 Apr 2026 10:27:27 +0000 (12:27 +0200)]
common: mark --split-mode tensor as experimental (#21684)

5 months agowebui: Static build output improvements (#21667)
Aleksander Grygier [Fri, 10 Apr 2026 09:49:47 +0000 (11:49 +0200)]
webui: Static build output improvements (#21667)

* refactor: Build improvements

* chore: Formatting + package lock update

5 months agocommon : enable reasoning budget sampler for gemma4 (#21697)
Berk Idem [Fri, 10 Apr 2026 09:49:14 +0000 (05:49 -0400)]
common : enable reasoning budget sampler for gemma4 (#21697)

* fix: enable reasoning budget sampler for gemma4

Add thinking_start_tag and thinking_end_tag to
common_chat_params_init_gemma4(). Without these, the reasoning
budget sampler never activates for gemma4.

Make the newline after "thought" optional in the PEG parser to
handle budget=0 (sampler forces end tag before the newline).

Add test case for empty thinking block.

Fixes #21487

* use p.space() instead of p.optional(p.literal("\n")) in gemma4 thought parser

5 months agodocs : fix broken link to ggml-openvino in OPENVINO.md (#21709)
Belem Zhang [Fri, 10 Apr 2026 07:50:08 +0000 (15:50 +0800)]
docs : fix broken link to ggml-openvino in OPENVINO.md (#21709)

5 months agovulkan: Support Q1_0 (#21539)
Jeff Bolz [Fri, 10 Apr 2026 06:35:27 +0000 (01:35 -0500)]
vulkan: Support Q1_0 (#21539)

* vulkan: Support Q1_0

* use get_dm

5 months agocommon : add fluidity to the progress bar (#21671)
Adrien Gallouët [Fri, 10 Apr 2026 06:24:53 +0000 (08:24 +0200)]
common : add fluidity to the progress bar (#21671)

Signed-off-by: Adrien Gallouët <redacted>
5 months agoCUDA: fuse muls (#21665)
Aman Gupta [Fri, 10 Apr 2026 02:24:09 +0000 (10:24 +0800)]
CUDA: fuse muls (#21665)

5 months agoHIP: add CDNA4 (gfx950) architecture support for MI350X/MI355X (#21570)
andyluo7 [Thu, 9 Apr 2026 19:13:32 +0000 (22:13 +0300)]
HIP: add CDNA4 (gfx950) architecture support for MI350X/MI355X (#21570)

Add AMD Instinct MI350X/MI355X (gfx950, CDNA4) support:

- vendors/hip.h: Add CDNA4 preprocessor define for __gfx950__
- common.cuh: Add GGML_CUDA_CC_CDNA4 and GGML_CUDA_CC_IS_CDNA4 macros
- mma.cuh: Route CDNA4 to compatible MFMA instructions:
  * f32 matmul: mfma_f32_16x16x4f32 (xf32 variant unavailable on gfx950)
  * bf16 matmul: mfma_f32_16x16x16bf16_1k (same as CDNA3)
  * int8 matmul: mfma_i32_16x16x32_i8/32x32x16 (same as CDNA3)
- mmq.cuh: Include CDNA4 in stream-k kernel dispatch

CDNA4 is largely compatible with CDNA3 except:
- No xf32 MFMA (mfma_f32_16x16x8_xf32) — routes to f32 path
- Different FP8 format (e4m3fn vs e4m3_fnuz) — not changed here

Tested on AMD Instinct MI355X (gfx950), ROCm 7.0.1:
- Build: compiles cleanly with -DAMDGPU_TARGETS=gfx950
- llama-bench (Qwen2.5-1.5B Q4_K_M, single GPU):
  * f16+FA: 40,013 tok/s prefill, 254 tok/s decode
  * q8_0+FA: functional
- Flash attention: works correctly
- MMQ: works correctly with stream-k dispatch

Co-authored-by: Andy Luo <redacted>
5 months agoggml: backend-agnostic tensor parallelism (experimental) (#19378)
Johannes Gäßler [Thu, 9 Apr 2026 14:42:19 +0000 (16:42 +0200)]
ggml: backend-agnostic tensor parallelism (experimental) (#19378)

* ggml: backend-agnostic tensor parallelism

* support for GPT-OSS, Qwen 3 MoE

* partial Vulkan fix

* add support for 4/8 GPUs

* unconditional peer access

* re-use buffers + ggml contexts

* fix output pattern

* NCCL support

* GGML: HIP: add RCCL support

* Remove shfl and AllReduce from backend interface

* move allocation workaround out of ggml-alloc.c

* 2d tensor set/get support

* Fix the seg fault without NCCL

* Apply suggestion from JohannesGaessler

* support for tensor dims % n_devs != 0

* fix view_offs scaling

* arbitrary num. of GPUs/tensor split

* fix compilation

* better granularity estimate

* Support device-specific host buffer types if all underlying backends expose the same type. This allows using pinned memory instead of pageable memory for CUDA.

Fix compilation errors.

* partial Qwen 3 Next support

* Fix qwen3 30b (#8)

* Fix crash with Qwen-30B-A3B Q4_0

Qwen-30B-A3B Q4_0 has an intermediate dimension of 768. Using a granularity of 256 forces an uneven split between GPUs, which is not supported by the current implementation.

* Decide block size based on tensor quantization type

* Fix crashes due to KV cache serialization (#9)

KV cache serialization requires non-zero offsets on the tensor. Add support in the meta backend to set/get a tensor with a non-zero offset.

* metal : fix build (#7)

* static memory allocations, fix usage count

* fix tensor granularity

* more even memory distribution

* use BF16 for allreduce

* rebase fixup

* better error message for unsupported architectures

* Fix device mismatch during scatter of allReduce. (#11)

There is a mismatch between the dst buffer device and the backend device, causing the use of sync copies

* Enable the previous allreduce implementation. It is better in both perf and stability (#12)

* delay AllReduce for Moe for less I/O

* build : clean-up compile warnings

* backend : move most of the meta backend API to ggml-backend-impl.h

* cont : hide unused public API in the implementation

* llama : use llama_device + remove ggml_backend_dev_is_meta()

* ggml-backend : remove unused alloc include

* minor : remove regex include

* ggml : introduce ggml-ext.h for staging new APIs

* rebase fixup

* fix tests

* llama : more robust logic for determining Meta devices (#16)

* llama : more robust logic for determining Meta devices

* cont : fix devs size check

Co-authored-by: Johannes Gäßler <redacted>
* cont : fix log type

Co-authored-by: Johannes Gäßler <redacted>
---------

Co-authored-by: Johannes Gäßler <redacted>
* disable roundtrip for meta backend

* fix arch selection

* Qwen 3.5 support

* fix Gemma 4 MoE

* fix OpenVino, SYCL

* fix test-llama-archs for CPU-only builds

* Fix Qwen 3.5 MoE

* disable meta backend tests for WebGPU

* tests : filter CPU-based devices from the Meta backend tests (#17)

* meta : formatting, naming, indentation (#18)

* formatting : llama-model.cpp

* formatting : ggml-ext.h

* formatting : ggml-backend-meta.cpp

* meta : add TODO

* add documentation

* better error messages

* fix GPT-OSS

---------

Co-authored-by: Carl Philipp Klemm <redacted>
Co-authored-by: Gaurav Garg <redacted>
Co-authored-by: Georgi Gerganov <redacted>
5 months agoggml : check return value of CUB calls used in argsort and top-k (they all return...
fairydreaming [Thu, 9 Apr 2026 13:17:11 +0000 (15:17 +0200)]
ggml : check return value of CUB calls used in argsort and top-k (they all return cudaError_t) (#21676)

Co-authored-by: Stanisław Szymczyk <redacted>
5 months agorequirements : update transformers to 5.5.1 (#21617)
Daniel Bevenius [Thu, 9 Apr 2026 10:36:29 +0000 (12:36 +0200)]
requirements : update transformers to 5.5.1 (#21617)

* requirements : update transformers to 5.5.0

This commit updates the transformers dependency to version 5.5.0.

The motivation for this is that transformers 5.5.0 includes support for
Gemma4 and is required to be able to convert Gemma4 models. This is also
causing issues for user of gguf-my-repo.

Refs: https://huggingface.co/spaces/ggml-org/gguf-my-repo/discussions/202

* fix huggingface_hub version

* set version of transformers to 5.5.0

* convert : add ty ignore directives to convert_hf_to_gguf.py

This commit adds `ty: ignore` directives to transformers tokenizers
field/methods to avoid type check errors. There might be better ways to
handle this and perhaps this can be done in a follow up commit.

The motivation for this is that it looks like in transformers 5.5.0
AutoTokenizer.from_pretrained can return generic tokenizer types or None
and the type checker now produces an error when the conversion script
accesses field like tokenizer.vocab.

* convert : add ty ignore to suppress type check errors

* convert : remove incorrect type ignores

* convert : fix remaining python checks

I was running a newer version of ty locally but I've switched to
version 0.0.26 which is what CI uses and I was then able to reproduce
the errors. Sorry about the noise.

* update transformers version to 5.5.1

5 months agowebui: add "Send message on Enter" setting (#21577)
JvM [Thu, 9 Apr 2026 10:26:27 +0000 (12:26 +0200)]
webui: add "Send message on Enter" setting (#21577)

* webui: make Enter to send chat a setting

* Shorten description

* Use isMobile hook from $lib/hooks

* Rebuild static output

5 months agocommon : fix ambiguous grammar rule in gemma4 (#21661)
Aldehir Rojas [Thu, 9 Apr 2026 10:25:07 +0000 (05:25 -0500)]
common : fix ambiguous grammar rule in gemma4 (#21661)

* common : fix ambiguous grammar rule in gemma4

* cont : fix missing comma...

5 months agocommon : simplify autoparser tagged parser rules (#21216)
Aldehir Rojas [Thu, 9 Apr 2026 10:24:20 +0000 (05:24 -0500)]
common : simplify autoparser tagged parser rules (#21216)

* common : simplify autoparser tagged parser rules

* cont : remove upper limit on optional args

* cont : revert changes to parsing at the end

* cont : undo arbitrary ordering of optional args

* cont : fix uninitialized required parameters

* revert to simplify merge

* re-apply patches

* restore flexible optional arg ordering tests

5 months agomodel: fix multimodal padding token for gemma3n/gemma4 (#21625)
Xuan-Son Nguyen [Thu, 9 Apr 2026 10:18:23 +0000 (12:18 +0200)]
model: fix multimodal padding token for gemma3n/gemma4 (#21625)

* model: fix multimodal padding token for gemma3n/gemma4

* nits

5 months agomtmd: support dots.ocr (#17575)
Xuan-Son Nguyen [Thu, 9 Apr 2026 10:16:38 +0000 (12:16 +0200)]
mtmd: support dots.ocr (#17575)

* convert gguf

* clip impl

* fix conversion

* wip

* corrections

* update docs

* add gguf to test script

5 months agovocab: add gemma4 tokenizer tests, fix edge case (#21534)
Piotr Wilkin (ilintar) [Thu, 9 Apr 2026 09:41:14 +0000 (11:41 +0200)]
vocab: add gemma4 tokenizer tests, fix edge case (#21534)

* YATF (Yet Another Tokenizer Fix) for Gemma 4. With tests!
* Remove unnecessary hash  from update script.
* minor: move constant

5 months agojinja : support ensure_ascii=true, string repetition and int/float self-filtering...
Kwa Jie Hao [Thu, 9 Apr 2026 09:28:33 +0000 (17:28 +0800)]
jinja : support ensure_ascii=true, string repetition and int/float self-filtering (#21623)

* feat: jinja engine improvements for reka-edge

Port three Jinja engine improvements needed for the reka-edge model:
1. Python-style string repetition ("ab" * 3 → "ababab")
2. ensure_ascii=true support for tojson filter (escapes non-ASCII to \uXXXX)
3. int() builtin on value_int_t (identity, needed for Reka Edge template)

* fix: escape invalid utf8 bytes when ensure_ascii=true

The json_ensure_ascii_preserving_format function does not correctly
handle an edge case where if UTF-8 parsing fails, it adds the non-ascii
character back to the output as a raw byte.

This commit fixes that by adding the unicode standard replacement
character \\ufffd to the output instead. This is the standard behavior
for various programming languages like Python, Rust, Go, etc.

* chore: address PR comments

1. Add todo comment for supporting string repetition for array/tuples
2. Add support for float identity operation
3. Move invalid ascii test case to test_fuzzing

* chore: accept suggestion for common/jinja/value.cpp

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

Co-authored-by: Sigbjørn Skjæret <redacted>
5 months agometal : add missing mm-id specializations for q1_0 (#21662)
Georgi Gerganov [Thu, 9 Apr 2026 07:54:00 +0000 (10:54 +0300)]
metal : add missing mm-id specializations for q1_0 (#21662)

5 months agofix: Model Selector choice sync (#21628)
Aleksander Grygier [Thu, 9 Apr 2026 07:46:27 +0000 (09:46 +0200)]
fix: Model Selector choice sync (#21628)

5 months agoserver : fix grammar commandline args (#21543)
AUTOMATIC1111 [Thu, 9 Apr 2026 07:16:54 +0000 (10:16 +0300)]
server : fix grammar commandline args (#21543)

Co-authored-by: AUTOMATIC <->
5 months agowebui: Add option to pre-encode conversation for faster next turns (#21034)
Aleksander Grygier [Thu, 9 Apr 2026 07:10:18 +0000 (09:10 +0200)]
webui: Add option to pre-encode conversation for faster next turns (#21034)

5 months agosycl : add flash-attn support for head size 512 (#21654)
Akarshan Biswas [Thu, 9 Apr 2026 06:36:48 +0000 (12:06 +0530)]
sycl : add flash-attn support for head size 512 (#21654)

* sycl : add flash-attn support for head size 512

This patch extends the SYCL Flash Attention implementation to support head sizes (DKQ/DV) of 512.

Changes:
- Added DKQ/DV 512 cases to both tile and vector Flash Attention kernels.
- Updated kernel selection logic to allow vector kernels for head sizes up to 512 (previously 256).
- Removed unused/redundant AMD and RDNA-specific configuration functions in `fattn-tile.hpp`.
- Refactored `ggml_backend_sycl_buffer_init_tensor` to use a switch statement for clearer tensor extra buffer initialization.
- Added necessary template instances for the new 512 head size across various quantization types.

* remove defunct mxfp4 reorder from setting buffer type

5 months agoci: drop v5 `all:` composition from labeler.yml (#21627)
Marxist-Leninist [Thu, 9 Apr 2026 06:20:19 +0000 (07:20 +0100)]
ci: drop v5 `all:` composition from labeler.yml (#21627)

actions/labeler@v6 removed the `all:` / `any:` composition keys.
The `server/webui` and `server` entries used `all:` to combine
`any-glob-to-any-file` with negated `all-globs-to-all-files`,
which now errors on every PR with:

    Unknown config options were under "changed-files": all

Flatten both entries to a single `any-glob-to-any-file`. PRs
touching both webui and other server files will now receive both
labels instead of only `server/webui`.

Co-authored-by: Marxist-Leninist <redacted>
5 months agovulkan: unify type macros to use Vx instead of _VECx (#21605)
Ruben Ortlam [Thu, 9 Apr 2026 05:31:51 +0000 (07:31 +0200)]
vulkan: unify type macros to use Vx instead of _VECx (#21605)