]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/log
pkg/ggml/sources/whisper.cpp
2 months agovulkan: add fast path for contiguous buffer transfers (llama/23973)
Winston Ma [Thu, 11 Jun 2026 13:46:25 +0000 (21:46 +0800)]
vulkan: add fast path for contiguous buffer transfers (llama/23973)

2 months agovulkan: use medium matmul tile on Asahi Linux (llama/24306)
Kevin Liu [Thu, 11 Jun 2026 13:43:04 +0000 (09:43 -0400)]
vulkan: use medium matmul tile on Asahi Linux (llama/24306)

* vulkan: use medium matmul tile on Asahi Linux

* vulkan: switch Apple detection to Honeykrisp driver id

2 months agoRemove padding and multiple D2D copies for MTP (llama/24086)
Gaurav Garg [Wed, 10 Jun 2026 17:51:16 +0000 (23:21 +0530)]
Remove padding and multiple D2D copies for MTP (llama/24086)

* Make ggml_gated_delta_net take only the initial recurrent state (D, 1, n_seqs) and passes the snapshot count K as an op parameter instead of inferring it from state->ne[1].

Remove the padding hack and copy all emitted snapshots into the recurrent cache with a single strided ggml_cpy

* Make GDN changes in all backends. Address review comments.

* Fix CI build errors

2 months agoCUDA: Fix ssm_scan_f32 data-races (llama/24360)
Oliver Simons [Wed, 10 Jun 2026 12:27:08 +0000 (14:27 +0200)]
CUDA: Fix ssm_scan_f32 data-races (llama/24360)

* Add missing syncthreads before resuing cub_temp_storage

__syncthreads() is required before being allowed to resue TempStorage
smem:
https://nvidia.github.io/cccl/unstable/cub/api/classcub_1_1BlockLoad.html#_CPPv4I0EN3cub9BlockLoad4LoadEv20RandomAccessIteratorRA14ItemsPerThread_1Ti

* Add one more missing __syncthreads

Could also double-buffer, but alternative is to simply ensure all
threads have read smem* before writing to it again in the next loop
iteration

* Remove unused smem from ssm_scan_f32

2 months agovulkan: reduce iq1 shared memory usage for mul_mm (llama/24287)
Jeff Bolz [Tue, 9 Jun 2026 11:27:38 +0000 (06:27 -0500)]
vulkan: reduce iq1 shared memory usage for mul_mm (llama/24287)

2 months agovulkan: add `v_dot2_f32_f16` support in matrix-matrix multiplication and Flash Attent...
Ruben Ortlam [Tue, 9 Jun 2026 11:27:04 +0000 (13:27 +0200)]
vulkan: add `v_dot2_f32_f16` support in matrix-matrix multiplication and Flash Attention (llama/24123)

* vulkan: add support for valve fp16 dot2 extension

* use macro for dot2 path choice

* properly check for the feature

* add dot_product abstraction to reduce preprocessor branching

2 months agoggml : add GGML_OP_COL2IM_1D (llama/24206)
Pascal [Tue, 9 Jun 2026 09:01:37 +0000 (11:01 +0200)]
ggml : add GGML_OP_COL2IM_1D (llama/24206)

* cpu: add GGML_OP_COL2IM_1D

Add the overlap-add (scatter-add) step of a 1D transposed convolution.
A ConvTranspose1d factorizes as a GEMM followed by col2im: a weight
pre-permuted to [IC, K*OC] is contracted against the [IC, T_in] input
with mul_mat to produce a column matrix [K*OC, T_in], and col2im_1d
scatters those columns back into the [T_out, OC] signal, with
T_out = (T_in - 1)*s0 + K - 2*p0.

Keeping the contraction as a plain mul_mat leaves the heavy work on the
optimized (and quantizable) matmul kernels, so col2im_1d only does the
cheap overlap-add.

CPU uses a gather formulation parallelized over output channels,
supporting F32, F16 and BF16 with an F32 accumulator.

* tests: add backend coverage for GGML_OP_COL2IM_1D

Add test_col2im_1d next to the conv_transpose_1d cases, covering F32,
F16 and BF16 across eight geometries: the canonical kernel = 2*stride
DAC upsampling shape, overlap, no overlap, cropping (p0 = 1 and
p0 = stride/2), kernel < stride with zeroed gaps, kernel not a
multiple of stride, and a single column unfold.

Perf mode gets three real vocoder stage shapes reporting memory
bandwidth. max_nmse_err relaxes to 5e-4 for F16 and BF16.

* cpu: harden GGML_OP_COL2IM_1D

ggml_col2im_1d validates s0, oc, p0 and input contiguity at graph
build time, before the oc division, protecting every backend at once.
The kernel asserts the contiguity its flat indexing assumes and its
doc states the full output length including the crop term.

The kernel parallelizes over the time axis: the split stays balanced
down to OC = 1, where the previous channel split was single threaded.
Values are bit identical on the three real vocoder chains, two out of
three improve.

* tests: extend the GGML_OP_COL2IM_1D grid

The eval grid grows to eleven geometries: OC = 1 (mono output stage),
K = 1 with stride > 1 (sparse scatter, every gap position zeroed) and
a crop down to T_out = 2 where all the gather bounds act at once.

* tests: add col2im_1d equivalence test

tests/test-col2im-1d.cpp proves mul_mat + col2im_1d matches the
native ggml_conv_transpose_1d on the CPU backend, F32 bit exact, F16
and BF16 through casts of the column matrix. test-backend-ops cannot
cover this for a CPU only op since the CPU backend is its own
reference there.

* rpc: bump protocol patch version for GGML_OP_COL2IM_1D

GGML_OP_COUNT goes from 96 to 97 with the new op, which trips the
static_assert in ggml-rpc.h. Bump RPC_PROTO_PATCH_VERSION since the
op is appended and no existing op code shifts.

2 months agoggml-cpu : fix rms_norm_back wrong output under in-place aliasing (llama/24305)
Yash Raj Pandey [Tue, 9 Jun 2026 07:24:27 +0000 (03:24 -0400)]
ggml-cpu : fix rms_norm_back wrong output under in-place aliasing (llama/24305)

* ggml-cpu : fix rms_norm_back wrong output under in-place aliasing

* cont : clean-up comment

---------

Co-authored-by: Georgi Gerganov <redacted>
2 months agoRemove case for GGML_TYPE_Q4_K in mvvq.cu (llama/23528)
ravel7524 [Tue, 9 Jun 2026 05:46:23 +0000 (07:46 +0200)]
Remove case for GGML_TYPE_Q4_K in mvvq.cu (llama/23528)

2 months agoggml-webgpu: Add clang-format job (llama/24308)
Reese Levine [Tue, 9 Jun 2026 03:54:24 +0000 (20:54 -0700)]
ggml-webgpu: Add clang-format job (llama/24308)

* Add clang-format job

* try local formatting

2 months agoggml-webgpu: Improve prefill speeds for k-quants + refactor matmul for Q4/Q5/Q8 and...
Masashi Yoshimura [Mon, 8 Jun 2026 22:19:56 +0000 (07:19 +0900)]
ggml-webgpu: Improve prefill speeds for k-quants + refactor matmul for Q4/Q5/Q8 and k-quants (llama/24225)

* ggml-webgpu: Improve prefill speeds + refactor matmul for quants

* Fixes for editroconfig checker

2 months agoHandle buffer overlap / buffer aliasing for concat operator (llama/24000)
Nikhil Jain [Mon, 8 Jun 2026 15:07:31 +0000 (08:07 -0700)]
Handle buffer overlap / buffer aliasing for concat operator (llama/24000)

* Only run webgpu CI on my fork

