]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/log
pkg/ggml/sources/whisper.cpp
11 days agocmake : update blas logic (llama/18205)
Perry Naseck [Sat, 10 Jan 2026 16:00:54 +0000 (11:00 -0500)]
cmake : update blas logic (llama/18205)

11 days agoCorrected: changed s13 = src1->nb[3] instead of nb[2] (llama/18724)
Michael Wand [Sat, 10 Jan 2026 09:16:07 +0000 (01:16 -0800)]
Corrected: changed s13 = src1->nb[3] instead of nb[2] (llama/18724)

11 days agoopencl: add EXPM1 op (llama/18704)
shaofeiqi [Fri, 9 Jan 2026 18:13:13 +0000 (10:13 -0800)]
opencl: add EXPM1 op (llama/18704)

11 days agoUpdates to webgpu get_memory (llama/18707)
Reese Levine [Fri, 9 Jan 2026 16:17:18 +0000 (08:17 -0800)]
Updates to webgpu get_memory (llama/18707)

11 days agollama: use host memory if device reports 0 memory (llama/18587)
Aaron Teo [Thu, 8 Jan 2026 21:34:56 +0000 (05:34 +0800)]
llama: use host memory if device reports 0 memory (llama/18587)

11 days agoggml-webgpu: Fix GGML_MEM_ALIGN to 8 for emscripten. (llama/18628)
Masashi Yoshimura [Thu, 8 Jan 2026 16:36:42 +0000 (01:36 +0900)]
ggml-webgpu: Fix GGML_MEM_ALIGN to 8 for emscripten. (llama/18628)

* Fix GGML_MEM_ALIGN to 8 for emscripten.

* Add a comment explaining the need for GGML_MEM_ALIGN == 8 in 64-bit wasm with emscripten

11 days agoggml webgpu: initial flashattention implementation (llama/18610)
Reese Levine [Thu, 8 Jan 2026 16:23:39 +0000 (08:23 -0800)]
ggml webgpu: initial flashattention implementation (llama/18610)

* FlashAttention (llama/13)

* Add inplace softmax

* Move rms_norm to split row approach

* Update debug for supports_op

* clean up debug statements

* neg f16xf32xip builds and runs, havent actually ran a model that uses neg kernel yet though

* neg passes backend test

* unary operators pass ggml tests

* rms_norm double declaration bug atoned

* abides by editor-config

* removed vestigial files

* fixed autoconfig

* All operators (inlcluding xielu) working

* removed unnecesarry checking if node->src[1] exists for unary operators

* responded and dealt with PR comments

* implemented REPL_Template support and removed bug in unary operators kernel

* formatted embed wgsl and ggml-webgpu.cpp

* Faster tensors (llama/8)

Add fast matrix and matrix/vector multiplication.

* Use map for shader replacements instead of pair of strings

* Wasm (llama/9)

* webgpu : fix build on emscripten

* more debugging stuff

* test-backend-ops: force single thread on wasm

* fix single-thread case for init_tensor_uniform

* use jspi

* add pthread

* test: remember to set n_thread for cpu backend

* Add buffer label and enable dawn-specific toggles to turn off some checks

* Intermediate state

* Fast working f16/f32 vec4

* Working float fast mul mat

* Clean up naming of mul_mat to match logical model, start work on q mul_mat

* Setup for subgroup matrix mat mul

* Basic working subgroup matrix

* Working subgroup matrix tiling

* Handle weirder sg matrix sizes (but still % sg matrix size)

* Working start to gemv

* working f16 accumulation with shared memory staging

* Print out available subgroup matrix configurations

* Vectorize dst stores for sg matrix shader

* Gemv working scalar

* Minor set_rows optimization (llama/4)

* updated optimization, fixed errors

* non vectorized version now dispatches one thread per element

* Simplify

* Change logic for set_rows pipelines

---------

Co-authored-by: Neha Abbas <redacted>
Co-authored-by: Neha Abbas <redacted>
Co-authored-by: Reese Levine <redacted>
* Comment on dawn toggles

* Working subgroup matrix code for (semi)generic sizes

* Remove some comments

* Cleanup code

* Update dawn version and move to portable subgroup size

* Try to fix new dawn release

* Update subgroup size comment

* Only check for subgroup matrix configs if they are supported

* Add toggles for subgroup matrix/f16 support on nvidia+vulkan

* Make row/col naming consistent

* Refactor shared memory loading

* Move sg matrix stores to correct file

* Working q4_0

* Formatting

* Work with emscripten builds

* Fix test-backend-ops emscripten for f16/quantized types

* Use emscripten memory64 to support get_memory

* Add build flags and try ci

---------

Co-authored-by: Xuan Son Nguyen <redacted>
* Remove extra whitespace

* Move wasm single-thread logic out of test-backend-ops for cpu backend

* Disable multiple threads for emscripten single-thread builds in ggml_graph_plan

* Refactored pipelines and workgroup calculations (llama/10)

* refactored pipelines

* refactored workgroup calculation

* removed commented out block of prior maps

* Clean up ceiling division pattern

---------

Co-authored-by: Neha Abbas <redacted>
Co-authored-by: Reese Levine <redacted>
* Start work on flash attention

* Shader structure set up (many bugs still)

* debugging

* Working first test

* Working with head grouping, head sizes to 128, logit softcap, mask/sinks enabled, f32

* Generalize softmax to work with multiple subgroups, f16 accumulation, mask shared memory tiling

* Start work on integrating pre-wgsl

* Separate structs/initial shader compilation library into separate files

* Work on compilation choices for flashattention

* Work on subgroup matrix/tile size portability

* subgroup size agnostic online softmax

* Cleanups, quantization types

* more cleanup

* fix wasm build

* Refactor flashattention to increase parallelism, use direct loads for KV in somce cases

* Checkpoint

* formatting

* Update to account for default kv cache padding

* formatting shader

* Add workflow for ggml-ci webgpu

* Try passing absolute path to dawn in ggml-ci

* Avoid error on device destruction, add todos for proper cleanup

* Fix unused warning

* Forgot one parameter unused

* Move some flashattn computation to f32 for correctness

11 days agovulkan: fix push constant size for quantize_q8_1 (llama/18687)
Jeff Bolz [Thu, 8 Jan 2026 14:40:58 +0000 (08:40 -0600)]
vulkan: fix push constant size for quantize_q8_1 (llama/18687)

