]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/log
pkg/ggml/sources/llama.cpp
5 weeks agoconvert : support is_causal hyperparameter (#20746)
Dowon [Thu, 19 Mar 2026 10:41:11 +0000 (19:41 +0900)]
convert : support is_causal hyperparameter (#20746)

* convert : support is_causal hyperparameter

Check for the `is_causal` attribute in the Hugging Face model configuration and include it in the GGUF metadata.

* Update convert_hf_to_gguf.py

Co-authored-by: Sigbjørn Skjæret <redacted>
* style: fix F541 f-string is missing placeholders

---------

Co-authored-by: Sigbjørn Skjæret <redacted>
5 weeks agocommon : fix gpt-oss content removal (#20745)
Aldehir Rojas [Thu, 19 Mar 2026 10:40:39 +0000 (05:40 -0500)]
common : fix gpt-oss content removal (#20745)

5 weeks agovulkan: dequantize iq4_xs 4 at a time (#20657)
Eve [Thu, 19 Mar 2026 10:32:04 +0000 (10:32 +0000)]
vulkan: dequantize iq4_xs 4 at a time (#20657)

5 weeks agocmake : fix build warning when kleidiai is enabled (#20457)
Charles Xu [Thu, 19 Mar 2026 08:14:48 +0000 (09:14 +0100)]
cmake : fix build warning when kleidiai is enabled (#20457)

* cmake : fix build warning when kleidiai is enabled

* remove LLAMA_ARG_THREADS from KleidiAI backend

5 weeks agovocab : assert array size of scores and toktypes (#20737)
Sigbjørn Skjæret [Thu, 19 Mar 2026 07:34:04 +0000 (08:34 +0100)]
vocab : assert array size of scores and toktypes (#20737)

5 weeks agodocs: add information about openvino in the docker page (#20743)
Kevin Hannon [Thu, 19 Mar 2026 07:08:47 +0000 (03:08 -0400)]
docs: add information about openvino in the docker page (#20743)

5 weeks agoCANN: handle in-place ROPE on non-contiguous f32 tensors (#20274)
Chenguang Li [Thu, 19 Mar 2026 06:05:01 +0000 (14:05 +0800)]
CANN: handle in-place ROPE on non-contiguous f32 tensors (#20274)

RotaryPositionEmbedding on CANN fails when src and dst share the same
non-contiguous buffer (inplace + view), because the operator overwrites
source data before it is fully read.

Add a branch that detects this case and uses contiguous temporary
buffers: copy src to temp, run ROPE into another temp, then copy back
to the non-contiguous dst. Fixes 20 failing ROPE tests (f32, v=1,
inplace=1).

Signed-off-by: noemotiovon <redacted>
5 weeks agoggml-webgpu: Update the `RMS_NORM` preprocessor and add `L2_NORM` (#20665)
Masashi Yoshimura [Thu, 19 Mar 2026 04:08:59 +0000 (13:08 +0900)]
ggml-webgpu: Update the `RMS_NORM` preprocessor and add `L2_NORM` (#20665)

* Update the preprocessor of RMS_NORM and add L2_NORM.

* Fix the name of rms_norm to row_norm.

5 weeks agoggml-webgpu: Add supports for `DIAG` and `TRI` (#20664)
Masashi Yoshimura [Thu, 19 Mar 2026 04:08:35 +0000 (13:08 +0900)]
ggml-webgpu: Add supports for `DIAG` and `TRI` (#20664)

* Add supports for DIAG and TRI.

* Remove extra ttype and add a comment for TRI op.

5 weeks agoCANN: support flash attention for head dim not multiple of 16, fix ALiBi slope offset...
Chenguang Li [Thu, 19 Mar 2026 03:02:42 +0000 (11:02 +0800)]
CANN: support flash attention for head dim not multiple of 16, fix ALiBi slope offset (#20031)

- Allow FLASH_ATTN_EXT when head dimension D is not a multiple of 16 by
  padding Q/K/V to D_padded = GGML_PAD(D, 16), running FusedInferAttentionScoreV2,
  then slicing the output back to D (ggml-cann.cpp + aclnn_ops.cpp).
- Fix aclnn_get_slope second-part offset: use ggml_type_size(dtype) instead of
  sizeof(float) so ALiBi slopes are correct when dtype is F16 (e.g. GQA with
  48 heads); fixes buffer overflow and large numerical errors in those cases.

5 weeks agomodel : add control vector support where missing (#20653)
Michael Grau [Wed, 18 Mar 2026 22:25:12 +0000 (23:25 +0100)]
model : add control vector support where missing (#20653)

* Add control vector functions to qwen3.5 and qwen-next models

* Add missing cvec compatibility to the rest of the models

* Adjust comments and formatting

* cleanup

* whitespace

---------

Co-authored-by: Sigbjørn Skjæret <redacted>
5 weeks agogguf-py : cleaner way to get the first key (#20727)
Sigbjørn Skjæret [Wed, 18 Mar 2026 22:21:42 +0000 (23:21 +0100)]
gguf-py : cleaner way to get the first key (#20727)

5 weeks agoRebuild index.html.gz (#20724)
crsawyer [Wed, 18 Mar 2026 17:49:57 +0000 (12:49 -0500)]
Rebuild index.html.gz (#20724)

5 weeks agoMove to no timeout for WaitAny in graph submission to avoid deadlocks in some cases...
Reese Levine [Wed, 18 Mar 2026 17:23:47 +0000 (10:23 -0700)]
Move to no timeout for WaitAny in graph submission to avoid deadlocks in some cases on llvm-pipe backends (#20618)

5 weeks agoggml-cpu/x86: fix unused changemask warning in repack (#20692)
Shaw Nguyen [Wed, 18 Mar 2026 16:45:06 +0000 (23:45 +0700)]
ggml-cpu/x86: fix unused changemask warning in repack (#20692)

5 weeks agosync : ggml
Georgi Gerganov [Wed, 18 Mar 2026 12:45:54 +0000 (14:45 +0200)]
sync : ggml

5 weeks agoggml : bump version to 0.9.8 (ggml/1442)
Georgi Gerganov [Mon, 16 Mar 2026 18:15:14 +0000 (20:15 +0200)]
ggml : bump version to 0.9.8 (ggml/1442)

5 weeks agoggml : restore ggml_type_sizef() to aboid major version bump (ggml/1441)
Georgi Gerganov [Mon, 16 Mar 2026 18:09:25 +0000 (20:09 +0200)]
ggml : restore ggml_type_sizef() to aboid major version bump (ggml/1441)

5 weeks agowebui: improve tooltip wording for attachment requirements (#20688)
Julien Chaumond [Wed, 18 Mar 2026 13:01:02 +0000 (14:01 +0100)]
webui: improve tooltip wording for attachment requirements (#20688)

* webui: improve tooltip wording for attachment requirements

Co-Authored-By: Claude <redacted>
* chore: update webui build output

* chore: update webui build output

---------

Co-authored-by: Claude <redacted>
5 weeks agollama : re-enable manual LoRA adapter free (#19983)
Pop Flamingo [Wed, 18 Mar 2026 10:03:26 +0000 (11:03 +0100)]
llama : re-enable manual LoRA adapter free (#19983)

* Re-enable manual LoRA adapter free

* Remove stale "all adapters must be loaded before context creation" stale comments

5 weeks agotests : fix test-jinja-py Windows failures by bypassing command-line args [no ci...
Masato Nakasaka [Wed, 18 Mar 2026 09:43:31 +0000 (02:43 -0700)]
tests : fix test-jinja-py Windows failures by bypassing command-line args [no ci] (#20483)

* Fix errors occurring on Windows

* Reverted fix

#20365 will take care of CRLF isue

* Changed to write to directly to stdin

* Prevent fclose to happen twice

5 weeks agocommon : rework gpt-oss parser (#20393)
Aldehir Rojas [Wed, 18 Mar 2026 09:41:25 +0000 (04:41 -0500)]
common : rework gpt-oss parser (#20393)

* common : rework gpt-oss parser

* cont : fix gpt-oss tests

* cont : add structured output test

* cont : rename final to final_msg

5 weeks agotests: enable kv_unified to prevent cuda oom error on rtx 2060 (#20645)
Aaron Teo [Wed, 18 Mar 2026 09:40:22 +0000 (17:40 +0800)]
tests: enable kv_unified to prevent cuda oom error on rtx 2060 (#20645)

Signed-off-by: Aaron Teo <redacted>
5 weeks agowebui: Fix duplicated messages on q param (#20715)
Aleksander Grygier [Wed, 18 Mar 2026 09:32:43 +0000 (10:32 +0100)]
webui: Fix duplicated messages on q param (#20715)

* fix: Remove duplicate message sending on `?q` param

* chore: update webui build output

5 weeks agoHIP : ignore return of hipMemAdvise [no ci] (#20696)
uvos [Wed, 18 Mar 2026 08:53:13 +0000 (09:53 +0100)]
HIP : ignore return of hipMemAdvise [no ci] (#20696)

5 weeks agocontext : fix graph not resetting when control vector changes (#20381)
Andreas Obersteiner [Wed, 18 Mar 2026 06:10:13 +0000 (07:10 +0100)]
context : fix graph not resetting when control vector changes (#20381)

5 weeks agohexagon: add neg, exp, sigmoid, softplus ops, cont, repeat ops (#20701)
Krishna Sridhar [Tue, 17 Mar 2026 22:34:36 +0000 (15:34 -0700)]
hexagon: add neg, exp, sigmoid, softplus ops, cont, repeat ops (#20701)

Add element-wise unary ops needed by Qwen 3.5's DeltaNet linear
attention layers. These ops follow the existing unary-ops pattern
with VTCM DMA double-buffering.

- neg: negate via scale by -1.0
- exp: uses existing hvx_exp_f32 HVX intrinsics
- sigmoid: uses existing hvx_sigmoid_f32_aa HVX intrinsics
- softplus: log(1 + exp(x)) scalar fallback
- CONT reuses the existing CPY infrastructure since making a tensor
  contiguous is equivalent to a same-type copy.
- REPEAT implements tiled memory copy with multi-threaded execution via
  the worker pool, supporting f32 and f16 types. The kernel parallelizes
  across output rows and uses memcpy for each tile.

Co-authored-by: Max Krasnyansky <redacted>
5 weeks agovulkan: disable mmvq on Intel Windows driver (#20672)
Ruben Ortlam [Tue, 17 Mar 2026 20:51:43 +0000 (21:51 +0100)]
vulkan: disable mmvq on Intel Windows driver (#20672)

* vulkan: disable mmvq on Intel Windows driver

* improve comment

5 weeks agoggml-blas: set mkl threads from thread context (#20602)
Kevin Hannon [Tue, 17 Mar 2026 17:16:49 +0000 (13:16 -0400)]
ggml-blas: set mkl threads from thread context (#20602)

* ggml blas: set mkl threads from thread context

* add code to run blas locally

5 weeks agocommon/parser: add `--skip-chat-parsing` to force a pure content parser. (#20289)
Piotr Wilkin (ilintar) [Tue, 17 Mar 2026 15:16:43 +0000 (16:16 +0100)]
common/parser: add `--skip-chat-parsing` to force a pure content parser. (#20289)

* Add `--force-pure-content` to force a pure content parser.

* Update common/arg.cpp

Co-authored-by: Sigbjørn Skjæret <redacted>
* Change parameter name [no ci]

---------

Co-authored-by: Sigbjørn Skjæret <redacted>
5 weeks agoggml-cpu: fix RVV checks in quants and repacking (#20682)
Taimur Ahmad [Tue, 17 Mar 2026 14:03:40 +0000 (19:03 +0500)]
ggml-cpu: fix RVV checks in quants and repacking (#20682)

* ggml-cpu: refactor quants.c; add rvv check

* ggml-cpu: refactor; disable generic fallback

5 weeks agoci : bump ccache [no ci] (#20679)
Sigbjørn Skjæret [Tue, 17 Mar 2026 13:54:31 +0000 (14:54 +0100)]
ci : bump ccache [no ci] (#20679)

* bump ccache

* forgotten

* disable for s390x

* disable also for ppc64le

5 weeks agovulkan: async and event fixes (#20518)
Ruben Ortlam [Tue, 17 Mar 2026 13:27:23 +0000 (14:27 +0100)]
vulkan: async and event fixes (#20518)

* vulkan: fix event wait submission, event command buffer reset

* fix event command buffer reset validation error

* also reset command buffers before reuse

* use timeline semaphores instead of fences for event_synchronize

* don't use initializer list for semaphore wait info

* use multiple events to avoid reset issues

* fix event reuse issue with multiple vectors

* add semaphore wait condition also if compute_ctx already exists

* remove event pending stage

5 weeks agoserver : fix ctx checkpoint invalidation (#20671)
Georgi Gerganov [Tue, 17 Mar 2026 13:21:14 +0000 (15:21 +0200)]
server : fix ctx checkpoint invalidation (#20671)

5 weeks agokleidiai : fix MUL_MAT support for batched (3D) inputs (#20620)
Justin Bradford [Tue, 17 Mar 2026 12:03:54 +0000 (05:03 -0700)]
kleidiai : fix MUL_MAT support for batched (3D) inputs (#20620)

* kleidiai : fix MUL_MAT support for batched (3D) inputs

The supports_op() check incorrectly rejected MUL_MAT operations with 3D
inputs (ne[2] > 1), but the actual compute_forward_qx() implementation
handles batched inputs correctly via a loop over ne12.

This caused models with Q4_0/Q8_0 weights to crash during graph scheduling
when n_seq_max > 1, because weights were placed in KLEIDIAI buffers during
loading (tested with 2D inputs) but the runtime used 3D inputs.

Also relax the buffer check to allow supports_op() to be called during
weight loading when src[0]->buffer is NULL.

Fixes #20608

* Kleidiai support_ops should only return true for 3D inputs, not also 4D

5 weeks agovulkan: allow graphics queue only through env var (#20599)
Ruben Ortlam [Tue, 17 Mar 2026 09:09:59 +0000 (10:09 +0100)]
vulkan: allow graphics queue only through env var (#20599)

* vulkan: avoid graphics queue on non-RADV AMD drivers

* avoid graphics queues on small GPUs

* change to only use graphics queue if overridden with env var GGML_VK_ALLOW_GRAPHICS_QUEUE

* reenable transfer queue if graphics queue is not used

5 weeks ago[SYCL] ehance UPSCALE to support all UT cases (#20637)
Neo Zhang [Tue, 17 Mar 2026 02:01:52 +0000 (10:01 +0800)]
[SYCL] ehance UPSCALE to support all UT cases (#20637)

* [SYCL] ehance UPSCALE to support more cases

* rm test case result of SYCL1

5 weeks agotools/server: support refusal content for Responses API (#20285)
Piotr Wilkin (ilintar) [Tue, 17 Mar 2026 00:42:04 +0000 (01:42 +0100)]
tools/server: support refusal content for Responses API (#20285)

* Support refusal content for Responses API

* Update tools/server/server-common.cpp

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

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

Co-authored-by: Sigbjørn Skjæret <redacted>
5 weeks agomodel: mistral small 4 support (#20649)
Xuan-Son Nguyen [Mon, 16 Mar 2026 23:31:14 +0000 (00:31 +0100)]
model: mistral small 4 support (#20649)

* model: mistral small 4 support

* fix test

* fix test (2)

* Apply suggestions from code review

Co-authored-by: Sigbjørn Skjæret <redacted>
* Update convert_hf_to_gguf.py

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

---------

Co-authored-by: Sigbjørn Skjæret <redacted>
5 weeks agoci : disable AMX jobs (#20654)
Georgi Gerganov [Mon, 16 Mar 2026 20:38:59 +0000 (22:38 +0200)]
ci : disable AMX jobs (#20654)

[no ci]

5 weeks agobenches : add Nemotron 3 Nano on DGX Spark (#20652)
Georgi Gerganov [Mon, 16 Mar 2026 19:50:43 +0000 (21:50 +0200)]
benches : add Nemotron 3 Nano on DGX Spark (#20652)

[no ci]

5 weeks agotests : write to binary buffer to avoid newline translation in jinja -py [no ci]...
Sigbjørn Skjæret [Mon, 16 Mar 2026 19:40:22 +0000 (20:40 +0100)]
tests : write to binary buffer to avoid newline translation in jinja -py [no ci] (#20365)

5 weeks agokleidiai: add data type check to get_tensor_traits (#20639)
Martin Klacer [Mon, 16 Mar 2026 19:25:54 +0000 (19:25 +0000)]
kleidiai: add data type check to get_tensor_traits (#20639)

* kleidiai: add data type check to get_tensor_traits

 * Added check for F16 data type into get_tensor_traits path with input data
   not in ggml_backend_cpu_kleidiai_buffer_type format (unsupported for Q4/8)

Signed-off-by: Martin Klacer <redacted>
Change-Id: I9aca4b9b8d669d35db6f1dbcc4e080b1919b1de7

* updated ggml/src/ggml-cpu/kleidiai/kleidiai.cpp

updated kleidiai.cpp file as per suggestion

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

Signed-off-by: Martin Klacer <redacted>
Co-authored-by: Georgi Gerganov <redacted>
5 weeks agoci : update labeler (#20629)
Sigbjørn Skjæret [Mon, 16 Mar 2026 19:24:20 +0000 (20:24 +0100)]
ci : update labeler (#20629)

5 weeks agojinja : add capability check for object args (#20612)
Aldehir Rojas [Mon, 16 Mar 2026 16:43:14 +0000 (11:43 -0500)]
jinja : add capability check for object args (#20612)

5 weeks agosync : ggml
Georgi Gerganov [Mon, 16 Mar 2026 12:56:06 +0000 (14:56 +0200)]
sync : ggml

5 weeks agoggml : try fix arm build (whisper/0)
Georgi Gerganov [Mon, 16 Mar 2026 07:11:13 +0000 (09:11 +0200)]
ggml : try fix arm build (whisper/0)

5 weeks agoggml : extend im2col f16 (ggml/1434)
David366AI [Sun, 15 Mar 2026 19:50:56 +0000 (15:50 -0400)]
ggml : extend im2col f16 (ggml/1434)

* examples/yolo: fix load_model memory leak

* fix/issue-1433 ggml_compute_forward_im2col_f16 assert error

* fix/issue-1433

5 weeks agowebui: add model information dialog to router mode (#20600)
Pascal [Mon, 16 Mar 2026 14:38:11 +0000 (15:38 +0100)]
webui: add model information dialog to router mode (#20600)

* webui: add model information dialog to router mode

* webui: add "Available models" section header in model list

* webui: remove nested scrollbar from chat template in model info dialog

* chore: update webui build output

* feat: UI improvements

* refactor: Cleaner rendering + UI docs

* chore: update webui build output

---------

Co-authored-by: Aleksander Grygier <redacted>
5 weeks agollama-graph: replace cont with reshape for alpha in qwen35 (#20640)
Aman Gupta [Mon, 16 Mar 2026 14:07:13 +0000 (22:07 +0800)]
llama-graph: replace cont with reshape for alpha in qwen35 (#20640)

5 weeks agowebui: Add MCP CORS Proxy detection logic & UI (#20167)
Aleksander Grygier [Mon, 16 Mar 2026 12:05:36 +0000 (13:05 +0100)]
webui: Add MCP CORS Proxy detection logic & UI (#20167)

* refactor: MCP store cleanup

* feat: Add MCP proxy availability detection

* fix: Sidebar icon

* chore: update webui build output

* chore: Formatting

* chore: update webui build output

* chore: Update package lock

* chore: update webui build output

* chore: update webui build output

* chore: update webui build output

5 weeks agoFix model selector locked to first loaded model with multiple models (#20580)
Pascal [Mon, 16 Mar 2026 11:04:06 +0000 (12:04 +0100)]
Fix model selector locked to first loaded model with multiple models (#20580)

* webui: fix model selector being locked to first loaded model

When multiple models are loaded, the auto-select effect would re-fire
on every loadedModelIds change, overriding the user's manual model
selection. Guard with selectedModelId so auto-select only kicks in
when no model is chosen yet.

* chore: update webui build output

5 weeks agowebui: use date in more human readable exported filename (#19939)
Woof Dog [Mon, 16 Mar 2026 10:18:13 +0000 (10:18 +0000)]
webui: use date in more human readable exported filename (#19939)

* webui: use date in exported filename

Move conversation naming and export to utils

update index.html.gz

* webui: move literals to message export constants file

* webui: move export naming and download back to the conversation store

* chore: update webui build output

* webui: add comments to some constants

* chore: update webui build output

5 weeks agovulkan: fix flash attention dot product precision (#20589)
Ruben Ortlam [Mon, 16 Mar 2026 09:45:49 +0000 (10:45 +0100)]
vulkan: fix flash attention dot product precision (#20589)

5 weeks agomodel : wire up Nemotron-H tensors for NVFP4 support (#20561)
Sigbjørn Skjæret [Mon, 16 Mar 2026 08:19:16 +0000 (09:19 +0100)]
model : wire up Nemotron-H tensors for NVFP4 support (#20561)

* wire up Nemotron-H tensors for NVFP4 support

* add ssm tensors

* alignment

5 weeks agoconvert : support mixed-precision ModelOpt models with per-tensor NVFP4/FP8 quantizat...
Richard Davison [Mon, 16 Mar 2026 08:18:47 +0000 (09:18 +0100)]
convert : support mixed-precision ModelOpt models with per-tensor NVFP4/FP8 quantization (#20539)

* support mixed-precision ModelOpt models with per-tensor NVFP4/FP8 quantization

* cleanup

* fallback

---------

Co-authored-by: Sigbjørn Skjæret <redacted>
5 weeks agocommon : fix iterator::end() dereference (#20445)
Masato Nakasaka [Mon, 16 Mar 2026 06:50:38 +0000 (23:50 -0700)]
common : fix iterator::end() dereference (#20445)

5 weeks agoCUDA: GDN hide memory latency (#20537)
Aman Gupta [Mon, 16 Mar 2026 03:41:45 +0000 (11:41 +0800)]
CUDA: GDN hide memory latency (#20537)

5 weeks agotools/cli: fix disable reasoning (#20606)
Piotr Wilkin (ilintar) [Sun, 15 Mar 2026 21:40:53 +0000 (22:40 +0100)]
tools/cli: fix disable reasoning (#20606)

5 weeks agoserver : fix wait in test_cancel_requests() test (#20601)
Georgi Gerganov [Sun, 15 Mar 2026 18:54:37 +0000 (20:54 +0200)]
server : fix wait in test_cancel_requests() test (#20601)

* server : fix wait in test_cancel_requests() test

* codeowners : add team for server tests

6 weeks agosycl : fix for untransposed GDA recurrent state (#20583)
Sigbjørn Skjæret [Sun, 15 Mar 2026 18:10:15 +0000 (19:10 +0100)]
sycl : fix for untransposed GDA recurrent state (#20583)

6 weeks agoci : only save openvino caches on github-hosted master (#20593)
Sigbjørn Skjæret [Sun, 15 Mar 2026 17:58:13 +0000 (18:58 +0100)]
ci : only save openvino caches on github-hosted master (#20593)

* only save openvino ccache on master

* disable toolkit cache if self-hosted

* only cache on github-hosted runners

* remove toolkit cache [no ci]

6 weeks agoCUDA: limit number of FA stream-k CUDA blocks (#20586)
Johannes Gäßler [Sun, 15 Mar 2026 17:30:47 +0000 (18:30 +0100)]
CUDA: limit number of FA stream-k CUDA blocks (#20586)

6 weeks agoggml: avoid creating CUDA context during device init (#20595)
Pascal [Sun, 15 Mar 2026 16:42:56 +0000 (17:42 +0100)]
ggml: avoid creating CUDA context during device init (#20595)

6 weeks agovendor : update cpp-httplib to 0.38.0 (#20578)
Adrien Gallouët [Sun, 15 Mar 2026 16:30:06 +0000 (17:30 +0100)]
vendor : update cpp-httplib to 0.38.0 (#20578)

Signed-off-by: Adrien Gallouët <redacted>
6 weeks ago ggml/hip: fix APU compatibility - soft error handling for hipMemAdviseSetCoarseGrain...
MoonShadow [Sun, 15 Mar 2026 16:23:58 +0000 (00:23 +0800)]
 ggml/hip: fix APU compatibility - soft error handling for hipMemAdviseSetCoarseGrain (#20536)

* ggml/hip: fix APU compatibility - soft error handling for hipMemAdviseSetCoarseGrain

On AMD APU/iGPU devices (unified memory architecture), hipMemAdviseSetCoarseGrain
returns hipErrorInvalidValue because the hint is not applicable to UMA systems.
The previous CUDA_CHECK() call treated this as a fatal error, causing crashes on
APU systems such as AMD Strix Halo (gfx1151).

Fix: treat hipMemAdviseSetCoarseGrain as an optional performance hint - call it
without error checking and clear any resulting error with hipGetLastError().

Also add pre-allocation debug logging (GGML_LOG_DEBUG) to help diagnose memory
issues on APU systems, and store totalGlobalMem in device info.

Context: AMD APUs on Windows are affected by a ROCm runtime bug that limits
hipMallocManaged to ~64GB regardless of available system RAM. A fix has been
submitted upstream: https://github.com/ROCm/rocm-systems/pull/4077

Co-Authored-By: Claude Sonnet 4.6 <redacted>
* ggml/hip: remove unrelated changes, keep only hipMemAdviseSetCoarseGrain fix

---------

Co-authored-by: moonshadow-25 <redacted>
Co-authored-by: Claude Sonnet 4.6 <redacted>
6 weeks agofix: prevent nullptr dereference (#20552)
Eric Hsieh [Sun, 15 Mar 2026 15:51:49 +0000 (23:51 +0800)]
fix: prevent nullptr dereference (#20552)

6 weeks agocodeowners : use teams (#20526)
Sigbjørn Skjæret [Sun, 15 Mar 2026 13:26:10 +0000 (14:26 +0100)]
codeowners : use teams (#20526)

* use teams

* update

* update

* update

* update

* update

6 weeks agoci : split build.yml + server.yml (#20546)
Georgi Gerganov [Sun, 15 Mar 2026 13:11:17 +0000 (15:11 +0200)]
ci : split build.yml + server.yml (#20546)

* ci : split build.yml

* cont : split server.yml

* cont : reduce paths

* cont : split build-android.yml + update paths

* ci : make msys workflows manual (#20588)

* ci : make cross-build workflows manual (#20585)

* cont : fix release paths

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

Co-authored-by: Sigbjørn Skjæret <redacted>
6 weeks agoconvert : support contiguous method on lora tensors (#20489)
Sigbjørn Skjæret [Sun, 15 Mar 2026 11:15:12 +0000 (12:15 +0100)]
convert : support contiguous method on lora tensors (#20489)

6 weeks agoggml : guard against sumq2 being 0 in IQ4_NL (#20460)
Bartowski [Sun, 15 Mar 2026 08:47:28 +0000 (04:47 -0400)]
ggml : guard against sumq2 being 0 in IQ4_NL (#20460)

6 weeks agocuda : add RDNA4-specific MMVQ parameter table for bs=1 decode (#19478)
PikaPikachu [Sun, 15 Mar 2026 07:33:39 +0000 (15:33 +0800)]
cuda : add RDNA4-specific MMVQ parameter table for bs=1 decode (#19478)

* mmvq: add RDNA3/RDNA4-specific parameter table (nwarps=8, rows=1)

* mmvq: add dedicated RDNA3 parameter table

* mmvq: exclude RDNA3.5 (gfx1150/1151) from RDNA3 table

6 weeks agovulkan: use graphics queue on AMD (#20551)
Ruben Ortlam [Sun, 15 Mar 2026 07:18:54 +0000 (08:18 +0100)]
vulkan: use graphics queue on AMD (#20551)

* vulkan: use graphics queue on AMD for slightly better performance

* disable async transfer queue on AMD

6 weeks agokv-cache : fix reading llama_kv_cell_ext during state read (#20273)
sprayandwipe [Sun, 15 Mar 2026 07:11:19 +0000 (07:11 +0000)]
kv-cache : fix reading llama_kv_cell_ext during state read (#20273)

Co-authored-by: sid <redacted>
6 weeks agomodel : wire up Qwen3.5/Qwen3.5MoE tensors for NVFP4 support (#20506)
Michael Wand [Sat, 14 Mar 2026 21:44:42 +0000 (14:44 -0700)]
model : wire up Qwen3.5/Qwen3.5MoE tensors for NVFP4 support (#20506)

6 weeks agometal : add FA specialization for HSK = 320, HSV = 256 (#20549)
Georgi Gerganov [Sat, 14 Mar 2026 21:15:47 +0000 (23:15 +0200)]
metal : add FA specialization for HSK = 320, HSV = 256 (#20549)

6 weeks agoci : move self-hosted workflows to separate files (#20540)
Georgi Gerganov [Sat, 14 Mar 2026 21:15:35 +0000 (23:15 +0200)]
ci : move self-hosted workflows to separate files (#20540)

6 weeks agodocker : force Python 3.13 in Vulkan container (#20530)
Gerard Guillemas Martos [Sat, 14 Mar 2026 20:37:09 +0000 (21:37 +0100)]
docker : force Python 3.13 in Vulkan container (#20530)

* ci: force Python 3.13 in Vulkan container

* remove unnecessary `update-alternatives` line

6 weeks agoci : try to optimize some jobs (#20521)
Eve [Sat, 14 Mar 2026 19:27:52 +0000 (19:27 +0000)]
ci : try to optimize some jobs (#20521)

* force arm version to test

* run on either x86 or arm if we can help it, this only works for runs without ccache

* readd other jobs

* remove ccache

6 weeks agohexagon: Q4_0 and MXFP4 repack fixes (#20527)
Max Krasnyansky [Sat, 14 Mar 2026 18:09:08 +0000 (11:09 -0700)]
hexagon: Q4_0 and MXFP4 repack fixes (#20527)

* hexagon: fix tail corruption with rows sizes not multiple of 256

* hexagon: use different stride for repacking partial blocks

* hex-mm: update repack and kernels to avoid shuffles for full 256-element blocks

Previous commit changed the repacking to use even:odd (0:1,2:3,..) packing
instead of the original (0:128,1:129,...) packing in order to fix tail corruption.
Since the mm kernels already deal with partial tails we can use even:odd
packing only for the last block.
This avoid performance penalty of having to shuffle to zip the elements
in the common case.

* hex-mm: update rmpy x8 for better optimizations

* hex-mm: tighten supported MUL_MAT checks to avoid spurios failures

* hex-mm: use vzero to init accumulators

* hex-mm: properly call partial rmpy_x8

6 weeks agoci : reduce webgpu tests timeout to 900s (#20538)
Georgi Gerganov [Sat, 14 Mar 2026 15:08:26 +0000 (17:08 +0200)]
ci : reduce webgpu tests timeout to 900s (#20538)

[no ci]

6 weeks agomtmd: add llama-mtmd-debug binary (#20508)
Xuan-Son Nguyen [Sat, 14 Mar 2026 14:52:29 +0000 (15:52 +0100)]
mtmd: add llama-mtmd-debug binary (#20508)

* mtmd: add llama-mtmd-debug binary

* adapt

* fixes

* fix compile error

* fix windows compile error

* rm legacy clip_debug_encode()

* add MTMD_API to fix build

6 weeks agoadd op gated_delta_net (#20455)
Neo Zhang [Sat, 14 Mar 2026 14:01:57 +0000 (22:01 +0800)]
add op gated_delta_net (#20455)

6 weeks agowebui: restore code preview iframe origin isolation (#20477)
Chedrian07 [Sat, 14 Mar 2026 10:28:28 +0000 (19:28 +0900)]
webui: restore code preview iframe origin isolation (#20477)

6 weeks agoscripts : remove get-wikitext-103.sh (#20543)
Adrien Gallouët [Sat, 14 Mar 2026 10:22:04 +0000 (11:22 +0100)]
scripts : remove get-wikitext-103.sh (#20543)

It doesn't work and no one seems to use it.

    $ wget https://s3.amazonaws.com/research.metamind.io/wikitext/wikitext-103-raw-v1.zip
    HTTP request sent, awaiting response... 301 Moved Permanently
    Location: unspecified
    ERROR: Redirection (301) without location.

Signed-off-by: Adrien Gallouët <redacted>
6 weeks agoscripts : update get-hellaswag.sh and get-winogrande.sh (#20542)
Adrien Gallouët [Sat, 14 Mar 2026 10:21:50 +0000 (11:21 +0100)]
scripts : update get-hellaswag.sh and get-winogrande.sh (#20542)

Signed-off-by: Adrien Gallouët <redacted>
6 weeks agoggml : add native AVX512-FP16 support for F16 operations (#20529)
Adrien Gallouët [Sat, 14 Mar 2026 09:06:14 +0000 (10:06 +0100)]
ggml : add native AVX512-FP16 support for F16 operations (#20529)

The overall benchmark speed remains almost the same because the CPU is
now calculating faster than the RAM can deliver the data. (See perf stat
results below showing 2.7 billion fewer instructions).

Also note that this path will be only enabled for native build or with
custom flags.

now:
```
 Performance counter stats for 'build/bin/llama-bench -m Qwen3-0.6B-f16.gguf -p 512 -n 128':

        189,073.52 msec task-clock                       #   14.658 CPUs utilized
               404      context-switches                 #    2.137 /sec
                19      cpu-migrations                   #    0.100 /sec
           372,390      page-faults                      #    1.970 K/sec
   310,877,195,595      instructions                     #    0.54  insn per cycle
   581,071,530,602      cycles                           #    3.073 GHz
    19,352,107,994      branches                         #  102.352 M/sec
        48,304,438      branch-misses                    #    0.25% of all branches
    84,998,431,152      L1-dcache-loads                  #  449.552 M/sec
    12,186,410,279      L1-dcache-load-misses            #   14.34% of all L1-dcache accesses

      12.899358742 seconds time elapsed

     187.823044000 seconds user
       1.253416000 seconds sys
```

before:
```
 Performance counter stats for 'build/bin/llama-bench -m Qwen3-0.6B-f16.gguf -p 512 -n 128':

        190,594.56 msec task-clock                       #   14.652 CPUs utilized
               436      context-switches                 #    2.288 /sec
                22      cpu-migrations                   #    0.115 /sec
           372,782      page-faults                      #    1.956 K/sec
   313,574,921,966      instructions                     #    0.54  insn per cycle
   586,064,970,425      cycles                           #    3.075 GHz
    19,585,778,563      branches                         #  102.761 M/sec
        48,437,488      branch-misses                    #    0.25% of all branches
    86,219,336,628      L1-dcache-loads                  #  452.370 M/sec
    12,232,085,771      L1-dcache-load-misses            #   14.19% of all L1-dcache accesses

      13.007923164 seconds time elapsed

     189.395316000 seconds user
       1.202612000 seconds sys
```

Signed-off-by: Adrien Gallouët <redacted>
6 weeks agoUse fp32 in cuBLAS V100 to avoid overflows, env variables to override cuBLAS compute...
Wallentri [Sat, 14 Mar 2026 07:43:13 +0000 (10:43 +0300)]
Use fp32 in cuBLAS V100 to avoid overflows, env variables to override cuBLAS compute type (#19959)

* Update ggml-cuda.cu

* Update ggml-cuda.cu

* Update build.md

* Update build.md

* Update ggml/src/ggml-cuda/ggml-cuda.cu

Co-authored-by: Johannes Gäßler <redacted>
* Update ggml-cuda.cu

* Update build.md

* Update ggml/src/ggml-cuda/ggml-cuda.cu

Co-authored-by: Johannes Gäßler <redacted>
* Update build.md

* Update ggml-cuda.cu

* Update ggml-cuda.cu

---------

Co-authored-by: Johannes Gäßler <redacted>
6 weeks agoggml : add OpenVINO backend (#15307)
Zijun Yu [Sat, 14 Mar 2026 05:56:55 +0000 (13:56 +0800)]
ggml : add OpenVINO backend (#15307)

* Update build doc

* Add cgraph tensor output name to OV op name

* Update openvino build instructions

* Add initial NPU support

* draft NPU support version 2: prefill + kvcache

* NPU support version 2: prefill + kvcache

* Change due to ggml cgraph changes, not correct yet

* Change due to ggml cgraph changes, llama-3.2 CPU work

* Add AMD64 to CMakeLists

* Change due to ggml cgraph changes, all device work

* Refactor: clean, fix warning

* Update clang-format

* Statful transformation for CPU GPU

* Add SwiGLU

* Fuse to SDPA

* Replace Concat with Broadcast in MulMat for GQA

* Pull out indices creation for kv cache update

* Refactor: remove past_token_len from extra_inputs

* Fix Phi3 SwiGLU and SoftMax

* Pull out sin cos from rope

* Reduce memory: free ov weights node after graph conversion

* Fix CPY due to cgraph change

* Added OpenVINO CI/CD. Updated docs

* Fix llama-cli

* Fix Phi3 ROPE; Add test-backend-ops

* Fix NPU

* Fix llama-bench; Clang-format

* Fix llama-perplexity

* temp. changes for mark decomp

* matmul in fp32

* mulmat input conversion fix

* mulmat type conversion update

* add mark decomp pass

* Revert changes in fuse_to_sdpa

* Update build.md

* Fix test-backend-ops

* Skip test-thread-safety; Run ctest only in ci/run.sh

* Use CiD for NPU

* Optimize tensor conversion, improve TTFT

* Support op SET_ROWS

* Fix NPU

* Remove CPY

* Fix test-backend-ops

* Minor updates for raising PR

* Perf: RMS fused to OV internal RMS op

* Fix after rebasing

- Layout of cache k and cache v are unified: [seq, n_head, head_size]
- Add CPY and FLASH_ATTN_EXT, flash attn is not used yet
- Skip test-backend-ops due to flash attn test crash
- Add mutex around graph conversion to avoid test-thread-safety fali in the future
- Update NPU config
- Update GPU config to disable SDPA opt to make phi-3 run

* Change openvino device_type to GPU; Enable flash_attn

* Update supports_buft and supports_op for quantized models

* Add quant weight conversion functions from genai gguf reader

* Quant models run with accuracy issue

* Fix accuracy: disable cpu_repack

* Fix CI; Disable test-backend-ops

* Fix Q4_1

* Fix test-backend-ops: Treat quantized tensors as weights

* Add NPU Q4_0 support

* NPU perf: eliminate zp

* Dequantize q4_1 q4_k q6_k for NPU

* Add custom quant type: q8_1_c, q4_0_128

* Set m_is_static=false as default in decoder

* Simpilfy translation of get_rows

* Fix after rebasing

* Improve debug util; Eliminate nop ReshapeReshape

* STYLE: make get_types_to_requant a function

* Support BF16 model

* Fix NPU compile

* WA for npu 1st token acc issue

* Apply EliminateZP only for npu

* Add GeGLU

* Fix Hunyuan

* Support iSWA

* Fix NPU accuracy

* Fix ROPE accuracy when freq_scale != 1

* Minor: not add attention_size_swa for non-swa model

* Minor refactor

* Add Q5_K to support phi-3-q4_k_m

* Requantize Q6_K (gs16) to gs32 on GPU

* Fix after rebasing

* Always apply Eliminate_ZP to fix GPU compile issue on some platforms

* kvcachefusion support

* env variable GGML_OPENVINO_DISABLE_SDPA_OPTIMIZATION added

* Fix for Phi3

* Fix llama-cli (need to run with --no-warmup)

* Fix add_sliced_mask; Revert mulmat, softmax; Remove input attention_size, iSWA model not working

* fix after rebasing

* Fix llama-3-8b and phi3-mini q4_0 NPU

* Update to OV-2025.3 and CMakeLists.txt

* Add OV CI cache

* Apply CISC review and update CI to OV2025.3

* Update CI to run OV dep install before build

* Update OV dockerfile to use OV2025.3 and update build docs

* Style: use switch in supports_ops

* Style: middle ptr and ref align, omit optional struct keyword

* NPU Unify PD (#14)

* Stateless. Fix llama-cli llama-server

* Simplify broadcast op in attention

* Replace get_output_tensor+memcpy with set_output_tensor

* NPU unify PD. Unify dynamic and static dims

* Clean placeholders in ggml-openvino.cpp

* NPU unify PD (handled internally)

* change graph to 4d, support multi sequences

* Fix llama-bench

* Fix NPU

* Update ggml-decoder.cpp

Hitting error while compiling on windows:

error C3861: 'unsetenv': identifier not found

Reason: unsetenv() is a POSIX function; it doesn’t exist on Windows. Visual Studio (MSVC) won’t recognize it.

Proposed fix: Use _putenv_s() (Windows equivalent)
This is supported by MSVC and achieves the same effect: it removes the environment variable from the process environment.

This keeps cross-platform compatibility.

* Update ggml-decoder.cpp

* Update ggml-decoder.cpp

* Update ggml-decoder.cpp

* Update ggml-decoder.cpp

* Update ggml-decoder.cpp

* Remove the second decoder for node. Moving the function into the model decoder

* Fix error for naive

* NPU prefill chunking

* NPU fix llama-bench

* fallback naive run with accuracy issue

* NPU support llma-perplexity -b 512 --no-warmup

* Refactor: split ov_graph_compute for dynamic and static

* remove unused API GgmlOvDecoder::get_output_stride(const std::string & name)

* minor update due to ov 2025.4

* remove unused API GgmlOvDecoder::get_output_names()

* remove unused API get_output_shape(const std::string & name)

* Modified API GgmlOvDecoder::get_output_type(const std::string & name)

* Removed API GgmlOvDecoder::get_output_op_params(const std::string & name)

* Removed API get_output_ggml_tensor(const std::string & name)

* Removed API m_outputs

* Removed m_output_names

* Removed API GgmlOvDecoder::get_input_names()

* Removed API GgmlOvDecoder::get_input_stride(const std::string& name)

* Removed API get_input_type

* Removed API get_input_type

* Removed API GgmlOvDecoder::get_input_shape(const std::string & name)

* Removed API GgmlOvDecoder::get_input_op_params(const std::string & name)

* Fix error for decoder cache

* Reuse cached decoder

* GPU remove Q6_K requantization

* NPU fix wrong model output shape

* NPU fix q4 perf regression

* Remove unused variable nodes

* Fix decoder can_reuse for llama-bench

* Update build.md for Windows

* backend buffer: allocate on host

* Use shared_buffer for GPU NPU; Refactor

* Add ov_backend_host_buffer; Use cached remote context

* Put kvcache on GPU

* Use ggml_aligned_malloc

* only use remote tensor for kvcache

* only use remote tensor for kvcache for GPU

* FIX: use remote tensor from singleton

* Update build.md to include OpenCL

* NPU always requant to q4_0_128

* Optimize symmetric quant weight extraction: use single zp

* Use Q8_0_C in token embd, lm_head, and for 5 and 6 bits quant

* Update build.md

* Support -ctk f32

* Initial stateful graph support

* Update ggml/src/ggml-openvino/ggml-decoder.cpp

Co-authored-by: Yamini Nimmagadda <redacted>
* code cleanup

* npu perf fix

* requant to f16 for Q6 embed on NPU

* Update ggml/src/ggml-openvino/ggml-decoder.cpp

* Update ggml/src/ggml-openvino/ggml-openvino-extra.cpp

* Create OPENVINO.md in llama.cpp backend docs

* Update OPENVINO.md

* Update OPENVINO.md

* Update OPENVINO.md

* Update build.md

* Update OPENVINO.md

* Update OPENVINO.md

* Update OPENVINO.md

* kq_mask naming fix

* Syntax correction for workflows build file

* Change ov backend buffer is_host to false

* Fix llama-bench -p -n where p<=256

* Fix --direct-io 0

* Don't put kvcache on GPU in stateful mode

* Remove hardcode names

* Fix stateful shapes

* Simplification for stateful and update output shape processing

* Remove hardcode names

* Avoid re-compilation in llama-bench

* Extract zp directly instead of bias

* Refactor weight tensor processing

* create_weight_node accept non-ov backend buffer

* remove changes in llama-graph.cpp

* stateful masking fix (#38)

Fix for stateful accuracy issues and cl_out_of_resources error in stateful GPU with larger context sizes.

* Fix test-backend-ops crash glu, get_rows, scale, rms_norm, add

* hardcoded name handling for rope_freqs.weight

* Suppress logging and add error handling to allow test-backend-ops to complete

* Fix MUL_MAT with broadcast; Add unsupported MUL_MAT FLASH_ATTN cases

* Use bias instead of zp in test-backend-ops

* Update OV in CI, Add OV CI Tests in GH Actions

* Temp fix for multithreading bug

* Update OV CI, fix review suggestions.

* fix editorconfig-checker, update docs

* Fix tabs to spaces for editorconfig-checker

* fix editorconfig-checker

* Update docs

* updated model link to be GGUF model links

* Remove GGML_CPU_REPACK=OFF

* Skip permuted ADD and MUL

* Removed static variables from utils.cpp

* Removed initializing non-existing variable

* Remove unused structs

* Fix test-backend-ops for OV GPU

* unify api calling

* Update utils.cpp

* When the dim is dynamic, throw an error, need to is stastic forst

* Add interface compute_model_outputs(), which get the model output through computing the node use count & status in the cgraph to avoid the flag using

* No need to return

* Fix test-backend-ops for OV GPU LNL

* Fix test-thread-safety

* use the shape from infer request of output tensor create to avoid issue

* fix dynamic output shape  issue

* fix issue for the unused node in tests

* Remove unused lock

* Add comment

* Update openvino docs

* update to OV release version 2026.0

* add ci ov-gpu self hosted runner

* fix editorconfig

* Fix perplexity

* Rewrite the model inputs finding mechanism  (#54)

* Rewrite the model inputs finding logistic

* Put stateful shape handle in get input shape

* Put the iteration logistic in func

* Added ggml-ci-intel-openvino-gpu and doc update

* .hpp files converted to .h

* fix ggml-ci-x64-intel-openvino-gpu

* Fix for stateful execution bug in llama-bench

* Minor updates after stateful llama-bench fix

* Update ggml/src/ggml-openvino/utils.cpp

Co-authored-by: Yamini Nimmagadda <redacted>
* Remove multiple get_shape calls

* Bring back mutex into compute

* Fix VIEW op, which slice the input node

* Added token_len_per_seq existence check before slicing masks and moved node retrieval inside guarded block to prevent missing-key access

* Temp. fix for test requant errors

* Update to OV ggml-ci to low-perf

* ci : temporary disable "test-llama-archs"

* ci : cache v4 -> v5, checkout v4 -> v6, fix runner tag

* docs : update url

* Fix OV link in docker and Update docs

---------

Co-authored-by: Ravi Panchumarthy <redacted>
Co-authored-by: Cavus Mustafa <redacted>
Co-authored-by: Arshath <redacted>
Co-authored-by: XuejunZhai <redacted>
Co-authored-by: Yamini Nimmagadda <redacted>
Co-authored-by: Xuejun Zhai <redacted>
Co-authored-by: Georgi Gerganov <redacted>
6 weeks agovendor : update cpp-httplib to 0.37.2 (#20484)
Adrien Gallouët [Sat, 14 Mar 2026 05:51:02 +0000 (06:51 +0100)]
vendor : update cpp-httplib to 0.37.2 (#20484)

Signed-off-by: Adrien Gallouët <redacted>
6 weeks agoFix data race in CUDA's "cpy" kernel (influences GGML's DUP, CONT operations). (...
Rail Chabdarov [Sat, 14 Mar 2026 05:19:44 +0000 (06:19 +0100)]
Fix data race in CUDA's "cpy" kernel (influences GGML's DUP, CONT operations). (#20507)

* Fix datarace in CUDA's "cpy" kernel.

* Remove extra barrier by using more of shared memory.

6 weeks agoopencl: fix l2_norm (#20480)
lhez [Sat, 14 Mar 2026 05:18:52 +0000 (22:18 -0700)]
opencl: fix l2_norm (#20480)

6 weeks agotools : enable kvu in perplexity for hellaswag, winogrande, multiple-choice (#19954)
Adrien Gallouët [Fri, 13 Mar 2026 20:25:57 +0000 (21:25 +0100)]
tools : enable kvu in perplexity for hellaswag, winogrande, multiple-choice (#19954)

llama-perplexity -hf unsloth/Qwen3-0.6B-GGUF:Q4_K_M -f winogrande-debiased-eval.csv --winogrande

    winogrande_score : tokenizing selected tasks
    winogrande_score : calculating winogrande score over selected tasks.
    split_equal: sequential split is not supported when there are coupled sequences in the input batch (you may need to use the -kvu flag)
    decode: failed to find a memory slot for batch of size 46
    failed to decode the batch, n_batch = 2048, ret = 1
    winogrande_score: llama_decode() failed

same for hellaswag:

    split_equal: sequential split is not supported when there are coupled sequences in the input batch (you may need to use the -kvu flag)
    decode: failed to find a memory slot for batch of size 99
    failed to decode the batch, n_batch = 2048, ret = 1
    hellaswag_score: llama_decode() failed

Signed-off-by: Adrien Gallouët <redacted>
6 weeks agograph : remove redundant GDN state transposes (#20443)
Georgi Gerganov [Fri, 13 Mar 2026 20:12:54 +0000 (22:12 +0200)]
graph : remove redundant GDN state transposes (#20443)

* ggml : transpose fused GDN state access for coalesced memory reads (#20436)

The fused Gated Delta Net kernel accessed the [S_v, S_v] state matrix
column-wise on row-major storage, causing strided reads (stride S_v =
128 floats = 512 bytes) that waste GPU cache bandwidth. This produced a
39% regression on Qwen3.5-9B (Metal, M4 Max) compared to the unfused
path.

Transpose the state indexing so threads read contiguously:
- Metal: s_ptr[is*S_v] -> s_ptr[is] (stride 1 vs S_v)
- CUDA:  curr_state[i*S_v+col] -> curr_state[col*S_v+i] (coalesced)
- CPU:   restructured loops for row-wise transposed access

Also add --fused-gdn [on|off|auto] CLI flag (mirrors --flash-attn) so
users can control fused GDN independently of auto-detection.

All GATED_DELTA_NET backend-ops tests pass.

Co-Authored-By: Claude Opus 4.6 <redacted>
* ggml : use SIMD dot products in CPU GDN kernel, couple AR/chunked fused flags

- Replace scalar inner loops with ggml_vec_dot_f32 for SIMD-optimized
  dot products in the CPU fused GDN kernel (delta and attention output)
- Couple fused_gdn_ar and fused_gdn_ch flags in auto-detection: if one
  path lacks device support, disable both to prevent state layout mismatch
  between transposed (fused) and non-transposed (unfused) formats

Co-Authored-By: Claude Opus 4.6 <redacted>
* llama : rever fgdn argument changes

* graph : remove GDN state transposes

* vulkan : adapt

* cuda : remove obsolete smem code

---------

Co-authored-by: Paul Flynn <redacted>
Co-authored-by: Claude Opus 4.6 <redacted>
Co-authored-by: Oliver Simons <redacted>
6 weeks agocommon/parser: gracefully handle undetected tool parser, print error message. (#20286)
Piotr Wilkin (ilintar) [Fri, 13 Mar 2026 19:56:10 +0000 (20:56 +0100)]
common/parser: gracefully handle undetected tool parser, print error message. (#20286)

6 weeks agollama : fix pooling assertion crash in chunked GDN detection path (#20468)
ZeroV0LT [Fri, 13 Mar 2026 18:53:42 +0000 (19:53 +0100)]
llama : fix pooling assertion crash in chunked GDN detection path (#20468)

* llama : fix pooling assertion crash in chunked GDN detection path

The chunked fused Gated Delta Net detection in sched_reserve() calls
graph_reserve(16*n_seqs, n_seqs, n_outputs, ...) where n_outputs = n_seqs.
This creates a dimension mismatch in build_pooling() for embedding models
with mean/rank pooling: build_inp_mean() creates a tensor with shape
[n_tokens=16*n_seqs, ...] while t_embd is reduced to [n_outputs=n_seqs, ...]
via out_ids, causing ggml_mul_mat to assert on ggml_can_mul_mat(a, b).

Fix: pass n_tokens as n_outputs in the chunked GDN graph reservation,
matching the pattern used by the pp/tg worst-case reservations.

Regression introduced by #20340 (d28961d).
Same class of bug as #12517, fixed by #12545.

* server : add mean pooling tests to embedding test suite

Add test_embedding_pooling_mean and test_embedding_pooling_mean_multiple
to cover the --pooling mean codepath, which was previously untested.

These tests would have caught the regression introduced by #20340 where
build_pooling() crashes with a ggml_mul_mat assertion due to mismatched
dimensions in the chunked GDN detection path.

---------

Co-authored-by: Domenico Crupi <redacted>
6 weeks agoserver: reset counter related to kill-switch on client error (#20513)
SoftwareRenderer [Fri, 13 Mar 2026 17:58:09 +0000 (13:58 -0400)]
server: reset counter related to kill-switch on client error (#20513)

* server: reset kill-switch on client error

This avoids triggering a server kill switch.

If the client sends a request that exceeds the configured context size, an appropriate HTTP 400 response is provided and no tokens are generated.

However since no tokens are generated, update_slots() increments n_empty_consecutive. If the client sends 3 such messages in a row, the server terminates.

* moved counter reset as per recommendation

* cont : minor

---------

Co-authored-by: Georgi Gerganov <redacted>
6 weeks agoggml-cpu: add RVV vec dot kernels for quantization types (#18859)
rehan-10xengineer [Fri, 13 Mar 2026 15:36:04 +0000 (20:36 +0500)]
ggml-cpu: add RVV vec dot kernels for quantization types (#18859)

* ggml-cpu: add rvv quantize_row_q8_K kernel

Co-authored-by: Rehan Qasim <redacted>
* ggml-cpu: add rvv vec_dot for iq4_nl, mxfp4, iq2_xxs

Co-authored-by: Rehan Qasim <redacted>
* ggml-cpu: add rvv vec_dot for iq4_xs, refactor

* ggml-cpu: remove ifunc for rvv vec dot

* ggml-cpu: add vec_dot for iq2_xs, iq3_xxs

Co-authored-by: Rehan Qasim <redacted>
* ggml-cpu: refactor quants.c

---------

Co-authored-by: taimur-10x <redacted>
Co-authored-by: Rehan Qasim <redacted>
Co-authored-by: Rehan Qasim <redacted>
6 weeks agoggml : fix typo gmml (#20512)
Adrien Gallouët [Fri, 13 Mar 2026 13:36:13 +0000 (14:36 +0100)]
ggml : fix typo gmml (#20512)

Signed-off-by: Adrien Gallouët <redacted>
6 weeks agomtmd : rename mtmd_get_audio_bitrate to mtmd_get_audio_sample_rate (#20105)
Daniel Bevenius [Fri, 13 Mar 2026 11:30:02 +0000 (12:30 +0100)]
mtmd : rename mtmd_get_audio_bitrate to mtmd_get_audio_sample_rate (#20105)

This commit renames the the function `mtmd_get_audio_bitrate` to
`mtmd_get_audio_sample_rate` to better reflect its purpose.

The motivation for this is that the function currently returns the audio
sample rate, not the bitrate (sample_rate × bit_depth × channels), and
that is how it is used in the code as well.

This is a breaking change, but I believe mtmd is still in
experimental/development phase so it might be alright to simply rename.