* Add webgpu only workflow

* handle buffer overlap case for concat operator

* restore build-webgpu.yml

Co-Authored-By: Claude Sonnet 4.6 <redacted>
* Run clang-format

* Update ggml/src/ggml-webgpu/wgsl-shaders/concat.wgsl

---------

Co-authored-by: Claude Sonnet 4.6 <redacted>
Co-authored-by: Reese Levine <redacted>
2 months agoImplement 2D workgroups for scale, binary, and unary ops (llama/24044)
Nikhil Jain [Mon, 8 Jun 2026 15:07:15 +0000 (08:07 -0700)]
Implement 2D workgroups for scale, binary, and unary ops (llama/24044)

* Only run webgpu CI on my fork

* Add webgpu only workflow

* Implement 2d workgroups for more operations

* fix

* Fix type

* Move back to global_invocation_id

2 months agovulkan: Use cm2 decode_vector for mul_mat_id B matrix loads (llama/23991)
Jeff Bolz [Mon, 8 Jun 2026 08:40:37 +0000 (03:40 -0500)]
vulkan: Use cm2 decode_vector for mul_mat_id B matrix loads (llama/23991)

This allows vec4 loads of the B elements. Also increase BK to 64 when this is
enabled. Neither of these alone is consistently faster, but together these give
a nice speedup.

In ggml-vulkan.cpp, we need to make sure the B matrix alignment and stride are
multiples of 4.

2 months agocuda: reset cuda context after reading memory size (llama/23935)
Ruben Ortlam [Mon, 8 Jun 2026 08:22:44 +0000 (10:22 +0200)]
cuda: reset cuda context after reading memory size (llama/23935)

* cuda: reset device in get_memory function if no backend is active

* also count device and host buffers

* exclude hip and musa from counting and device reset

* use device mutex instead of atomic

* undo backend_free function move

3 months agoci : pin github actions to commit sha's (#3865)
Daniel Bevenius [Tue, 9 Jun 2026 10:51:00 +0000 (12:51 +0200)]
ci : pin github actions to commit sha's (#3865)