I added an assert to catch further mismatches, and it found several.
Fix those, too.

11 days agovulkan: optimize ssm_scan (llama/18630)
Jeff Bolz [Thu, 8 Jan 2026 14:16:54 +0000 (08:16 -0600)]
vulkan: optimize ssm_scan (llama/18630)

* vulkan: optimize ssm_scan

* fix warp vs subgroup naming

11 days agometal : add MoE kernel specialization for ne20=5 (llama/18667)
도로로도로또 [Thu, 8 Jan 2026 10:37:45 +0000 (19:37 +0900)]
metal : add MoE kernel specialization for ne20=5 (llama/18667)

Add template specialization for kernel_mul_mm_id_map0 with ne20=5
to support models using 5 active experts (e.g., VAETKI).

11 days agoggml: add env var GGML_OP_OFFLOAD_MIN_BATCH (llama/18535)
Doctor Shotgun [Thu, 8 Jan 2026 09:03:21 +0000 (01:03 -0800)]
ggml: add env var GGML_OP_OFFLOAD_MIN_BATCH (llama/18535)

* ggml: add env var GGML_OP_OFFLOAD_MIN_BATCH
* makes the min_batch_size for triggering op offload configurable via env var, defaulting to the prior hardcoded value of 32

* ggml: read GGML_OP_OFFLOAD_MIN_BATCH once and store to dev ctx

* cann: forward declaration of device context struct

* cann: move offload op check after device context declaration

* cuda: fix whitespace

Co-authored-by: Aman Gupta <redacted>
---------

Co-authored-by: Aman Gupta <redacted>
11 days agoopencl: add FILL op support (llama/18682)
shaofeiqi [Thu, 8 Jan 2026 06:04:50 +0000 (22:04 -0800)]
opencl: add FILL op support (llama/18682)

11 days agocuda : fix build on cuda 12.8 (llama/18672)
Oliver Walsh [Wed, 7 Jan 2026 21:32:44 +0000 (21:32 +0000)]
cuda : fix build on cuda 12.8 (llama/18672)

compute121 requires 12.9

Signed-off-by: Oliver Walsh <redacted>
11 days agovulkan: reject ops when a tensor is too large to allocate (llama/18646)
Jeff Bolz [Wed, 7 Jan 2026 11:03:32 +0000 (05:03 -0600)]
vulkan: reject ops when a tensor is too large to allocate (llama/18646)

11 days agovulkan: Warptile tuning for Intel Xe2/Xe3 (llama/18178)
virajwad [Wed, 7 Jan 2026 10:59:47 +0000 (02:59 -0800)]
vulkan: Warptile tuning for Intel Xe2/Xe3 (llama/18178)

* modify warptile tuning for xe3

* intel vendor check w/ coopmat support

* fix back formatting

* fix formatting change 2

* move intel check to chip specific tuning part

* Change to support both windows and linux

* modify m_warptile to l_warptile for intel

* modify warptile tuning for bf16 matmuls to fix regression (m_warptile to l_warptile)

* Code style changes

* Code style changes (2)

* Code style changes (3)

11 days agovulkan: more mul mat optimizations (llama/18533)
Eve [Wed, 7 Jan 2026 10:13:17 +0000 (10:13 +0000)]
vulkan: more mul mat optimizations (llama/18533)

* q4_k

* q5_k

* q2_k

* q4_1

* q5_1

* better buf index

11 days agoCANN: Fix rename for get_env (llama/18652)
hipudding [Wed, 7 Jan 2026 08:11:31 +0000 (16:11 +0800)]
CANN: Fix rename for get_env (llama/18652)

In #18624, get_env in ggml-cann was renamed to get_env_as_lowercase
to accurately reflect the function’s behavior and reduce the chance
of misuse. However, the update missed renaming call sites in other
files. This commit fixes that oversight.

11 days agoCANN: Rename `get_env` to `get_env_as_lowercase` (llama/18624)
Raul Torres [Wed, 7 Jan 2026 02:01:25 +0000 (02:01 +0000)]
CANN: Rename `get_env` to `get_env_as_lowercase` (llama/18624)

11 days agoHexagon add support for f16/f32 flash attention, scale, set-rows and improve f16...
Max Krasnyansky [Wed, 7 Jan 2026 01:38:29 +0000 (17:38 -0800)]
Hexagon add support for f16/f32 flash attention, scale, set-rows and improve f16/32 matmul (llama/18611)

* hexagon: improve fp16 matmul and add fp32/fp16 flash-attention

* hexagon: add support for set-rows fp32 -> fp16 with i32/i64 row-idx

* hexagon: add support for SCALE fp32

* hexagon: replace scalar fp32 -> fp16 copy with HVX

* hexagon: optimize flash_atten_ext with aligned VTCM buffers and DMA

- Implements double-buffered DMA prefetching for K, V, and Mask tensors.
- Ensures K and V rows in VTCM are padded to 128 bytes to support aligned HVX operations.
- Correctly synchronizes DMA transfers to prevent race conditions.
- Uses `FLASH_ATTN_BLOCK_SIZE` of 128 for efficient chunking.

* hexagon: use aligned mad_f16

* hexagon: flash_atten more aligned ops

* hexagon: optimize scale_f32 hvx helpers

* hexagon: unroll fa loops

* hexagon: remove unused set-rows log

* hexagon: flash_attn_ext add support for DMAing Q

- Update `op_flash_attn_ext` to include Q row size in scratchpad allocation.
- Pad Q row size to 128 bytes for alignment.
- Implement DMA transfer for Q tensor in `flash_attn_ext_f16_thread`.
- Update dot product computations to use VTCM-buffered Q data.

* hexagon: fix handling of NANs hvx dotproducts

* hexagon: cleanup spad allocation in flash-atten

* hexagon: improve fp16/fp32 matmul

- Introduced `vec_dot_f16_f16` and `vec_dot_f16_f16_rx2` kernels using efficient HVX dot product intrinsics.
- Added `quantize_fp32_f16` to copy/convert weights from DDR to VTCM
- Updated `op_matmul` to use the optimized path when VTCM capacity allows and broadcasting requirements are compatible.
- Implemented fallback logic to the original implementation for complex broadcasting scenarios.

* hexagon: fix HVX_ARCH check

* hexagon: matmul cleanup and fp16 fixes

Use aligned vec_dot_f16 for 2d matmuls and unaligned version for 4d.