3 months agocoreml : fix --quantize crash for mlprogram format; fix --optimize-ane label (#3868)
Christopher Albert [Tue, 9 Jun 2026 06:34:31 +0000 (08:34 +0200)]
coreml : fix --quantize crash for mlprogram format; fix --optimize-ane label (#3868)

commit 8b92060 switched ct.convert() to mlprogram, but did not update
the --quantize path.  quantize_weights() from
neural_network.quantization_utils only works with the legacy
neuralnetwork format.  Running with --quantize crashed with:

  Exception: MLModel of type mlProgram cannot be loaded just from the
  model spec object. It also needs the path to the weights file.

Fix: pass compute_precision=ct.precision.FLOAT16 into ct.convert() when
--quantize is set.  This matches the original intent of nbits=16 (F16
storage) without changing the quantization scheme or model accuracy.

Also fix the three boolean CLI flags (--encoder-only, --quantize,
--optimize-ane) to use a _str_to_bool helper so that both
  --flag True
and
  --flag False
parse correctly.  The type=bool form accepted "False" as True because
bool("False") == True.

Remove the "currently broken" label from --optimize-ane: the ANE path
(WhisperANE with Conv2d attention and LayerNormANE) converts and loads
correctly with both PyTorch 2.x and coremltools 9.x.

3 months agotalk-llama : sync llama.cpp
Georgi Gerganov [Mon, 8 Jun 2026 09:55:06 +0000 (12:55 +0300)]
talk-llama : sync llama.cpp

3 months agosync : ggml
Georgi Gerganov [Mon, 8 Jun 2026 09:52:27 +0000 (12:52 +0300)]
sync : ggml

3 months agoggml : bump version to 0.14.0 (ggml/1533)
Georgi Gerganov [Mon, 8 Jun 2026 09:51:59 +0000 (12:51 +0300)]
ggml : bump version to 0.14.0 (ggml/1533)

3 months agosync : ggml
Georgi Gerganov [Mon, 8 Jun 2026 09:52:17 +0000 (12:52 +0300)]
sync : ggml

3 months agoHIP: add gfx1152 and gfx1153 to RDNA3.5 (llama/24129)
Harkirat Gill [Mon, 8 Jun 2026 06:33:23 +0000 (02:33 -0400)]
HIP: add gfx1152 and gfx1153 to RDNA3.5 (llama/24129)

3 months agometal : fix im2col 1D case (audio models) (llama/24220)
Xuan-Son Nguyen [Mon, 8 Jun 2026 06:03:18 +0000 (08:03 +0200)]
metal : fix im2col 1D case (audio models) (llama/24220)

3 months agovulkan: check coopmat2 features before reporting support (llama/24186)
Ruben Ortlam [Sat, 6 Jun 2026 07:11:35 +0000 (09:11 +0200)]
vulkan: check coopmat2 features before reporting support (llama/24186)

3 months agoopencl: improve get_rows, cpy, concat and q6_k flat gemv (llama/24160)
lhez [Fri, 5 Jun 2026 20:45:25 +0000 (13:45 -0700)]
opencl: improve get_rows, cpy, concat and q6_k flat gemv (llama/24160)

* opencl: allow multiple workgroups for large rows

* opencl: improve small cpy

* opencl: packed concat for small input

* opencl: tweak flat q6_K gemv, increase N_DST and remap threads

3 months agovulkan: add fwht support for Intel with shmem reduction (llama/23964)
Ruben Ortlam [Fri, 5 Jun 2026 17:44:40 +0000 (19:44 +0200)]
vulkan: add fwht support for Intel with shmem reduction (llama/23964)

* vulkan: add fwht support for Intel with shmem reduction

* don't use N as workgroup size

* disable subgroup shuffle on MoltenVK AMD

* disable fwht shader on Intel Windows due to driver bug

3 months agokleidiai : dynamic chunck-based scheduling for hybrid execution (llama/23819)
Charles Xu [Fri, 5 Jun 2026 07:11:47 +0000 (09:11 +0200)]
kleidiai : dynamic chunck-based scheduling for hybrid execution (llama/23819)

3 months agoCUDA: enroll mul_mat_vec_q_moe into pdl (llama/24087)
Oliver Simons [Fri, 5 Jun 2026 06:37:34 +0000 (08:37 +0200)]
CUDA: enroll mul_mat_vec_q_moe into pdl (llama/24087)

* Enroll mul_mat_vec_q_moe into PDL, boosting MTP performance on BW

Data collected on a B4500:

Before
```
(llama.cpp) ➜  llama.cpp git:(master) ✗ python mtp-bench.py
  code_python        pred= 192 draft= 150 acc= 116 rate=0.773 tok/s=202.8
  code_cpp           pred= 192 draft= 147 acc= 117 rate=0.796 tok/s=212.8
  explain_concept    pred= 192 draft= 161 acc= 110 rate=0.683 tok/s=196.4
  summarize          pred= 192 draft= 138 acc= 122 rate=0.884 tok/s=226.6
  qa_factual         pred= 192 draft= 138 acc= 121 rate=0.877 tok/s=225.1
  translation        pred= 192 draft= 158 acc= 112 rate=0.709 tok/s=201.5
  creative_short     pred= 192 draft= 160 acc= 110 rate=0.688 tok/s=197.2
  stepwise_math      pred= 192 draft= 150 acc= 115 rate=0.767 tok/s=209.2
  long_code_review   pred= 192 draft= 148 acc= 116 rate=0.784 tok/s=208.9
```
After
```
(llama.cpp) ➜  llama.cpp git:(master) ✗ python mtp-bench.py
  code_python        pred= 192 draft= 150 acc= 116 rate=0.773 tok/s=211.9
  code_cpp           pred= 192 draft= 147 acc= 117 rate=0.796 tok/s=224.6
  explain_concept    pred= 192 draft= 161 acc= 110 rate=0.683 tok/s=207.8
  summarize          pred= 192 draft= 138 acc= 122 rate=0.884 tok/s=240.2
  qa_factual         pred= 192 draft= 138 acc= 121 rate=0.877 tok/s=238.5
  translation        pred= 192 draft= 158 acc= 112 rate=0.709 tok/s=213.4
  creative_short     pred= 192 draft= 160 acc= 110 rate=0.688 tok/s=208.8
  stepwise_math      pred= 192 draft= 150 acc= 115 rate=0.767 tok/s=221.7
  long_code_review   pred= 192 draft= 148 acc= 116 rate=0.784 tok/s=220.7
```

Server launched with:
```
➜  llama.cpp git:(osimons/enroll_mul_mat_vec_q_moe_into_PDL) ✗ ./build-x64-linux-gcc-reldbg/bin/llama-server \
    -m /mnt/share/gguf/unsloth/Qwen3.6-35B-A3B-MTP-GGUF/Qwen3.6-35B-A3B-UD-Q4_K_M.gguf -dio \
    --spec-type draft-mtp \
    --spec-draft-n-max 2 \
    -ngl all \
    -fa on \
    --host 0.0.0.0 \
    --port 8080 -np 1 --chat-template-kwargs "{\"preserve_thinking\": true}"
```

* LC to overlap with following kernels

3 months agosycl : port multi-column MMVQ from CUDA backend (llama/21845)
Mason Milburn [Fri, 5 Jun 2026 05:10:31 +0000 (01:10 -0400)]
sycl : port multi-column MMVQ from CUDA backend (llama/21845)

mmvq:

Port the ncols_dst optimization from ggml-cuda/mmvq.cu to SYCL.
Read weights once per dispatch instead of once per column.
Covers all standard quant types + reorder paths for Q4_0, Q8_0,
Q3_K, Q4_K, Q5_K, Q6_K. IQ types (except IQ4_XS) excluded due to
incompatible vec_dot signatures.

ggml-sycl:

The weight reorder was only bootstrapped on single-token mat-vec
(ne[1] == 1). Speculative / MTP verify issues only multi-column mat-vec,
so it never triggered the reorder and ran on the slower non-reorder
kernel. Bootstrap it on small multi-column batches (ne[1] <= 8) too.

3 months agoggml: vectorize ggml_vec_dot_q4_1_q8_1 with WASM SIMD128 (llama/22209)
Kartik Sirohi [Thu, 4 Jun 2026 13:12:38 +0000 (18:42 +0530)]
ggml: vectorize ggml_vec_dot_q4_1_q8_1 with WASM SIMD128 (llama/22209)

* ggml: vectorize ggml_vec_dot_q4_1_q8_1 with WASM SIMD128

Optimize the inner loop of ggml_vec_dot_q4_1_q8_1_generic using
WASM SIMD128 intrinsics, gated behind #ifdef __wasm_simd128__ so
non-wasm builds are completely unaffected.

Approach:
- single wasm_v128_load covers all 32 packed 4-bit weights
- nibbles unpacked via AND/SHR into two u8x16 registers
- widened to i16 before multiply (WASM SIMD has no i8*i8 instruction)
- 4x wasm_i32x4_dot_i16x8 calls accumulate all 32 element pairs
- horizontal reduce via 4x wasm_i32x4_extract_lane

Benchmark (node v25, emcc -O3 -msimd128, 64 blocks x QK8_1=32,
200k iterations):

| impl   | ns/call | speedup |
|--------|---------|---------|
| scalar |   880.7 |   1.00x |
| simd   |   257.8 |   3.42x |

Correctness verified against scalar reference across 10 random seeds
with exact output match.

* ggml: move q4_1_q8_1 WASM SIMD implementation to wasm backend

Relocate the SIMD128 implementation of ggml_vec_dot_q4_1_q8_1 to ggml/src/ggml-cpu/arch/wasm/quants.c to follow architecture-specific layout. Restore the generic implementation in ggml/src/ggml-cpu/quants.c.
Move for loop in the else block.

* ggml: use generic q4_1_q8_1 fallback in wasm backend

3 months agometal : reduce rset heartbeat from 500ms -> 5ms (llama/24074)
Georgi Gerganov [Thu, 4 Jun 2026 05:05:32 +0000 (08:05 +0300)]
metal : reduce rset heartbeat from 500ms -> 5ms (llama/24074)

3 months agoggml-webgpu: FlashAttention refactor + standardize quantization support (llama/23834)
Reese Levine [Thu, 4 Jun 2026 05:05:04 +0000 (22:05 -0700)]
ggml-webgpu: FlashAttention refactor + standardize quantization support (llama/23834)

* Start work on flash_attn refactor

* Refactor

* Split k/v quantization

* Refactor and abstract quantization logic for flash_attn and mul_mat

* Add quantization support to tile path

* formatting

* Move to functions, add a check

3 months agoggml-cpu: extend RVV quantization vec dot to higher VLENs (llama/22754)
rehan-10xengineer [Thu, 4 Jun 2026 05:03:40 +0000 (10:03 +0500)]
ggml-cpu: extend RVV quantization vec dot to higher VLENs (llama/22754)

* ggml-cpu: add rvv 512b,1024b impls for iq4_xs

* ggml-cpu: refactor; add rvv 512b, 1024b impls for q6_K, i-quants

* ggml-cpu: refactor; add 512 and 1024 implementations of tq3_s, iq3_xxs, iq2_s, iq2_xs, iq2_xxs

improve iq2_xs impl for rvv 256

Co-authored-by: Rehan Qasim <redacted>
---------

Co-authored-by: taimur-10x <redacted>
Co-authored-by: Rehan Qasim <redacted>
3 months agoAvoid PDL race conditions by disabling __restrict__ when PDL is used (llama/24030)
Andreas Kieslinger [Wed, 3 Jun 2026 11:56:42 +0000 (13:56 +0200)]
Avoid PDL race conditions by disabling __restrict__ when PDL is used (llama/24030)

* Removes __restrict__ from PDL kernel headers due to incompatibility with
PDL. Adds preprocessor directives based on arch in kernel body to add
__restrict__ to retain performance on older architectures.

* Simplifies new __restrict__ usage via macro

* Add hopper to PDL __restrict__ fix.

Co-authored-by: Oliver Simons <redacted>
---------

Co-authored-by: Oliver Simons <redacted>
3 months agoggml-cpu: use runtime SVE width in FWHT (llama/24059)
Charles Xu [Wed, 3 Jun 2026 10:45:10 +0000 (12:45 +0200)]
ggml-cpu: use runtime SVE width in FWHT (llama/24059)

3 months agocuda: reserve space for quantize kv-cache at startup (llama/23907)
Aman Gupta [Wed, 3 Jun 2026 10:39:59 +0000 (18:39 +0800)]
cuda: reserve space for quantize kv-cache at startup (llama/23907)

* cuda: reserve space for quantize kv-cache at startup

* address review comments

* remove forward decl

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

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

Co-authored-by: Johannes Gäßler <redacted>
3 months agoopencl: use flat variants of q4_K and q6_K gemv for very large M (llama/24006)
lhez [Tue, 2 Jun 2026 21:16:17 +0000 (14:16 -0700)]
opencl: use flat variants of q4_K and q6_K gemv for very large M (llama/24006)

3 months agohexagon: profiler output fix and script updates (llama/24042)
Max Krasnyansky [Tue, 2 Jun 2026 21:08:29 +0000 (14:08 -0700)]
hexagon: profiler output fix and script updates (llama/24042)

* hex-ops: fix profiler output (ie remove the redundant NONEs)

* hex-prof: update profiling script to support tot.usec column

3 months agohexagon: MUL_MAT, MUL_MAT_ID, FLASH_ATTN and GDN cleanup and optimizations for latest...
Max Krasnyansky [Tue, 2 Jun 2026 06:40:08 +0000 (23:40 -0700)]
hexagon: MUL_MAT, MUL_MAT_ID, FLASH_ATTN and GDN cleanup and optimizations for latest models (llama/23989)

* hex-mm: initial support for F32 * F32 -> F32 matmuls

* hex-rms-norm: fix src1 stride use in fused rms_norm_mul

* hex-ops: clear spad pointers in the ops that clober it

This fixes an odd case where fused rms-norm-mul was failing but only in qwen3.5-2B and only at searth op-bath sizes.

* hmx-mm: add support for F32 * F32 -> F32 matmul_2d on HMX

Decided to use Q4_0 * F32 -> F32 matmul for this.
Q4_0 gets dequantized and tiled into F16, and here we quantize and tile F32 into F16.
Super simple and pretty efficient.

* hmx-mm: route f16 2D matmuls through the same kernel used for all other types

* hmx-mm: re-introduce pipelined vs non-pipelined mode that we used to have but is much more generic way

This update futher improves matmul performance and at the same time removes most of the redudant logic
we had in different paths.

* hmx-fa: slighlty improved pipeline simimar to matmul updates

* hmx-mm: initial version of MAT_MUL_ID support for HMX

* hmx-mm: fixed mxfp4 handling for MUL_MAT_ID

* hex-gdn: optimize GATED_DELTA_NET

DMA prefetch/double-buff, vectorize everything with HVX, in other words -- the usual :)

* hmx-mm: missed one more case where we can use fastmod

* hexagon: update DCVS settings for a slight perf bump

* hmx-fa: use fastdiv in hmx-flash-attn

* hmx-fa: precompute slope values to avoid disrupting the inner loop

* hvx-utils/fa: new HVX helpers for powf and logf and using those to speed up FA alibi

* hex-ops: fixed a bug in fusion logic that was messing up the order of the src tensors when some srcs are empty

* hex-fa: correctly fallback to HVX if we have sinks or the dims are not quite right

3 months agohexagon: add gelu_quick (llama/24007)
Todor Boinovski [Tue, 2 Jun 2026 06:19:07 +0000 (23:19 -0700)]
hexagon: add gelu_quick (llama/24007)

3 months agoclean up unused variables warnings (llama/23975)
Anav Prasad [Tue, 2 Jun 2026 02:38:37 +0000 (19:38 -0700)]
clean up unused variables warnings (llama/23975)

3 months agoopencl: fix compiler warnings for non-adreno path (llama/23922)
lhez [Tue, 2 Jun 2026 02:15:09 +0000 (19:15 -0700)]
opencl: fix compiler warnings for non-adreno path (llama/23922)

* opencl: fix compiler warnings for non-adreno path

* opencl: fix const cast warning

3 months agorevert to using global_invocation_id for cpy shader (llama/23955)
Masashi Yoshimura [Mon, 1 Jun 2026 23:59:06 +0000 (08:59 +0900)]
revert to using global_invocation_id for cpy shader (llama/23955)

3 months agoopencl: add basic support for q5_0 and q5_1 (llama/23548)
shaofeiqi [Mon, 1 Jun 2026 17:06:50 +0000 (10:06 -0700)]
opencl: add basic support for q5_0 and q5_1 (llama/23548)

* opencl: add general q5_0 support

* opencl: add general q5_1 support

* opencl: support non-uniform workgrp size

---------

Co-authored-by: Li He <redacted>
3 months agometal: template GLU kernels to support f16/f32 (llama/23882)
Shrivas Shankar [Mon, 1 Jun 2026 12:40:28 +0000 (07:40 -0500)]
metal: template GLU kernels to support f16/f32 (llama/23882)

Drops the hardcoded f32 GLU kernels in favor of a single template. We now load/store in the native tensor type (half or float) to save memory bandwidth, but keep the actual ALU compute in float to avoid exploding math in geglu/swiglu. Also opened up the dispatch gate to allow f16 inputs.

3 months agovulkan: don't hold the device mutex while compiling pipelines (llama/23641)
Jeff Bolz [Mon, 1 Jun 2026 12:04:01 +0000 (07:04 -0500)]
vulkan: don't hold the device mutex while compiling pipelines (llama/23641)

* vulkan: don't hold the device mutex while compiling pipelines

We need to hold a lock while we traverse all pipelines and lazily initialize
them, but we don't need to hold it while the pipeline is being compiled. And
it doesn't need to be the same lock as the device mutex. We call load_shaders
each time a pipeline is needed, so we only need to compile that one pipeline
(and, for example, don't want to end up compiling a pipeline that another
thread should be compiling).

* remove 'needed'

3 months agovulkan: reduce host memory lock contention (llama/23376)
Winston Ma [Mon, 1 Jun 2026 12:03:32 +0000 (20:03 +0800)]
vulkan: reduce host memory lock contention (llama/23376)

* vulkan: reduces lock contention

* replace unique_lock with lock_guard

3 months agoTP: quantized KV cache support (llama/23792)
Johannes Gäßler [Mon, 1 Jun 2026 10:30:10 +0000 (12:30 +0200)]
TP: quantized KV cache support (llama/23792)

* TP: quantized KV cache support

* fix partial view

* remove overly strict assert

3 months agovulkan: Block-load Q3_K/Q6_K block data and subtract on 32b ints (llama/23056)
Matt Corallo [Mon, 1 Jun 2026 09:46:48 +0000 (09:46 +0000)]
vulkan: Block-load Q3_K/Q6_K block data and subtract on 32b ints (llama/23056)

Q2_K/Q3_K/Q6_K do much better when using MMVQ on Intel BMG even
though they're only 2-byte aligned, and Q3_K still wins on
NVIDIA as well.

mesa isn't all that great at coalescing back-to-back loads from
alternating arrays, so we force it instead. Further, we can do
subtraction directly on a full int32_t rather than an i8vec4
with bit twiddling because the high bit is always free to start.

On Intel BMG on mesa, the switch to MMVQ provides an immediate
~57% perf increase in tg128 for unsloth/Qwen3.5-9B-GGUF:Q3_K and
~78% perf increase in tg128 for unsloth/Qwen3.5-9B-GGUF:Q6_K.

The futher switch to block loads leads to a ~24% perf increase in
tg128 for unsloth/Qwen3.5-9B-GGUF:Q3_K and a ~48% perf increase in
tg128 for unsloth/Qwen3.5-9B-GGUF:Q6_K.

Finally, Xe2 wins on MMVQ even for small k, so we take the NVIDIA
override for K quants on Xe2 as well.

3 months agovulkan: Removed unused functions (llama/23175)
Winston Ma [Mon, 1 Jun 2026 09:46:23 +0000 (17:46 +0800)]
vulkan: Removed unused functions (llama/23175)

3 months agoSupport Q4_1, Q5_0, Q5_1 in Flash-attention (llama/23812)
Neo Zhang [Mon, 1 Jun 2026 06:53:53 +0000 (14:53 +0800)]
Support Q4_1, Q5_0, Q5_1 in Flash-attention (llama/23812)

* support Q4_1, Q5_0, Q5_1

* update ut case

3 months agoAdd more types in GET_ROWS OP (llama/23710)
Neo Zhang [Mon, 1 Jun 2026 06:53:04 +0000 (14:53 +0800)]
Add more types in GET_ROWS OP (llama/23710)

* add to support Q1_0, NVFP4, IQ2_XXS, IQ2_XS, IQ2_S, IQ3_XXS, IQ1_S, IQ1_M, IQ3_S, IQ4_NL, IQ4_XS, I32, MXFP4, Q2_K, Q3_K, Q5_K, and Q6_K in GET_ROWS OP

* correct the link

3 months agosycl : Optimize Q3_K mul_mat by reorder (llama/23725)
Neo Zhang [Mon, 1 Jun 2026 06:50:55 +0000 (14:50 +0800)]
sycl : Optimize Q3_K mul_mat by reorder (llama/23725)

3 months agoopencl: support bf16 by converting to f16 (llama/23839)
lhez [Sat, 30 May 2026 17:17:47 +0000 (10:17 -0700)]
opencl: support bf16 by converting to f16 (llama/23839)

3 months agometal : restore im2col implementation for large kernels (llama/23901)
Georgi Gerganov [Sat, 30 May 2026 12:26:13 +0000 (15:26 +0300)]
metal : restore im2col implementation for large kernels (llama/23901)

3 months agoggml : add some lsx support (llama/23798)
Jinyang He [Sat, 30 May 2026 08:53:26 +0000 (16:53 +0800)]
ggml : add some lsx support (llama/23798)

* loongarch : optimize LSX fp16 load/store with native intrinsics

Use __lsx_vfcvtl_s_h and __lsx_vfcvt_h_s instead of scalar loops in
__lsx_f16x4_load and __lsx_f16x4_store.

* loongarch : add LSX implementation for q8_0 dot product

* loongarch : add LSX implementation for q6_K dot product

* loongarch : add LSX implementation for iq4_xs dot product

* Improve reduce ops when sun int16 pairs to int32

3 months agovulkan: add Flash Attention support for BFloat16 KV cache (llama/23420)
Ruben Ortlam [Sat, 30 May 2026 08:39:31 +0000 (10:39 +0200)]
vulkan: add Flash Attention support for BFloat16 KV cache (llama/23420)

* vulkan: add flash attention bf16 kv support

* vulkan: bf16 FA coopmat1 support

* vulkan: bf16 FA coopmat2 support

* fix FA bf16 f32 fallback

* fix FA bf16 coopmat1 shader

* fix FA bf16 coopmat2 shader

* code cleanup

* cleanup comment change

* address feedback

* add O_TYPE for cm2 FA

* use O_TYPE for gqaStore function

* reduce BFLOAT16 ifdefs

3 months agoggml-webgpu: Check earlier for WebGPU required features (llama/23879)
Reese Levine [Fri, 29 May 2026 21:16:05 +0000 (14:16 -0700)]
ggml-webgpu: Check earlier for WebGPU required features (llama/23879)

3 months agoggml-webgpu: add q4_0/q8_0 SET_ROWS (llama/23760)
Reese Levine [Fri, 29 May 2026 21:14:11 +0000 (14:14 -0700)]
ggml-webgpu: add q4_0/q8_0 SET_ROWS (llama/23760)

* Add q8_0 and q4_0 set_rows

* Add fast(er) quantization set_rows path

* formatting/naming

* a little more naming

* Remove unused constant

* Don't override other override

* Avoid bitcast

* Narrow relaxation

3 months agoCUDA: Check PTX version on host side to guard PDL dispatch (llama/23530)
Oliver Simons [Fri, 29 May 2026 10:28:18 +0000 (12:28 +0200)]
CUDA: Check PTX version on host side to guard PDL dispatch (llama/23530)

* CUDA: Check PTX version on host side to guard PDL dispatch

Checking on `__CUDA_ARCH_LIST__` alone is insufficient for JIT, as this
variable doesn't differentiate between compiling for say sm_90, sm_90a
or sm_90f (so forward-jittable PTX vs. arch/family-specific PTX).

Thus, one can have a bug when compiling with
`DCMAKE_CUDA_ARCHITECTURES="89;90a"`, where current code would wrongly
dispatch to PDL on sm_90/sm_120 in forward-JIT mode.

This PR fixes this issue by checking `cudaFuncAttributes::ptxVersion` of
the incoming kernel at runtime. A check on ptxVersion alone is
sufficient, as device-codes will always be >= ptxVersion (and any
violation of this would be a severe bug in CUDA/nvcc), see:
 https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/#gpu-code-code-code

* Implement MurmurHash3 mixer for better hash distribution

Magic constants were taken from boost:
https://github.com/boostorg/container_hash/blob/2698b43803c012601e6bb1a6116e83767b97986c/include/boost/container_hash/detail/hash_mix.hpp#L19-L65

* Update ggml/src/ggml-cuda/common.cuh

Co-authored-by: Johannes Gäßler <redacted>
* Address review comments, make seed non-zero

* Apply code-formatting

* Replace std::size_t -> size_t for consistency

---------

Co-authored-by: Johannes Gäßler <redacted>
3 months agomodel : support for DeepseekV32ForCausalLM with generic DeepSeek Sparse Attention...
fairydreaming [Fri, 29 May 2026 08:15:17 +0000 (10:15 +0200)]
model : support for DeepseekV32ForCausalLM with generic DeepSeek Sparse Attention (DSA) implementation (llama/23346)

* llama : support DeepSeek V3.2 model family (with DSA lightning indexer)

* convert : handle DeepseekV32ForCausalLM architecture

* ggml : support for f16 GGML_OP_FILL

* memory : separate hparams argument in llama_kv_cache constructor

* memory : add llama_kv_cache_dsa memory (KV cache + lightning indexer cache)

* llama : support for LLM_ARCH_DEEPSEEK32

* model : llama_model_deepseek32 implementation

* model : merge two scale operations into one in DSA lightning indexer implementation

* chore : remove unused code

* model : support NVFP4 in DeepSeek V3.2

Co-authored-by: Sigbjørn Skjæret <redacted>
* memory : refactoring TODO

Co-authored-by: ggerganov <redacted>
---------

Co-authored-by: Stanisław Szymczyk <redacted>
Co-authored-by: Sigbjørn Skjæret <redacted>
Co-authored-by: ggerganov <redacted>
3 months agoci : add ccache to build-sycl [no ci] (#3859)
Daniel Bevenius [Mon, 8 Jun 2026 05:27:12 +0000 (07:27 +0200)]
ci : add ccache to build-sycl [no ci] (#3859)

3 months agoci : add HF_TOKEN to docker.yml workflow [no ci] (#3861)
Daniel Bevenius [Sat, 6 Jun 2026 16:34:40 +0000 (18:34 +0200)]
ci : add HF_TOKEN to docker.yml workflow [no ci] (#3861)

This commit adds the HF_TOKEN secret to the docker workflows to avoid HF
rate limiting which currently sometimes causes the jobs to fail.

Refs: https://github.com/ggml-org/whisper.cpp/actions/runs/27053852601/job/79854251771

3 months agoci : add ccache to quantize, vad, and wasm jobs (#3860)
Daniel Bevenius [Sat, 6 Jun 2026 03:40:58 +0000 (05:40 +0200)]
ci : add ccache to quantize, vad, and wasm jobs (#3860)

* ci : add ccache to build-quantize

* ci : add ccache to build-vad

* ci : add ccache to build-wasm [no ci]

3 months agoci: build-windows action slimming (#3858)
Daniel Bevenius [Thu, 4 Jun 2026 14:27:58 +0000 (16:27 +0200)]
ci:  build-windows action slimming (#3858)

* ci : remove base-devel and git from msys2 job

This commit removes the above packages as they might not be required and
could help reduce the github cache size.

* ci : try reducing the installs to only the compilers

3 months agoci : use emscripten-core and pin version (#3857)
Daniel Bevenius [Thu, 4 Jun 2026 12:25:15 +0000 (14:25 +0200)]
ci : use emscripten-core and pin version (#3857)

This commit updates the setup emscripten sdk jobs to use emscripten-core
instead of mymindstorm and also pins the commit sha for the version
instead of using a version tag.

3 months agoci : pin github actions to commit SHAs (#3856)
Daniel Bevenius [Thu, 4 Jun 2026 09:38:46 +0000 (11:38 +0200)]
ci : pin github actions to commit SHAs (#3856)

This commit pins github actions used to the same commi SHAs that
llama.cpp uses.

3 months agoci : use ccache instead of sccache for windows-cublas [no ci] (#3855)
Daniel Bevenius [Thu, 4 Jun 2026 09:37:22 +0000 (11:37 +0200)]
ci : use ccache instead of sccache for windows-cublas [no ci] (#3855)

This commit updates the Install cache step to use ggml-org/ccache-action
and switched to use ccache instead of sccache.

The motivation for switching to ccache is that this is what llama.cpp
does and also there is an issue with later version of sscache:
```console

    sccache C:\PROGRA~1\NVIDIA~1\CUDA\v\bin\nvcc.exe -forward-unknown-to-host-compiler -DGGML_BACKEND_BUILD -DGGML_BACKEND_SHARED -DGGML_CUDA_PEER_MAX_BATCH_SIZE=128 -DGGML_SCHED_MAX_COPIES=4 -DGGML_SHARED -D_CRT_SECURE_NO_WARNINGS -D_XOPEN_SOURCE=600 -Dggml_cuda_EXPORTS -DCMAKE_INTDIR=\"Release\" -ID:\a\whisper.cpp\whisper.cpp\ggml\src\ggml-cuda\.. -ID:\a\whisper.cpp\whisper.cpp\ggml\src\..\include -isystem "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v\include" -Xcompiler="-MD -O2 -Ob2" -DNDEBUG -std=c++17 -arch=native -use_fast_math -extended-lambda -Xcompiler /Zc:preprocessor -MD -MT ggml\src\ggml-cuda\CMakeFiles\ggml-cuda.dir\Release\allreduce.cu.obj -MF ggml\src\ggml-cuda\CMakeFiles\ggml-cuda.dir\Release\allreduce.cu.obj.d -x cu -c D:\a\whisper.cpp\whisper.cpp\ggml\src\ggml-cuda\allreduce.cu -o ggml\src\ggml-cuda\CMakeFiles\ggml-cuda.dir\Release\allreduce.cu.obj -Xcompiler=-Fdggml\src\ggml-cuda\CMakeFiles\ggml-cuda.dir\Release\,-FS

    sccache: encountered fatal error

    sccache: error: Could not parse shell line

    sccache: caused by: Could not parse shell line

    ```
```

3 months agoci : only publish/push docker images daily (#3854)
Daniel Bevenius [Thu, 4 Jun 2026 08:30:48 +0000 (10:30 +0200)]
ci : only publish/push docker images daily (#3854)

This commit updates the docker workflow to be triggered on a schedule or
manually.

3 months agoci : refactor + optimize (#3847)
Georgi Gerganov [Thu, 4 Jun 2026 06:35:58 +0000 (09:35 +0300)]
ci : refactor + optimize (#3847)

* ci : add ccache clear action

* ci : split self-hosted GPU jobs into build-self-hosted.yml

Extract self-hosted runner jobs from build.yml into a dedicated
build-self-hosted.yml following the llama.cpp pattern:
  - gpu-cuda (NVIDIA Linux)
  - gpu-vulkan-nvidia-cm (NVIDIA Linux)
  - gpu-vulkan-nvidia-cm2 (NVIDIA Linux + COOPMAT2)
  - gpu-metal (macOS ARM64)
  - gpu-vulkan (macOS ARM64)

GitHub-hosted CPU jobs remain in build.yml.

Assisted-by: llama.cpp:local pi
* ci : split release jobs into release.yml

Extract release-related jobs from build.yml into a dedicated
release.yml following the llama.cpp pattern:
  - determine-tag
  - windows (Win32/x64, SDL2)
  - windows-blas (Win32/x64, OpenBLAS)
  - windows-cublas (x64, CUDA 11.8/12.4)
  - ios-xcode-build
  - bindings-java (depends on windows)
  - release (artifact aggregation + GitHub release)

CoreML job stays in build.yml with its own local tag calculation.

Assisted-by: llama.cpp:local pi
* ci : remove bindings-java job from release.yml

Assisted-by: llama.cpp:local pi
* cont : add manual trigger for build.yml

* cont : remove obsolete ifs

* ci : extract sanitizer job to bild-sanitize.yml

* ci : extract linux jobs into build-linux.yml

* ci : extract macos jobs to build-macos.yml

* ci : extract gcc jobs to build-gcc.yml

* ci : extract clang jobs to build-clang.yml

* ci : extract sycl jobs to build-sycl.yml

* ci : extract windows jobs to build-windows.yml

* ci : extract emscripten job to build-wasm.yml

* ci : extract android jobs into build-android.yml

* ci : extract quantize job to quantize.yml

* ci : extract coreml job into coreml.yml

* ci : extract vad job to vad.yml

* ci : extract cpu jobs to build-cpu.yml

* ci : make naming of yml files consistent

* ci : add --fail to curl download and propagate

This commit adds the --fail option to the model download scripts so that
if the model download returns a server error this is picked up. This is
then detected in run.sh and a error message is displayed and the script
stops and returns an error.

The motivation for this is that currently it is possible for the model
download to fail but this script proceeds and instead of a model file
the contents will be an html page probably with the error. This will
then cause the model to not be able to load due to a missing magic
number. I'm not sure we can do much about the downloading failing,
perhaps a retry but at least this will give a clearer error message.

Refs: https://github.com/danbev/whisper.cpp/actions/runs/26866349389/job/79230794512

* ci : enable command traces to see download command in use

* ci : add retry functionality to download model script

This commit adds curl retry options to the model download script.

The motivation is that currently when CI jobs run huggingface rate limit
the requests and return:
```console
curl: (22) The requested URL returned error: 429
```
This is an attempt to work around this and if it does not work then we
can an authorization token.

* ci : extract freebsd job to build-freebsd.yml

This job has been commented out as it has been flaky in the past. I'll
monitor this and if it continues to be unreliable we can disable it in
the github actions GUI instead of commenting it out like we did before.

* ci : add ccache to jobs (non-docker builds)

The ccache will only be saved on pushed to master.

* ci : bump ccache-action version to v1.2.21

The motivation for this is that the save parameter does not seem to work
with the current version.

* ci : add ccache to docker jobs in build-linux.yml

* ci : add debug statements to linux docker build

* ci : set CCACHE_DIR for build-linux.yml

* ci : add ccache to the remaining docker jobs

* ci : remove build-linux.yml

This commit remove build-linux.yml as the same jobs are also run by
build-gcc.yml, with the exception that build-gcc.yml also run ctest).
So keeping build-gcc.yml and removing the redundant build-linux.yml.

* ci : add linux build artifacts to release

* ci : revert to hendrikmuhs/ccache-action for win job

This is currently causing the following failure:
```console
sccache C:\PROGRA~1\NVIDIA~1\CUDA\v\bin\nvcc.exe -forward-unknown-to-host-compiler -DGGML_BACKEND_BUILD -DGGML_BACKEND_SHARED -DGGML_CUDA_PEER_MAX_BATCH_SIZE=128 -DGGML_SCHED_MAX_COPIES=4 -DGGML_SHARED -D_CRT_SECURE_NO_WARNINGS -D_XOPEN_SOURCE=600 -Dggml_cuda_EXPORTS -DCMAKE_INTDIR=\"Release\" -ID:\a\whisper.cpp\whisper.cpp\ggml\src\ggml-cuda\.. -ID:\a\whisper.cpp\whisper.cpp\ggml\src\..\include -isystem "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v\include" -Xcompiler="-MD -O2 -Ob2" -DNDEBUG -std=c++17 -arch=native -use_fast_math -extended-lambda -Xcompiler /Zc:preprocessor -MD -MT ggml\src\ggml-cuda\CMakeFiles\ggml-cuda.dir\Release\allreduce.cu.obj -MF ggml\src\ggml-cuda\CMakeFiles\ggml-cuda.dir\Release\allreduce.cu.obj.d -x cu -c D:\a\whisper.cpp\whisper.cpp\ggml\src\ggml-cuda\allreduce.cu -o ggml\src\ggml-cuda\CMakeFiles\ggml-cuda.dir\Release\allreduce.cu.obj -Xcompiler=-Fdggml\src\ggml-cuda\CMakeFiles\ggml-cuda.dir\Release\,-FS
sccache: encountered fatal error
sccache: error: Could not parse shell line
sccache: caused by: Could not parse shell line
```

Refs: https://github.com/danbev/whisper.cpp/actions/runs/26883673904/job/79290017353

* ci : make static linux artifacts

* ci : make linux release artifact names consistent

This commit removes the tag form the linux release artifacts to be
consistent with the existing artifacts.

If we want to include the tag then we can do that in a follow-up PR.

* ci : fix linux zip files to have a directory

* ci : add HF_TOKEN secret for HF download authorization

This is to avoid the HR rate limiting when downloading model.

---------

Co-authored-by: Daniel Bevenius <redacted>
3 months agowhisper : catch C++ exceptions in whisper_init_with_params_no_state (#3831)
danscMax [Tue, 2 Jun 2026 11:25:29 +0000 (14:25 +0300)]
whisper : catch C++ exceptions in whisper_init_with_params_no_state (#3831)

whisper_model_load() can throw instead of returning false: std::runtime_error
from this file (failed ggml context / no compatible buffer type), or
vk::SystemError / vk::OutOfDeviceMemoryError from the ggml-vulkan backend during
device/buffer allocation.

whisper_init_* are extern "C", so a C++ exception unwinding across that boundary
aborts non-C++ callers (Rust via whisper-rs, Go via cgo) -- on Windows
STATUS_STACK_BUFFER_OVERRUN (0xC0000409) -- even though the function already
returns NULL on failure. Wrap whisper_model_load() in try/catch and route any
throw into the existing NULL-return path.

Co-authored-by: Claude Opus 4.7 <redacted>
3 months agoserver : merge split utf-8 token text in verbose json (#3850)
Noah Lyons [Tue, 2 Jun 2026 11:10:27 +0000 (07:10 -0400)]
server : merge split utf-8 token text in verbose json (#3850)

3 months agocmake : do not assume /usr/lib library installation. (#3693)
Patrice Levesque [Tue, 2 Jun 2026 07:22:16 +0000 (03:22 -0400)]
cmake : do not assume /usr/lib library installation. (#3693)

Current `pkgconfig` configuration file installation path and its
contents assume libraries are installed under `/usr/lib` and this is not
always the case, for instance `/usr/lib64` is quite possible under
Gentoo Linux.

Thus use the `CMAKE_INSTALL_LIBDIR` variable instead of a hardcoded
`lib`.

3 months agorelease : v1.8.6
Georgi Gerganov [Mon, 1 Jun 2026 11:56:20 +0000 (14:56 +0300)]
release : v1.8.6

3 months agoci : fix path to whisper.h in examples.yml [no ci] (#3842)
Daniel Bevenius [Mon, 1 Jun 2026 05:20:19 +0000 (07:20 +0200)]
ci : fix path to whisper.h in examples.yml [no ci] (#3842)

This commit updates the include path to whisper.h and also ensures that
this is only built on pushes to master.

3 months agoci : fix self-hosted paths to mnt
Georgi Gerganov [Sun, 31 May 2026 13:06:32 +0000 (16:06 +0300)]
ci : fix self-hosted paths to mnt

3 months agopi : add config
Georgi Gerganov [Sun, 31 May 2026 13:04:12 +0000 (16:04 +0300)]
pi : add config

[no ci]

3 months agoci : remove obsolete self-hosted label
Georgi Gerganov [Sun, 31 May 2026 12:45:44 +0000 (15:45 +0300)]
ci : remove obsolete self-hosted label

3 months agocommon : pass sample rate to `ffmpeg_decode_audio()`
Georgi Gerganov [Sun, 31 May 2026 12:48:05 +0000 (15:48 +0300)]
common : pass sample rate to `ffmpeg_decode_audio()`

3 months agocommon : re-implement `ffmpeg-transcode.cpp` + clarify ffmpeg usage (#3846)
Georgi Gerganov [Sun, 31 May 2026 12:44:07 +0000 (15:44 +0300)]
common : re-implement `ffmpeg-transcode.cpp` + clarify ffmpeg usage (#3846)

* examples : remove ffmpeg-transcode.cpp

* examples : implement ffmpeg-transcode.cpp

Assisted-by: llama.cpp:local pi
* common : switch from WHISPER_FFMPEG -> WHISPER_COMMON_FFMPEG

3 months agosync : ggml
Georgi Gerganov [Fri, 29 May 2026 06:46:42 +0000 (09:46 +0300)]
sync : ggml

3 months agoggml : bump version to 0.13.1 (ggml/1523)
Georgi Gerganov [Fri, 29 May 2026 06:46:12 +0000 (09:46 +0300)]
ggml : bump version to 0.13.1 (ggml/1523)

3 months agotalk-llama : sync llama.cpp
Georgi Gerganov [Fri, 29 May 2026 06:44:28 +0000 (09:44 +0300)]
talk-llama : sync llama.cpp

3 months agosync : ggml
Georgi Gerganov [Fri, 29 May 2026 06:43:15 +0000 (09:43 +0300)]
sync : ggml

3 months agocuda : disables launch_fattn PDL enrollment due to compiler bug (llama/23825)
Andreas Kieslinger [Fri, 29 May 2026 04:46:10 +0000 (06:46 +0200)]
cuda : disables launch_fattn PDL enrollment due to compiler bug (llama/23825)

3 months agometa : Add missing `buffer` set in allreduce fallback !COMPUTE clear (llama/23480)
Matt Corallo [Fri, 29 May 2026 03:30:24 +0000 (03:30 +0000)]
meta : Add missing `buffer` set in allreduce fallback !COMPUTE clear (llama/23480)

Without this at least the vulkan backend will skip the `* 0` for
!COMPUTE tensors, causing corrupt output.

3 months agohexagon: basic/generic op fusion support and RMS_NORM+MUL fusion (llama/23835)
Max Krasnyansky [Thu, 28 May 2026 21:05:54 +0000 (14:05 -0700)]
hexagon: basic/generic op fusion support and RMS_NORM+MUL fusion (llama/23835)

Updating infra to enable op fusion and using RMS_NORM+MUL as the use-case.

3 months agoopencl: move backend info printing into its own function (llama/23702)
lhez [Thu, 28 May 2026 18:05:42 +0000 (11:05 -0700)]
opencl: move backend info printing into its own function (llama/23702)

* opencl: move backend info print into its own function

* opencl: move new log line

* opencl: fix for non adreno path

3 months agoggml: auto apply iGPU flag CUDA/HIP if integrated device (llama/23007)
fl0rianr [Thu, 28 May 2026 13:01:14 +0000 (15:01 +0200)]
ggml: auto apply iGPU flag CUDA/HIP if integrated device (llama/23007)

3 months agommvq Optim: add MMVQ_PARAMETERS_TURING(mmvq_parameter_table_id) for … (#23729)
redfox [Thu, 28 May 2026 12:51:14 +0000 (20:51 +0800)]
mmvq Optim: add MMVQ_PARAMETERS_TURING(mmvq_parameter_table_id) for … (#23729)

* mmvq Optim:  add MMVQ_PARAMETERS_TURING(mmvq_parameter_table_id) for SM75 TURING

* avoid a mismatch for JIT compilation of Turing device code for Ampere or newer

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

Co-authored-by: Copilot <redacted>
Co-authored-by: Johannes Gäßler <redacted>
3 months agoCUDA: route batch>=4 quantized matmul to MMQ on AMD MFMA hardware (llama/23227)
Jaden_Mach [Thu, 28 May 2026 12:50:25 +0000 (08:50 -0400)]
CUDA: route batch>=4 quantized matmul to MMQ on AMD MFMA hardware (llama/23227)

* CUDA: per-quant MMVQ/MMQ batch threshold on AMD MFMA hardware

The dispatcher uses a single global threshold (MMVQ_MAX_BATCH_SIZE = 8)
to choose between mul_mat_vec_q (per-row GEMV) and mul_mat_q (MFMA-tiled
GEMM) for quantized matmul. On AMD CDNA, the optimal crossover differs
substantially by quant family because the per-row GEMV cost is dominated
by dequantisation, not the dot-product itself: K-quants pay a heavier
super-block decode and so MMQ wins sooner; legacy and IQ quants have
lean decode and stay ahead until the batch fully populates an MFMA tile.

This patch introduces ggml_cuda_should_use_mmvq(type, cc, ne11) -> bool,
mirroring the existing ggml_cuda_should_use_mmq, and gates per-quant
thresholds on amd_mfma_available(cc):

  Q3_K, Q4_K, Q5_K  : MMVQ <= 3   (MMQ wins from batch=4: +5% .. +76%)
  Q2_K, Q6_K        : MMVQ <= 5   (MMQ wins from batch=6: +8% .. +35%)
  others            : MMVQ <= 8   (legacy & IQ regress under MMQ; unchanged)

Non-AMD-MFMA paths (NVIDIA, RDNA, CDNA1 without MFMA) are byte-identical
to master. GGML_CUDA_FORCE_MMVQ=1 restores the original global threshold
for A/B testing.

Measured on MI250X (gfx90a, ROCm 7.2.1) with Llama-3.2-3B-Instruct,
llama-bench pp512 across all 20 supported quants, ubatch 1..8, 10 reps.
Full table in PR description.

  Selected pp512 throughput (tok/s, ub=8):
    Q4_K_S:  559 -> 940  (+68%)
    Q5_K_S:  503 -> 884  (+76%)
    Q3_K_S:  629 -> 879  (+40%)
    Q2_K  :  615 -> 809  (+32%)
    Q6_K  :  582 -> 776  (+33%)

  Selected pp512 throughput (tok/s, ub=4):
    Q4_K_S:  444 -> 480  (+ 8%)
    Q4_0  :  682 -> 685  (+ 0%)   (no regression - retains MMVQ)
    IQ4_XS:  706 -> 698  (- 1%)   (no regression - retains MMVQ)

* CUDA: address review — inline MMVQ batch table, drop env hatch & doc block

* tune kernel selection logic for CDNA1

---------

Co-authored-by: Johannes Gäßler <redacted>
3 months agohexagon: minor refresh for HMX FA and MM (llama/23796)
Max Krasnyansky [Thu, 28 May 2026 11:49:11 +0000 (04:49 -0700)]
hexagon: minor refresh for HMX FA and MM (llama/23796)

* hex-fa: clean up qf32/fp32 handling and stride handling

* hex-fa: fix corner case fp NAN issues that were cause bad output from gemma4 on v79

* hex-fa: vectorize leftover handling

* hex-fa: avoid HVX fallback during token gen HMX has more FP16 compute capacity

* hmx-mm: remove dead code

* hmx-mm: use fastdiv in x4x2 dequant

* hmx-mm: sandwich dequant and scatter to improve perf

* hmx-mm: fixed rebase conflicts

* hmx-mm: further improve weight dequant by doing early type dispatch and precomputing fastdiv

* hmx-mm: an even earlier dispatch for per-type dequant

* hmx-mm: dequant linear types like q4_0 and q4_1 without the LUTs

This is a bit faster than LUT.

* hex-cmake: one more tweak for lto

---------

Co-authored-by: Trivikram Reddy <redacted>
3 months agovulkan: fast path for walsh-hadamard transform (llama/23687)
Jeff Bolz [Thu, 28 May 2026 11:18:43 +0000 (06:18 -0500)]
vulkan: fast path for walsh-hadamard transform (llama/23687)

* vulkan: fast path for walsh-hadamard transform

* disable for intel due to segfault

3 months agovulkan: fix wrong index variable in inner loop (llama/23665)
Winston Ma [Thu, 28 May 2026 10:48:34 +0000 (18:48 +0800)]
vulkan: fix wrong index variable in inner loop (llama/23665)

3 months agovulkan: Fix memory logger unsafe iterator access (llama/23667)
Winston Ma [Thu, 28 May 2026 10:46:07 +0000 (18:46 +0800)]
vulkan: Fix memory logger unsafe iterator access (llama/23667)

3 months agocuda : fix KQ mask offset integer overflow in fattn MMA kernel (llama/23610)
fairydreaming [Thu, 28 May 2026 08:55:42 +0000 (10:55 +0200)]
cuda : fix KQ mask offset integer overflow in fattn MMA kernel (llama/23610)

Co-authored-by: Stanisław Szymczyk <redacted>
3 months agoggml: fixed Arm SVE usage bug in vec.h, vec.cpp (llama/22841)
Martin Klacer [Thu, 28 May 2026 07:04:21 +0000 (08:04 +0100)]
ggml: fixed Arm SVE usage bug in vec.h, vec.cpp (llama/22841)

* Updated vec.h/vec.cpp code to accumulate to F32 rather than F16

Change-Id: I0cb789347f2bf60ffaf9047319f727e788c825f8

Signed-off-by: Martin Klacer <redacted>
Co-authored-by: Milos Puzovic <redacted>
3 months agoHexagon: OP_GATED_DELTA_NET K>1 support (llama/23531)
ymcki [Thu, 28 May 2026 06:05:25 +0000 (14:05 +0800)]
Hexagon: OP_GATED_DELTA_NET K>1 support (llama/23531)

* K>1 state snapshot support

* removed picky indent multiple of 4 fixes

3 months agoopencl: OP_GATED_DELTA_NET (llama/23312)
ymcki [Thu, 28 May 2026 04:23:21 +0000 (12:23 +0800)]
opencl: OP_GATED_DELTA_NET (llama/23312)

* OP_GATED_DELTA_NET impl

* add back lanes_per_column declaration

* removed has_subgroup_arithmetic and has_subgroup_clustered_reduce

* removed trailing spaces and fixes indentation. Hard coded subgroup size for Adreno and Intel. Return not supported when K>1 state snapshot

* support for K>1 state snapshot

* removed picky indent multiple of 4 fixes

* removed return that won\'t be executed

3 months agoggml-webgpu: remove legacy constants (llama/23672)
Reese Levine [Wed, 27 May 2026 21:22:33 +0000 (14:22 -0700)]
ggml-webgpu: remove legacy constants (llama/23672)