* hexagon: fix fp16 x fp16 matmuls and some minor refactoring

* hexagon: add support for GET_ROWS f32 -> f32

Also optimize SET_ROWS threading a bit when we have just a few rows to process.

* hexagon: optimize set-rows threading

* hexagon: update adb/run-bench.sh to properly support experimental and verbose options

* hexagon: flash_atten use aligned vectors for dot products

11 days agoggml : optimize cuda ssm_scan using warp-level reduction (llama/18505)
Aadeshveer Singh [Tue, 6 Jan 2026 18:24:34 +0000 (23:54 +0530)]
ggml : optimize cuda ssm_scan using warp-level reduction (llama/18505)

* ggml : optimize cuda ssm_scan using warp-level reduction

* ggml : apply code review suggestions (style, const, constexpr)

* ggml : add TODO regarding stride consistency

11 days agovulkan: support buffer_from_host_ptr (llama/18467)
Jeff Bolz [Tue, 6 Jan 2026 16:37:07 +0000 (10:37 -0600)]
vulkan: support buffer_from_host_ptr (llama/18467)

* vulkan: support buffer_from_host_ptr

* hacky use of buffer_from_host_ptr for directio

* disable buffer_from_host_ptr cap

* use external memory for ggml_vk_host_malloc, revert model loader changes

* disable external_memory_host for MoltenVK

* take buffer memory types into account

* don't use external_memory_host for ggml_vk_host_malloc

11 days agoggml-cuda: refactor cuda graph usage (llama/18637)
Aman Gupta [Tue, 6 Jan 2026 15:48:45 +0000 (23:48 +0800)]
ggml-cuda: refactor cuda graph usage (llama/18637)

* ggml-cuda: refactor cuda graph usage

* use is_enabled() instead of enabled

11 days agommq.cu: tune mmq/rocblas switching for RDNA (llama/18537)
Beinsezii [Tue, 6 Jan 2026 15:26:07 +0000 (07:26 -0800)]
mmq.cu: tune mmq/rocblas switching for RDNA (llama/18537)

* Patch perf regression for mmq kernels in ROCm

recover performance regression for https://github.com/ggml-org/llama.cpp/issues/17917

* add n_experts branch like the cdna path

* mmq.cu: tune mmq/wmma switching for RDNA

* mmq.cu: move amd wmma mmq/wmma switching behind IS_RDNA3

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

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

Co-authored-by: Jiacheng (Jason) Chen <redacted>
Co-authored-by: jiachengjason <redacted>
Co-authored-by: Johannes Gäßler <redacted>
11 days agoggml : fix avx512bf16 build (llama/18623)
Adrien Gallouët [Tue, 6 Jan 2026 06:54:10 +0000 (07:54 +0100)]
ggml : fix avx512bf16 build (llama/18623)

- include `immintrin.h` when required
- remove unused m512bh

Signed-off-by: Adrien Gallouët <redacted>
11 days agoCANN: Make `valid_values` variable `static const` (llama/18627)
Raul Torres [Tue, 6 Jan 2026 03:53:28 +0000 (03:53 +0000)]
CANN: Make `valid_values` variable `static const` (llama/18627)

11 days agoggml webgpu: add CEIL operation support (llama/18605)
nwyin [Mon, 5 Jan 2026 19:38:57 +0000 (13:38 -0600)]
ggml webgpu: add CEIL operation support (llama/18605)

* ggml-webgpu: add CEIL operation support

      Add support for the CEIL unary operation in the WebGPU backend:
      - Add CEIL_FUNC shader template in unary_op.wgsl
      - Add 4 shader variants (f32, f16, inplace versions)
      - Initialize CEIL pipelines in ggml-webgpu.cpp
      - Register CEIL in supports_op function

* docs: update WebGPU ops support for CEIL

11 days agoCUDA: fix FA FP16 accumulator overflow for Granite (llama/18614)
Johannes Gäßler [Mon, 5 Jan 2026 18:51:13 +0000 (19:51 +0100)]
CUDA: fix FA FP16 accumulator overflow for Granite (llama/18614)

11 days agoggml-cuda: check for srcs outside the cgraph (llama/18583)
Aman Gupta [Mon, 5 Jan 2026 14:46:36 +0000 (22:46 +0800)]
ggml-cuda: check for srcs outside the cgraph (llama/18583)

* ggml-cuda: check for srcs outside the cgraph

* review: use leafs instead

11 days agovulkan: fix topk_moe_sigmoid_norm_bias failures in GLM-4.6 (llama/18582)
Jeff Bolz [Mon, 5 Jan 2026 10:51:39 +0000 (04:51 -0600)]
vulkan: fix topk_moe_sigmoid_norm_bias failures in GLM-4.6 (llama/18582)

11 days agovulkan: handle quantize_q8_1 overflowing the max workgroup count (llama/18515)
Jeff Bolz [Mon, 5 Jan 2026 10:30:14 +0000 (04:30 -0600)]
vulkan: handle quantize_q8_1 overflowing the max workgroup count (llama/18515)

* vulkan: handle quantize_q8_1 overflowing the max workgroup count

* vulkan: Fix small tile size matmul on lavapipe

* fix mul_mat_id failures

11 days agoCANN: add operator fusion support for ADD + RMS_NORM (llama/17512)
Chenguang Li [Mon, 5 Jan 2026 07:38:18 +0000 (15:38 +0800)]
CANN: add operator fusion support for ADD + RMS_NORM (llama/17512)

This commit implements operator fusion for ADD + RMS_NORM operations
in the CANN backend to reduce memory access overhead and improve
performance. The fusion is controlled by the GGML_CANN_OPERATOR_FUSION
environment variable (default: false).

Changes:
- Implement ggml_cann_op_add_rms_norm_fused() using ACLNN AddRmsNorm
- Add ggml_cann_can_fuse() to check fusion eligibility
- Integrate fusion logic into computation graph evaluation
- Add test cases for ADD + RMS_NORM fusion
- Update documentation with new environment variable

The fusion combines ADD and RMS_NORM into a single kernel call,
which is more efficient than executing them separately.

11 days agosampling : add support for backend sampling (llama/17004)
Daniel Bevenius [Sun, 4 Jan 2026 20:22:16 +0000 (21:22 +0100)]
sampling : add support for backend sampling (llama/17004)

* sampling : add support for backend sampling

This commit adds support for performing sampling operations on the
backend (e.g. GPU) as part of the model computation graph.

The motivation for this feature is to enable sampling to be performed
directly on the backend as part of the computation graph being executed,
allowing for some or all of the sampling to be done on the backend.

For example, the backend sampler chain might select/sample a token
directly in which case only the sampled token needs to be transferred
from device memory to host memory.

It is also possible for the backend samplers to perform filtering of
the logits, or compute and filter the probability distribution, in
which case only the filtered logits or probabilites need to be
transferred back to system memory for further processing by CPU
samplers.

Currently the backend sampling works in a similar manner to how
pooling works, it is a function that is called by build_graph and the
sampler operations become part of the models computation graph.

* llama-cli : add backend sampler configuration

* server : add backend sampling options/configuration

* webui : add backend sampling options

* ggml : add initial cumsum implementation for CUDA

* sampling : enable all backend sampler tests

This commit enables all exisiting backend sampler tests in the
test-backend-sampler. Previously, some tests were disabled because
there were missing ggml operation implementations.

* graph : do not include llama-model.h

* sampling : always expose sampled_ids

This commit precomputes and caches the full-vocab token id list in
llama_context's constructor, so llama_get_backend_sampled_token_ids_ith
always returns a valid pointer.

The motivation for this is that this enables both common/sampling.cpp
and src/llama-sampling.cpp can simplify their logic.

Not all backends samplers that process logits need to set the
sampled_tokens_id as they may not change the order of the logits, for
example the temperature sampler only scales the logits but does not
change their order. Simliar the logit bias sampler only adds bias to
specific token ids but does not change the order of the logits. In
these cases there will not be a device to host copy of the sampled
token ids, and this is the use case where having this precomputed
list is useful.

* sampling : ensure at most one output token per seq

This commit adds a check in the batch allocator to ensure that when
backend sampling is enabled, at most one output token is specified per
sequence.

* CUDA: Optimize argsort for gpu-based token sampling

Argsort is used for top-k currently. WE optimize argsort by 2 things:

1. Use `DeviceRadixSort` for single-row/sequence to parallelize it
   across our SMs
2. Use `DeviceSegmentedSort` for multi-row/sequence as this is the
   correct entrypoint (the function chooses different execution paths,
   it contains `DeviceSegmentedRadixSort` as one of the paths and will
   choose the best one according to heuristics.
   https://nvidia.github.io/cccl/cub/api/structcub_1_1DeviceSegmentedSort.html#overview

Some perf numbers for a RTX PRO 6000:

On the kernel level, tested with
`GGML_CUDA_DISABLE_GRAPHS=1 ./test-backend-ops -o ARGSORT perf`
Before:
```
  ARGSORT(type=f32,ne=[65000,16,1,1],order=0):                  4130 runs -   359.24 us/run
  ARGSORT(type=f32,ne=[200000,1,1,1],order=0):                  8192 runs -   861.34 us/run
  ARGSORT(type=f32,ne=[200000,16,1,1],order=0):                 1343 runs -  1020.01 us/run
```

After:
```
  ARGSORT(type=f32,ne=[65000,16,1,1],order=0):                  4130 runs -   312.41 us/run
  ARGSORT(type=f32,ne=[200000,1,1,1],order=0):                 16384 runs -    63.48 us/run
  ARGSORT(type=f32,ne=[200000,16,1,1],order=0):                 1343 runs -   874.36 us/run
```

11 days agoCUDA: disable cuda graph when using n-cpu-moe (llama/18593)
Aman Gupta [Sun, 4 Jan 2026 17:37:48 +0000 (01:37 +0800)]
CUDA: disable cuda graph when using n-cpu-moe (llama/18593)

* CUDA: disable cuda graph when using n-cpu-moe

* call ggml_cuda_set_device

11 days agoggml-cuda: remove unused params in ggml_cuda_graph (llama/18579)
Aman Gupta [Sun, 4 Jan 2026 17:37:09 +0000 (01:37 +0800)]
ggml-cuda: remove unused params in ggml_cuda_graph (llama/18579)

11 days agoggml-cuda: fixes for concurrent streams (llama/18496)
Aman Gupta [Sat, 3 Jan 2026 15:15:01 +0000 (23:15 +0800)]
ggml-cuda: fixes for concurrent streams (llama/18496)

11 days agoCUDA: only allocate FA tmp buffer if needed (llama/18564)
Johannes Gäßler [Sat, 3 Jan 2026 12:55:53 +0000 (13:55 +0100)]
CUDA: only allocate FA tmp buffer if needed (llama/18564)

11 days ago(Bugfix, ggml-cuda) Pool alloc count fix + small size computation type adjustment...
pl752 [Sat, 3 Jan 2026 10:13:40 +0000 (15:13 +0500)]
(Bugfix, ggml-cuda) Pool alloc count fix + small size computation type adjustment (llama/18559)

* CUDA: Fixed obj byte size instead of obj count being passed to pool alloc (fattn-common, dst_tmp_meta)

* CUDA: Explicitly casted some of the int alloc counts before multiplication in argsort

---------

Co-authored-by: pl752 <redacted>
11 days agoggml-hexagon: optimize activation function (llama/18393)
Shouyu [Sat, 3 Jan 2026 05:24:24 +0000 (00:24 -0500)]
ggml-hexagon: optimize activation function (llama/18393)

* refactor: refactor silu

* refactor: optimize swiglu

* refactor: remove unncessary if in swiglu

* refactor: refactor swiglu_oai

* chore: fix formatting issue

11 days agovulkan: Optimize GGML_OP_CUMSUM (llama/18417)
Jeff Bolz [Fri, 2 Jan 2026 21:32:30 +0000 (15:32 -0600)]
vulkan: Optimize GGML_OP_CUMSUM (llama/18417)

* vulkan: Optimize GGML_OP_CUMSUM

There are two paths: The preexisting one that does a whole row per workgroup
in a single shader, and one that splits each row into multiple blocks and does
two passes. The first pass computes partials within a block, the second adds
the block partials to compute the final result. The multipass shader is used
when there are a small number of large rows.

In the whole-row shader, handle multiple elements per invocation.

* use 2 ELEM_PER_THREAD for AMD/Intel

* address feedback

11 days agovulkan: Implement mmvq for iq1_s/iq1_m (llama/18450)
Jeff Bolz [Fri, 2 Jan 2026 19:19:04 +0000 (13:19 -0600)]
vulkan: Implement mmvq for iq1_s/iq1_m (llama/18450)

11 days agometal : adjust extra size for FA buffer to avoid reallocations (llama/18545)
Georgi Gerganov [Fri, 2 Jan 2026 17:02:18 +0000 (19:02 +0200)]
metal : adjust extra size for FA buffer to avoid reallocations (llama/18545)

11 days agorpc : use unordered_map::reserve and emplace (llama/18513)
Chris Rohlf [Fri, 2 Jan 2026 10:09:36 +0000 (05:09 -0500)]
rpc : use unordered_map::reserve and emplace (llama/18513)

11 days agocuda : fix copy of large tensors (ggml_nbytes <= INT_MAX assertion) (llama/18433)
MeeMin [Thu, 1 Jan 2026 23:24:20 +0000 (04:54 +0530)]
cuda : fix copy of large tensors (ggml_nbytes <= INT_MAX assertion) (llama/18433)

* ggml-cuda: fixed assertion in ggml_cuda_cpy (llama/18140)

* ggml-cuda: changes in data types to int64_t

* ggml-cuda: added asserts for CUDA block numbers

* ggml-cuda: changed the condition for y and z dimension

11 days agoggml-cuda: remove unneccesary prints on ggml_cuda_init (llama/18502)
Aman Gupta [Thu, 1 Jan 2026 11:18:43 +0000 (19:18 +0800)]
ggml-cuda: remove unneccesary prints on ggml_cuda_init (llama/18502)

11 days agovulkan: extend topk_moe to handle sigmoid w/exp_probs_b for nemotron (llama/18295)
Jeff Bolz [Thu, 1 Jan 2026 07:58:27 +0000 (01:58 -0600)]
vulkan: extend topk_moe to handle sigmoid w/exp_probs_b for nemotron (llama/18295)

* vulkan: extend topk_moe to handle sigmoid w/exp_probs_b for nemotron

Also handle GGML_OP_SCALE at the end (nemotron, deepseek2).

Fewer pipeline variants and spec constants, just use push constants.

In test_topk_moe, change exp_probs_b to be 1D, matching real networks.

Update test-backend-ops and ggml-backend to allow verifying multiple outputs
in a fusion test (topk_moe has two outputs). Previously only the final node
was verified.

* change test_topk_moe to allow results in arbitrary order

* disable sigmoid fusion for moltenvk

12 days agoexamples : fix executable example targets (#3600)
Peter A. [Tue, 13 Jan 2026 07:08:18 +0000 (08:08 +0100)]
examples : fix executable example targets (#3600)

* cmake:
    - added `whisper-` prefix to unprefixed targets: `quantize`, `lsp`,
      `vad-speech-segments`
    - added `install(TARGETS ${TARGET} RUNTIME)` where it was missing

Signed-off-by: Peter A. <redacted>
* .github/workflows/build.yml: quantize -> whisper-quantize

Signed-off-by: Peter A. <redacted>
---------

Signed-off-by: Peter A. <redacted>
2 weeks agoruby : fix segmentation fault (#3591)
KITAITI Makoto [Mon, 5 Jan 2026 08:41:22 +0000 (17:41 +0900)]
ruby : fix segmentation fault (#3591)

* Mark long live variable

* Fix test for Whisper::Token#deconstruct_keys(nil)

* Don't use long live variable

* Fix indentation

3 weeks agosync : ggml
Georgi Gerganov [Wed, 31 Dec 2025 16:26:42 +0000 (18:26 +0200)]
sync : ggml

3 weeks agoggml : bump version to 0.9.5 (ggml/1410)
Georgi Gerganov [Wed, 31 Dec 2025 16:24:07 +0000 (18:24 +0200)]
ggml : bump version to 0.9.5 (ggml/1410)

3 weeks agotalk-llama : sync llama.cpp
Georgi Gerganov [Wed, 31 Dec 2025 11:13:57 +0000 (13:13 +0200)]
talk-llama : sync llama.cpp

3 weeks agosync : ggml
Georgi Gerganov [Wed, 31 Dec 2025 11:09:05 +0000 (13:09 +0200)]
sync : ggml

3 weeks agometal : add count_equal op (llama/18314)
gatbontonpc [Wed, 31 Dec 2025 08:39:48 +0000 (00:39 -0800)]
metal : add count_equal op (llama/18314)

* add count equal for metal

* remove trailing whitespace

* updated doc ops table

* changed shmem to i32

* added multi tg and templating

* removed BLAS support from Metal docs

* Apply suggestions from code review

Co-authored-by: Georgi Gerganov <redacted>
* add memset to set dst to 0

* metal : cleanup

---------

Co-authored-by: Georgi Gerganov <redacted>
3 weeks agoCUDA: fix KQ max calculation (llama/18487)
Johannes Gäßler [Wed, 31 Dec 2025 08:37:00 +0000 (09:37 +0100)]
CUDA: fix KQ max calculation (llama/18487)

3 weeks agometal : remove BF16 x F16 kernels (llama/18456)
Georgi Gerganov [Wed, 31 Dec 2025 07:53:48 +0000 (09:53 +0200)]
metal : remove BF16 x F16 kernels (llama/18456)

3 weeks agosycl: add newline at the end of CMakeLists.txt (llama/18503)
Aman Gupta [Wed, 31 Dec 2025 06:23:44 +0000 (14:23 +0800)]
sycl: add newline at the end of CMakeLists.txt (llama/18503)

3 weeks agoWork around broken IntelSYCLConfig.cmake in Intel oneAPI 2025.x (llama/18345)
Rahul Sathe [Wed, 31 Dec 2025 01:08:44 +0000 (06:38 +0530)]
Work around broken IntelSYCLConfig.cmake in Intel oneAPI 2025.x (llama/18345)

* cmake: work around broken IntelSYCLConfig.cmake in oneAPI 2025.x

* [AI] sycl: auto-detect and skip incompatible IntelSYCL package

Automatically detect compiler versions with incompatible IntelSYCL
CMake configuration files and fall back to manual SYCL flags instead
of requiring users to set options manually.

Fixes build failures with oneAPI 2025.x where IntelSYCLConfig.cmake
has SYCL_FEATURE_TEST_EXTRACT invocation errors.

* refactor: improve SYCL provider handling and error messages in CMake configuration

* refactor: enhance SYCL provider validation and error handling in CMake configuration

* ggml-sycl: wrap find_package(IntelSYCL) to prevent build crashes

3 weeks agokleidiai: add and integrate SVE 256-bit vector-length kernel (llama/18458)
Charles Xu [Tue, 30 Dec 2025 12:04:53 +0000 (13:04 +0100)]
kleidiai: add and integrate SVE 256-bit vector-length kernel (llama/18458)

* kleidiai: add and integrate SVE 256-bit vector-length kernel

* updated for review comments

3 weeks agoCUDA: add log line when mxfp4 acceleration is used (llama/18483)
Aman Gupta [Tue, 30 Dec 2025 09:40:46 +0000 (17:40 +0800)]
CUDA: add log line when mxfp4 acceleration is used (llama/18483)

* CUDA: add log line when mxfp4 acceleration is used

* add in backend_get_features

3 weeks agoCUDA: fix replacment of bad archs in CMake (llama/18457)
Johannes Gäßler [Mon, 29 Dec 2025 16:58:20 +0000 (17:58 +0100)]
CUDA: fix replacment of bad archs in CMake (llama/18457)

3 weeks agoCUDA: Blackwell features for non-native builds (llama/18436)
Johannes Gäßler [Mon, 29 Dec 2025 08:35:42 +0000 (09:35 +0100)]
CUDA: Blackwell features for non-native builds (llama/18436)

3 weeks agocuda: fix race condition in cumsum (llama/18448)
Aman Gupta [Mon, 29 Dec 2025 06:07:17 +0000 (14:07 +0800)]
cuda: fix race condition in cumsum (llama/18448)

* ggml-cuda: fix race condition in cumsum

* remove unneccesary sync_threads

3 weeks agoHIP: Use mmq on MFMA devices for MUL_MAT_ID in cases where a lot of splits would...
uvos [Sun, 28 Dec 2025 19:12:55 +0000 (20:12 +0100)]
HIP: Use mmq on MFMA devices for MUL_MAT_ID in cases where a lot of splits would be generated (llama/18202)

3 weeks agoRevert "ggml-cuda: use CMAKE_CUDA_ARCHITECTURES if set when GGML_NATIVE=ON (#18413...
Aman Gupta [Sun, 28 Dec 2025 12:53:36 +0000 (20:53 +0800)]
Revert "ggml-cuda: use CMAKE_CUDA_ARCHITECTURES if set when GGML_NATIVE=ON (#18413)" (llama/18426)

3 weeks agorpc: fix segfault on invalid endpoint format (llama/18387)
o7si [Sun, 28 Dec 2025 10:34:41 +0000 (18:34 +0800)]
rpc: fix segfault on invalid endpoint format (llama/18387)

* rpc: fix segfault on invalid endpoint format

* rpc: add error log for failed endpoint connection

3 weeks agocmake: Added more x86_64 CPU backends when building with `GGML_CPU_ALL_VARIANTS=On...
Boian Berberov [Sun, 28 Dec 2025 07:33:29 +0000 (07:33 +0000)]
cmake: Added more x86_64 CPU backends when building with `GGML_CPU_ALL_VARIANTS=On` (llama/18186)

* minor: Consolidated `#include <immintrin.h>` under `ggml-cpu-impl.h`

* cmake: Added more x86-64 CPU backends when building with `GGML_CPU_ALL_VARIANTS=On`

- `ivybridge`
- `piledriver`
- `cannonlake`
- `cascadelake`
- `cooperlake`
- `zen4`

Resolves: #17966

3 weeks agoggml-cuda: use CMAKE_CUDA_ARCHITECTURES if set when GGML_NATIVE=ON (llama/18413)
QDelta [Sun, 28 Dec 2025 01:33:14 +0000 (20:33 -0500)]
ggml-cuda: use CMAKE_CUDA_ARCHITECTURES if set when GGML_NATIVE=ON (llama/18413)

3 weeks agoopencl: allow resizing transpose buffers (llama/18384)
lhez [Sat, 27 Dec 2025 23:51:14 +0000 (15:51 -0800)]
opencl: allow resizing transpose buffers (llama/18384)

* opencl: allow resizing transpose buffers instead of using fixed sizes

* opencl: remove commented code

3 weeks agoggml-cuda: Use same regex for GGML_NATIVE=OFF (llama/18407)
Aman Gupta [Sat, 27 Dec 2025 11:56:27 +0000 (19:56 +0800)]
ggml-cuda: Use same regex for GGML_NATIVE=OFF (llama/18407)

3 weeks agovulkan: preprocess mul_mat_id experts and discard workgroups more quickly (llama...
Jeff Bolz [Fri, 26 Dec 2025 22:12:58 +0000 (16:12 -0600)]
vulkan: preprocess mul_mat_id experts and discard workgroups more quickly (llama/18352)

Run a preprocess to count how many times each expert is used, and use this to
quickly discard workgroups that aren't needed.

3 weeks agovulkan: optimize decodeFuncB in coopmat2 mul_mat_id shader (llama/18349)
Jeff Bolz [Fri, 26 Dec 2025 17:15:50 +0000 (11:15 -0600)]
vulkan: optimize decodeFuncB in coopmat2 mul_mat_id shader (llama/18349)

* vulkan: Use BK=32 for coopmat2 mul_mat_id

* vulkan: optimize decodeFuncB in coopmat2 mul_mat_id shader

Disable robustness, remove the OOB check in decodeFuncB, and initialize the
row_ids to zero to avoid OOB access.

Don't slice/offset the B matrix to ic * BN, only to adjust the coord back down
to the range [0, BN) in decodeFuncB. Instead just slice with a row offset of
zero and remove the '& (BN - 1)'. This allows the compiler to common some of
the shared memory loads.

3 weeks agovulkan: Use BK=32 for coopmat2 mul_mat_id (llama/18332)
Jeff Bolz [Fri, 26 Dec 2025 17:15:02 +0000 (11:15 -0600)]
vulkan: Use BK=32 for coopmat2 mul_mat_id (llama/18332)

3 weeks agovulkan: small dequantization improvements (llama/18380)
Eve [Fri, 26 Dec 2025 17:12:11 +0000 (17:12 +0000)]
vulkan: small dequantization improvements (llama/18380)

* iq4_xs

* quants

3 weeks agovulkan: Support UPSCALE w/antialias (llama/18327)
Jeff Bolz [Fri, 26 Dec 2025 16:00:57 +0000 (10:00 -0600)]
vulkan: Support UPSCALE w/antialias (llama/18327)

3 weeks agovulkan: handle rope with large number of rows (llama/18306)
Jeff Bolz [Fri, 26 Dec 2025 15:53:46 +0000 (09:53 -0600)]
vulkan: handle rope with large number of rows (llama/18306)

3 weeks agoCANN: implement the SSM_CONV operator (llama/17737)
0Marble [Fri, 26 Dec 2025 01:12:04 +0000 (09:12 +0800)]
CANN: implement the SSM_CONV operator (llama/17737)

* CANN: implement SSM_CONV operator

Co-authored-by: Aleksei Lobanov, <redacted>
Co-authored-by: Sujin Kang, <redacted>
* CANN: remove custom error limit for SSM_CONV

* CANN: merge SSM_CONV tensor shape/strides into one line

---------

Co-authored-by: Sujin Kang, <redacted>
3 weeks agoggml-cuda: fix regex for arch list (llama/18371)
Aman Gupta [Thu, 25 Dec 2025 17:35:14 +0000 (01:35 +0800)]
ggml-cuda: fix regex for arch list (llama/18371)

* ggml-cuda: fix regex for arch list

* make regex exact

3 weeks agocuda: optimize cumsum cub path (llama/18362)
Aman Gupta [Thu, 25 Dec 2025 15:55:38 +0000 (23:55 +0800)]
cuda: optimize cumsum cub path (llama/18362)

* cuda: optimize cumsum cub path

* remove heavy perf test

3 weeks agoggml-cuda: fix blackwell native builds (llama/18361)
Aman Gupta [Thu, 25 Dec 2025 14:12:11 +0000 (22:12 +0800)]
ggml-cuda: fix blackwell native builds (llama/18361)

* ggml-cuda: fix blackwell native builds

Replace 12x in native architectures by 12xa

* replace for GGML_NATIVE=OFF too

* only replace for native

* remove 120f-virtual for default compilation

---------

Co-authored-by: Aman Gupta <aman>
3 weeks agoCANN: Add support for CONV_TRANSPOSE_1D when kernel size > 255 (llama/17934)
Penglin Cai [Thu, 25 Dec 2025 08:46:09 +0000 (16:46 +0800)]
CANN: Add support for CONV_TRANSPOSE_1D when kernel size > 255 (llama/17934)

* CONV_TRANSPOSE_1D kernel_size>255

* remove condition check

* fix the bug of type conversion

* removing trailing whitespaces

* fix: return true in the switch case

3 weeks agoggml : optimize cuda cumsum fallback kernel (llama/18343)
Aadeshveer Singh [Thu, 25 Dec 2025 04:11:13 +0000 (09:41 +0530)]
ggml : optimize cuda cumsum fallback kernel (llama/18343)

3 weeks agoCUDA: experimental native mxfp4 support for blackwell (llama/17906)
Aman Gupta [Wed, 24 Dec 2025 14:28:26 +0000 (22:28 +0800)]
CUDA: experimental native mxfp4 support for blackwell (llama/17906)

* CUDA: experimental native mxfp4 support for blackwell

* optimize load_tiles

* optimize quantize_mxfp4

* cleanup

* first pass review: formatting

* use interleaved layout for mma

* mmq: add assert for size

* use __nv_fp4x4_e2m1

* use iter_k as 512, cleanup

* Use 1200 as blackwell instead of 1000

* address review comments

* mmq: fix stride

* quantize.cu: use reference impl of e8m0 scale

* address review comments

* add 120f-virtual + minor fixes

---------

Co-authored-by: Aman Gupta <aman>
3 weeks agovulkan: fix command buffer corruption in ggml_backend_vk_event_wait (llama/18302)
Jeff Bolz [Wed, 24 Dec 2025 11:36:34 +0000 (05:36 -0600)]
vulkan: fix command buffer corruption in ggml_backend_vk_event_wait (llama/18302)

3 weeks agoCANN : refactor ACL graph cache (llama/17752)
Wang Weixuan [Wed, 24 Dec 2025 09:50:24 +0000 (17:50 +0800)]
CANN : refactor ACL graph cache (llama/17752)

Move the graph property checking code into methods of LRU cache.

Signed-off-by: Wang Weixuan <redacted>
3 weeks agovulkan: use fewer FA rows for small cache runs (llama/18280)
Ruben Ortlam [Wed, 24 Dec 2025 07:59:14 +0000 (08:59 +0100)]
vulkan: use fewer FA rows for small cache runs (llama/18280)

3 weeks agoCANN: Uses yarn_ramp cache in ROPE (llama/17725)
TianHao324 [Wed, 24 Dec 2025 06:55:33 +0000 (14:55 +0800)]
CANN: Uses yarn_ramp cache in ROPE (llama/17725)

3 weeks agorpc : add check for rpc buffer type (llama/18242)
Chris Rohlf [Tue, 23 Dec 2025 09:56:49 +0000 (04:56 -0500)]
rpc : add check for rpc buffer type (llama/18242)

3 weeks agoggml-hexagon: create generalized functions for cpu side op (llama/17500)
nullname [Tue, 23 Dec 2025 07:13:24 +0000 (15:13 +0800)]
ggml-hexagon: create generalized functions for cpu side op (llama/17500)

* refactor: replace ggml_hexagon_mul_mat with template-based binary operation for improved flexibility

* refactor: replace ggml_hexagon_mul_mat_id with template-based binary operation for improved flexibility

* refactor: initialize buffer types and streamline dspqueue_buffers_init calls for clarity

* add comment

* refactor: remove redundant buffer checks in hexagon supported operations

* wip

* add missing include to fix weak symbol warning

* add ggml_hexagon_op_generic

* refactor: simplify tensor operation initialization and buffer management in hexagon implementation

* refactor: streamline hexagon operation initialization and buffer management

* refactor: update function signatures and streamline request handling in hexagon operations

* wip

* ggml-hexagon: clean up code formatting and improve unary operation handling

* wip

* rename

* fix: add support for permuted F16 tensors and enhance quantization checks in matrix operations

* refactor: replace ggml_hexagon_mul_mat with template-based binary operation for improved flexibility

refactor: replace ggml_hexagon_mul_mat_id with template-based binary operation for improved flexibility

refactor: initialize buffer types and streamline dspqueue_buffers_init calls for clarity

refactor: remove redundant buffer checks in hexagon supported operations

add missing include to fix weak symbol warning

add ggml_hexagon_op_generic

refactor: simplify tensor operation initialization and buffer management in hexagon implementation

refactor: streamline hexagon operation initialization and buffer management

refactor: update function signatures and streamline request handling in hexagon operations

ggml-hexagon: clean up code formatting and improve unary operation handling

fix: add support for permuted F16 tensors and enhance quantization checks in matrix operations

# Conflicts:
# ggml/src/ggml-hexagon/ggml-hexagon.cpp

* hexagon: fix merge conflicts

* hexagon: minor cleanup for buffer support checks

* hexagon: factor out op_desc and the overal op logging

* hexagon: further simplify and cleanup op dispatch logic

* snapdragon: update adb scripts to use llama-cli and llama-completion

* fix pipeline failure

---------

Co-authored-by: Max Krasnyansky <redacted>
3 weeks agoggml-hexagon: gelu optimization (llama/18151)
Shouyu [Mon, 22 Dec 2025 18:56:52 +0000 (13:56 -0500)]
ggml-hexagon: gelu optimization (llama/18151)

* feat: working gelu with src0 put on vtcm

* feat: gelu ping-pong for both in and out

* fix: fixu compile error

* break: distinguish dma ddr->vtcm and vtcm->ddr operation

* fix: fix dma queue size

* break: update dma api to either pop src or dst ptr

* fix: fix activation vtcm allocation issue for src1 when swapperd

* refactor: ping-pong gelu logic to avoid unnecessary if else

* dma: improved queue interface and prefetch handling

* gelu: fix N+2 block prefetch

---------

Co-authored-by: Max Krasnyansky <redacted>
3 weeks agollamafile: add rvv support for sgemm kernels (llama/18199)
Taimur Ahmad [Mon, 22 Dec 2025 18:20:23 +0000 (23:20 +0500)]
llamafile: add rvv support for sgemm kernels (llama/18199)

Co-authored-by: Rehan Qasim <redacted>
3 weeks agoopencl: unpack q4_0 for adreno in get_tensor (llama/18278)
lhez [Mon, 22 Dec 2025 18:19:01 +0000 (10:19 -0800)]
opencl: unpack q4_0 for adreno in get_tensor (llama/18278)

3 weeks agovulkan: Extend rope fusions to allow mrope (llama/18264)
Jeff Bolz [Mon, 22 Dec 2025 17:03:13 +0000 (11:03 -0600)]
vulkan: Extend rope fusions to allow mrope (llama/18264)

Extend the test-backend-ops tests as well.

3 weeks agovulkan: Implement set_tensor_async and the event interfaces (llama/18047)
Jeff Bolz [Sun, 21 Dec 2025 20:52:09 +0000 (14:52 -0600)]
vulkan: Implement set_tensor_async and the event interfaces (llama/18047)

The goal is to enable the async loading code paths in
llama_model_loader::load_all_data, originally from #7896. This works and the
loads themselves are faster, but with host visible vidmem I think the cost of
allocating/mapping vidmem moves and becomes more expensive, and I don't see a
benefit by default. But with GGML_VK_DISABLE_HOST_VISIBLE_VIDMEM=1 I do see a
significant improvement in model loading time.

3 weeks agollama: fix RPC for -fit on (llama/18233)
Johannes Gäßler [Sun, 21 Dec 2025 18:33:08 +0000 (19:33 +0100)]
llama: fix RPC for -fit on (llama/18233)

3 weeks agovulkan: fix im2col overflowing maxworkgroupcount (llama/18180)
Jeff Bolz [Sun, 21 Dec 2025 09:32:58 +0000 (03:32 -0600)]
vulkan: fix im2col overflowing maxworkgroupcount (llama/18180)

3 weeks agovulkan/cuda: fix topk_moe with exp_probs_b (llama/18071)
Jeff Bolz [Sun, 21 Dec 2025 09:27:34 +0000 (03:27 -0600)]
vulkan/cuda: fix topk_moe with exp_probs_b (llama/18071)

I updated test_topk_moe to more closely match llm_graph_context::build_moe_ffn
and added coverage for exp_probs_b and some other missing combinations. This
exposed a bug in both CUDA and Vulkan backends where they were assuming the
input to argsort and the input to get_rows are the same. I'd like to optimize
this graph in another change, but for now just get it functional.

CUDA also had a bug where it got n_experts from the wrong place, leading to
GGML_ASSERT failures in some of the new tests.

3 weeks agovulkan: support GGML_UNARY_OP_XIELU (llama/18062)
Jeff Bolz [Sun, 21 Dec 2025 09:17:58 +0000 (03:17 -0600)]
vulkan: support GGML_UNARY_OP_XIELU (llama/18062)

3 weeks agovulkan: in graph_optimize, try to group ADD operations (llama/18060)
Jeff Bolz [Sun, 21 Dec 2025 09:05:08 +0000 (03:05 -0600)]
vulkan: in graph_optimize, try to group ADD operations (llama/18060)

I saw the adds not staying together in the new nemotron 3 nano model.

3 weeks agoVulkan: some improvement on mul_mat_iq2_xs (llama/18031)
lovedheart [Sun, 21 Dec 2025 08:59:52 +0000 (09:59 +0100)]
Vulkan: some improvement on mul_mat_iq2_xs (llama/18031)

* Some improvement on mul_mat_iq2_xs

Refactor calculations for db values and grid data to optimize performance and reduce redundancy.

* Fix trailing whitespace

3 weeks agoAdded comments explaining thread block size selection logic based on row count and...
Aadeshveer Singh [Sat, 20 Dec 2025 11:28:57 +0000 (16:58 +0530)]
Added comments explaining thread block size selection logic based on row count and column size, derived from historical commit context (llama/18212)

3 weeks agoggml-hexagon: Implement true Q8_0 quantization on Hexagon NPU for more accurate mixed...
Alfred [Fri, 19 Dec 2025 17:42:28 +0000 (12:42 -0500)]
ggml-hexagon: Implement true Q8_0 quantization on Hexagon NPU for more accurate mixed-precision matmul operations (llama/17977)

* feat: implement real Q8_0

* feat: adding cmake option for configuring FP32 quantize group size

* typo: set() shall be used

---------

Co-authored-by: ngdxzy <redacted>