]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/log
pkg/ggml/sources/whisper.cpp
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)

3 months agohexagon: add support for Q4_1 in MUL_MAT and MUL_MAT_ID (llama/23647)
Max Krasnyansky [Wed, 27 May 2026 17:46:11 +0000 (10:46 -0700)]
hexagon: add support for Q4_1 in MUL_MAT and MUL_MAT_ID (llama/23647)

* hex-mm: add support for Q4_1 matmul/matvec, hvx-only for now

* hmx-mm: add support for Q4_1

* hex-mm: use Q8_1 dynamic quantization to avoid having to compute sums in the vec_dot

* hexagon: fix repack scratch buffer overflow

* hex-mm: fix Q4_1 repack buffer sizing

* hexagon: flip the build order for mm and fa (seems to help LTO)

* hex-mm: add vec_dot 4x1s and minor HMX cleanup after adding Q4_1

* hex-mm: fix fp16 vec_dot fallback to 2x1 and another issue that could cause incorrect output

* hexagon: resurrect early-wake and add support for polling for op-batch completions

With Q4_1 ggml-hexagon now claims pretty much the entire graphs which gives the CPU more time to chilax.
This is a good thing! But it does add extra latency for the pure benchmark runs.
Early wakeup helps recover the latency a bit in the normals runs and op-batch polling is just for benchmarking.

---------

Co-authored-by: Todor Boinovski <redacted>
3 months agoggml-webgpu: Fix how to dispatch WG to some ops (llama/23750)
Masashi Yoshimura [Wed, 27 May 2026 16:48:12 +0000 (01:48 +0900)]
ggml-webgpu: Fix how to dispatch WG to some ops (llama/23750)

3 months agovulkan: Switch MUL_MAT_VEC to 4 K per iteration for F16/32 (llama/22887)
Matt Corallo [Wed, 27 May 2026 15:19:23 +0000 (15:19 +0000)]
vulkan: Switch MUL_MAT_VEC to 4 K per iteration for F16/32 (llama/22887)

* vulkan: Switch MUL_MAT_VEC to 4 K per iteration for F16/32

Against mesa git, this shows a 4.8% performance improvement for
tg128 on Qwen3.5-9B:BF16 on Intel BMG.

Note that this breaks some tests until the last commit which fixes
OOB A reads.

* vulkan: Use aligned loads in mul_mat_vec when available

Against mesa git, this shows a 3.3% performance improvement for
tg128 on Qwen3.5-9B:BF16 on Intel BMG.

* Make explicit that `num_rows` is <= `NUM_ROWS` in mul_mat_vec

Mesa's UUB logic can't see through conditionals, limiting its
ability to understand the bounds on the `num_rows` field in the
cleanup run. Making it explicit that `num_rows` is, indeed, always
<= `NUM_ROWS` helps mesa make slightly better codegen.

Against mesa git, this currently shows a 1% performance improvement
in tg128 on Qwen3.5-9B:BF16 on Intel BMG.

* vulkan: Fix OOB A reads in MUL_MAT_VEC for odd sizes

There was a TODO to fix the OOB reads from the A matrix which we do
here.

It is within performance noise (+<0.1%) in tg128 for
Qwen3.5-9B:BF16 on Intel BMG.

3 months agovulkan: use GL_NV_cooperative_matrix_decode_vector for faster matmul (llama/23541)
Jeff Bolz [Wed, 27 May 2026 15:18:28 +0000 (10:18 -0500)]
vulkan: use GL_NV_cooperative_matrix_decode_vector for faster matmul (llama/23541)

3 months agovulkan: add REPEAT op support for f16 to f16. (llama/23298)
l8bloom [Wed, 27 May 2026 14:59:08 +0000 (16:59 +0200)]
vulkan: add REPEAT op support for f16 to f16. (llama/23298)

* feat: extend repeat op for vulkan

* feat: add repeat_f16 vulkan pipeline

* fix: ensure same dst and src types

* fix: use type_size instead of data types

* fix: use int16 and int32 for repeat shader op

* chore: rename repeat_f* to repeat_i*

* chore: rename repeat vulkan pipelines

3 months agoCUDA: restrict PDL to CTK >= 12.3 due to MSVC issues (llama/23742)
Oliver Simons [Wed, 27 May 2026 12:21:04 +0000 (14:21 +0200)]
CUDA: restrict PDL to CTK >= 12.3 due to MSVC issues (llama/23742)

3 months agovulkan: avoid preferring transfer queue on AMD UMA devices (llama/22455)
Winston Ma [Wed, 27 May 2026 09:48:40 +0000 (17:48 +0800)]
vulkan: avoid preferring transfer queue on AMD UMA devices (llama/22455)

3 months agoggml-zendnn : fixed naming of matmul function (llama/20964)
Vladislav [Tue, 26 May 2026 22:59:35 +0000 (01:59 +0300)]
ggml-zendnn : fixed naming of matmul function (llama/20964)

* ggml-zendnn: fixed naming of matmul function

* ggml-zendnn: fixed naming of mul_mat_id function

* ggml-zendnn: fixed print in  mul_mat_id

---------

Co-authored-by: plotnikov.v10 <redacted>
3 months agovulkan: optimize conv2d and implement coopmat1 support (llama/22620)
Jeff Bolz [Tue, 26 May 2026 13:48:05 +0000 (08:48 -0500)]
vulkan: optimize conv2d and implement coopmat1 support (llama/22620)

* vulkan: add CONV_SHAPE_64x128 for medium-K conv2d

* vulkan: skip conv2d bounds checks when shapes align with tile sizes

* vulkan: use WG_SIZE=128 for CONV_SHAPE_64x32 conv2d

* vulkan: stage cm2 conv2d accumulator through shmem before global store

* vulkan: add coopmat1 conv2d path

* fallback when using too much shared memory. clean up comments

* Require 16x16x16 and subgroup size 32 or 64

* check whether shared memory is sufficient before overwriting conv2d params with coopmat1 values

3 months agohexagon: add support for CONCAT op (llama/23648)
Max Krasnyansky [Tue, 26 May 2026 13:20:05 +0000 (06:20 -0700)]
hexagon: add support for CONCAT op (llama/23648)

* hexagon: add support for CONCAT with optimized concat_2d_transposed

qwen3.5 models are quite heavy on the CONCAT with large and transposed src1.

* hex-concat: use fastdiv in generic version

* hex-concat: make checks for transposed a bit more readable

* hex-concat: reoder dma ops for better pipelining

* hex-cont/cpy: optimize CPY and CONT ops

The primary change is to avoid scalar divs in the inner loops.
We were calling hvx_copy_uu(... type_size) where type_size is non a constexpr.
This causes runtime divs by that value which is normally just 4 or 2 (f32/f16).

* hex-get-rows: optimize GET_ROWS for large rows

We now use DMA for larger rows and also split them into chunks to improve perf for Qwen3.5 and other models
that do lots of GET_ROWS with huge (2MB+ rows).

Also bump the DMA queue depth now that we can take advantage of it.

* hex-concat: unroll the inner loops of concat_2d

* hex-concat: more updates to concat_2d to improve perf a bit further

* hex-cpy: fixed n_rows per thread checks in the copy ops

* hmx-fa: fix alignment issues while computing dma sizes

* hex-set-rows: add early returns for idle threads

* hvx-rope: minor optimization to replace loops with fastdiv logic

* hex-rope: replace scalar tail processing with HVX

* hex-rope: optimize rope cache init with HVX

Add hvx-utils sin/cos helpers that use an aprox method (similar to rsqrt, inverse, etc)
Use the helpers to optimize ROPE.

3 months agoSYCL: implement ggml_sycl_pool_vmm (llama/22862)
Alexey Kopytko [Tue, 26 May 2026 04:59:00 +0000 (13:59 +0900)]
SYCL: implement ggml_sycl_pool_vmm (llama/22862)

* SYCL: implement ggml_sycl_pool_vmm

* Add an option to bypass VMM with GGML_SYCL_DISABLE_VMM

* Clean up debugging logging

* document GGML_SYCL_DISABLE_VMM

* Multi-stream MoE optimization

* Revert "Multi-stream MoE optimization"

This reverts commit 938929c3f13a562ec67c59e87cc5d38595444cce.

* Update common.hpp

Co-authored-by: Neo Zhang <redacted>
* Flip GGML_SYCL_DISABLE_VMM to GGML_SYCL_ENABLE_VMM

* add logging for GGML_SYCL_ENABLE_VMM when extension is not available (SYCL_EXT_ONEAPI_VIRTUAL_MEM macro)

* Apply suggestions from code review

Co-authored-by: Alexey Kopytko <redacted>
* Apply suggestion from @sanmai

* Apply suggestion from @sanmai

---------

Co-authored-by: Neo Zhang <redacted>
3 months agoggml-webgpu: Add MMVQ path for Q4/Q8/Q2_K/Q4_K and clean up legacy MUL_MAT pipeline...
Masashi Yoshimura [Tue, 26 May 2026 03:42:49 +0000 (12:42 +0900)]
ggml-webgpu: Add MMVQ path for Q4/Q8/Q2_K/Q4_K and clean up legacy MUL_MAT pipeline (llama/23594)

* ggml-webgpu: Add MMVQ path for Q4/Q8/Q2_K/Q4_K

* Fix to editorconfig checking pass

* Remove mul-mat-legacy pipeline

* Fix to use vendor name as is and add dot_product/vendor to shader_lib_ctx

3 months agoCheck batch_compute_passes before sending passes when not doing GPU profiling (llama...
Nikhil Jain [Tue, 26 May 2026 03:32:49 +0000 (20:32 -0700)]
Check batch_compute_passes before sending passes when not doing GPU profiling (llama/23457)

* Only run webgpu CI on my fork

* Add webgpu only workflow

* refactor batch_compute_passes to a per-thread variable, and submit individual passes when it is set to false and no GPU profiling is enabled

* restore build.yml

3 months agoCUDA: missing PDL sync for FWHT, better fallback (llama/23690)
Johannes Gäßler [Tue, 26 May 2026 03:05:51 +0000 (05:05 +0200)]
CUDA: missing PDL sync for FWHT, better fallback (llama/23690)

3 months agometal : add apple device id (llama/23566)
forforever73 [Mon, 25 May 2026 18:05:16 +0000 (02:05 +0800)]
metal : add apple device id (llama/23566)

Co-authored-by: lvyichen <redacted>
3 months agoCUDA: add fast walsh-hadamard transform (llama/23615)
Aman Gupta [Mon, 25 May 2026 13:12:10 +0000 (21:12 +0800)]
CUDA: add fast walsh-hadamard transform (llama/23615)

* CUDA: add fast walsh-hadamard transform

* review: add unrolls + change size_t -> int

* warp size 64

---------

Co-authored-by: Johannes Gäßler <redacted>
3 months agoci : add ignore for bindings/{ruby, go} in build.yml [no ci] (#3837)
Daniel Bevenius [Thu, 28 May 2026 16:06:04 +0000 (18:06 +0200)]
ci : add ignore for bindings/{ruby, go} in build.yml [no ci] (#3837)

This commit adds an ignore for bindings-ruby and bindings-go in
build.yml as these are handled by separate .yml file (separate jobs)
and don't need to trigger a full CI build.

3 months agoci : fix include paths for bindings-go job [no ci] (#3835)
Daniel Bevenius [Thu, 28 May 2026 12:53:34 +0000 (14:53 +0200)]
ci : fix include paths for bindings-go job [no ci] (#3835)

3 months agoci : add on push/pull_request paths ruby job (#3833)
Daniel Bevenius [Thu, 28 May 2026 12:41:48 +0000 (14:41 +0200)]
ci : add on push/pull_request paths ruby job (#3833)

* ci : add on push/pull_request paths ruby job

This commit adds paths to bindings-ruby to only build if changes where
made to bindings/ruby or to include/whisper.h.

* ci : add additional paths [no ci]

3 months agoci : renable arm64 docker builds (#3832)
Daniel Bevenius [Thu, 28 May 2026 10:09:13 +0000 (12:09 +0200)]
ci : renable arm64 docker builds (#3832)

This commit re-enables the arm64 docker images builds which were removed
in Commit 9366544991bfee59c927e7c23b1861c6c762e708
("ci : fix arm builds"). It also uses ubuntu-24.04-arm as the runner
which enables us to avoid QEMU.

Resolves: https://github.com/ggml-org/whisper.cpp/issues/2859

3 months agoci : set GGML_NATIVE=OFF for bindings-java (#3830)
Daniel Bevenius [Thu, 28 May 2026 05:21:25 +0000 (07:21 +0200)]
ci : set GGML_NATIVE=OFF for bindings-java (#3830)

* ci : set GGML_NATIVE=OFF for bindings-java

This commit attempts to address an issue with the bindings-java job
which is currently failing.

I've not been able to reproduce this locally my windows machine and I
suspect that what might be happning is that windows job compiles on a
runner where it has different CPU features, for example AVX512 and when
this dll is used on a different runner that does not have that feature
it will crash.

Refs: https://github.com/ggml-org/whisper.cpp/actions/runs/26496174929/job/78059073255?pr=3829

* ci : also disable BMI2

3 months agoci : only run docker jobs when pushed to master [no ci] (#3828)
Daniel Bevenius [Wed, 27 May 2026 06:46:23 +0000 (08:46 +0200)]
ci : only run docker jobs when pushed to master [no ci] (#3828)

3 months agodocs : add AGENTS.md and CONTRIBUTING.md [no ci] (#3826)
Daniel Bevenius [Wed, 27 May 2026 04:22:38 +0000 (06:22 +0200)]
docs : add AGENTS.md and CONTRIBUTING.md [no ci] (#3826)

* docs : add AGENTS.md and CONTRIBUTING.md [no ci]

This commit add AGENTS.md and CONTRIBUTING.md which are based on the
same files in llama.cpp. They have been modified slightly to fit with
whisper.cpp.

The motivation for this is to clarify the contribution policy in
whisper.cpp so that contributers can have a better understanding of the
expectations and requirements for contributing to the project.

3 months agocli : merge tokens split across UTF-8 boundaries in JSON output (#3751)
texasich [Tue, 26 May 2026 04:23:41 +0000 (23:23 -0500)]
cli : merge tokens split across UTF-8 boundaries in JSON output (#3751)

* cli : merge tokens split across UTF-8 boundaries in JSON output

When a multi-byte UTF-8 codepoint (most commonly a CJK character, 3 bytes)
is split across multiple whisper tokens, the -ojf/--output-json-full
writer emitted each token's partial bytes as its own JSON string, producing
invalid UTF-8 that chokes downstream parsers.

Merge adjacent tokens in output_json whenever the accumulated text still
ends on an incomplete UTF-8 sequence. The merged entry keeps the first
token's id/p/t_dtw and extends t1 to the last absorbed token, which
matches how segment text is assembled elsewhere.

Refs #1798

* fix: address review — add braces for consistency, use full issue URL

- Add braces to if/else chain for codebase consistency
- Use full URL for issue #1798 reference

Review: @danbev

---------

Co-authored-by: texasich <redacted>
Co-authored-by: texasich <redacted>
3 months agorelease : v1.8.5
Georgi Gerganov [Mon, 25 May 2026 10:06:33 +0000 (13:06 +0300)]
release : v1.8.5

3 months agobenches : update
Georgi Gerganov [Mon, 25 May 2026 10:05:30 +0000 (13:05 +0300)]
benches : update

3 months agosync : ggml
Georgi Gerganov [Mon, 25 May 2026 09:44:07 +0000 (12:44 +0300)]
sync : ggml

3 months agoggml : bump version to 0.13.0 (ggml/1510)
Georgi Gerganov [Mon, 25 May 2026 09:40:17 +0000 (12:40 +0300)]
ggml : bump version to 0.13.0 (ggml/1510)

3 months agoTP: fix ggml context size calculation (llama/22616)
Johannes Gäßler [Mon, 25 May 2026 09:37:25 +0000 (11:37 +0200)]
TP: fix ggml context size calculation (llama/22616)

* TP: fix ggml context size calculation, memory leak

* move split state cache back into the context

* revert to constant ggml context size for cgraphs

* increase headroom for statically allocated tensors

* remove obsolete include

3 months agoggml: `gguf_init_from_callback` and `gguf_init_from_buffer` (llama/22341)
Gilad S [Mon, 25 May 2026 09:33:29 +0000 (11:33 +0200)]
ggml: `gguf_init_from_callback` and `gguf_init_from_buffer` (llama/22341)

* ggml: implement `gguf_init_from_buffer`

* test: `gguf_init_from_buffer`

* fix: memory breakdown for a model loaded with `no_alloc` from a file is consistent with being loaded from a buffer

* fix: use `GGML_UNUSED`

Co-authored-by: Copilot <redacted>
* fix: remove `total_size` from `gguf_reader`

* fix: file offset calculation, rename `offset` to `data_offset`

Co-authored-by: Copilot <redacted>
* refactor: extract model loader bug fixes to another PR

* feat: add `gguf_init_from_callback`

* fix: always require a max expected size

* fix: change `gguf_reader_callback_t`'s `output` type to `void *`, change `max_expected_size` and offsets to `uint64_t`

* fix: harden against offset overflow in buffer read

* fix: remove seek behavior from the callback

* feat: `max_chunk_read == 0` means `SIZE_MAX`

* fix: seeking in a gguf file with no tensors

---------

Co-authored-by: Copilot <redacted>
3 months agoreadme : add AMD ROCm/HIP GPU build instructions (#3823)
Kaihui-AMD [Mon, 25 May 2026 09:27:42 +0000 (17:27 +0800)]
readme : add AMD ROCm/HIP GPU build instructions (#3823)

Signed-off-by: Kaihui-AMD <redacted>
3 months agotalk-llama : sync llama.cpp
Georgi Gerganov [Mon, 25 May 2026 09:18:31 +0000 (12:18 +0300)]
talk-llama : sync llama.cpp

3 months agosync : ggml
Georgi Gerganov [Mon, 25 May 2026 09:14:40 +0000 (12:14 +0300)]
sync : ggml

3 months agoggml : bump version to 0.12.1 (ggml/1508)
Georgi Gerganov [Mon, 25 May 2026 09:13:21 +0000 (12:13 +0300)]
ggml : bump version to 0.12.1 (ggml/1508)

3 months agoggml : Parallelize quant LUT init (llama/23595)
Jeff Bolz [Mon, 25 May 2026 07:15:46 +0000 (02:15 -0500)]
ggml : Parallelize quant LUT init (llama/23595)

- Use OpenMP to parallelize iq2xs_init_impl and iq3xs_init_impl.
- Move the OpenMP detection from ggml-cpu to ggml-base.
- Update OpenMP dependencies in ggml-config.cmake.in.

3 months agoTP: fix entirely zero-sized slices per device (llama/23525)
Johannes Gäßler [Sun, 24 May 2026 06:19:33 +0000 (08:19 +0200)]
TP: fix entirely zero-sized slices per device (llama/23525)

3 months agoopencl: batch profiling to improve speed and prevent memory leaks (llama/23495)
shaofeiqi [Sun, 24 May 2026 06:11:43 +0000 (23:11 -0700)]
opencl: batch profiling to improve speed and prevent memory leaks (llama/23495)

3 months agohexagon: apply repl optimization in flash attn softmax as #22993 (llama/23455)
Yiwei Shao [Sun, 24 May 2026 02:56:59 +0000 (19:56 -0700)]
hexagon: apply repl optimization in flash attn softmax as #22993 (llama/23455)

3 months agoggml : Check the right iface method before using the fallback 2d get (llama/23514)
dskwe [Sat, 23 May 2026 10:49:24 +0000 (18:49 +0800)]
ggml : Check the right iface method before using the fallback 2d get (llama/23514)

3 months agovulkan: fix windows find_package of SPIRV-Headers (llama/23215)
Jeff Bolz [Sat, 23 May 2026 07:44:46 +0000 (02:44 -0500)]
vulkan: fix windows find_package of SPIRV-Headers (llama/23215)

* vulkan: fix windows find_package of SPIRV-Headers

* not windows-only

3 months agoopencl: generalize Adreno MoE kernels on M (llama/23449)
Shawn Gu [Sat, 23 May 2026 00:08:41 +0000 (17:08 -0700)]
opencl: generalize Adreno MoE kernels on M (llama/23449)

3 months agoSYCL: improve MoE prefill throughput (llama/23142)
Alexey Kopytko [Fri, 22 May 2026 12:50:17 +0000 (21:50 +0900)]
SYCL: improve MoE prefill throughput (llama/23142)

- change `k_copy_src1_to_contiguous` so that uses a precomputed contiguous mapping where all rows "owned" by an expert are in one slice with a know starts and ends
- switch the `O(n_as * n_routed_rows)` contraption to a counting sort-based procedure with `O(n_as + n_routed_rows)` complexity

3 months agosycl : Level Zero detection in ggml_sycl_init (llama/23097)
Alexey Kopytko [Fri, 22 May 2026 12:49:45 +0000 (21:49 +0900)]
sycl : Level Zero detection in ggml_sycl_init (llama/23097)

* [SYCL] Centralize Level Zero detection in ggml_sycl_init

* use the same wording

* get back the warning

3 months agoSYCL : gated_delta_net K>1 (llama/23174)
karavayev [Fri, 22 May 2026 12:48:56 +0000 (08:48 -0400)]
SYCL : gated_delta_net K>1 (llama/23174)

* sycl_gated_delta_net K>1

* editor_config

3 months agoSYCL: add BF16 to DMMV kernel path (~4x tg speedup on Intel Arc) (llama/21580)
Katostrofik [Fri, 22 May 2026 12:48:24 +0000 (08:48 -0400)]
SYCL: add BF16 to DMMV kernel path (~4x tg speedup on Intel Arc) (llama/21580)

* SYCL: add BF16 to DMMV kernel path for ~4x token generation speedup

BF16 models had no dedicated token generation kernel — they fell through
to the generic full-GEMM path, resulting in ~14% memory bandwidth
utilization on Intel Arc GPUs. This adds BF16 support to the DMMV
(dequantize mul-mat-vec) path, matching the existing F16 implementation.

Fixes #20478

* SYCL: fix BF16 DMMV out-of-bounds when ncols % 64 != 0

The qk=1 kernel (used for F16 and BF16) iterates with stride
2*GGML_SYCL_DMMV_X (= 64 on Intel targets where WARP_SIZE=16). When
ncols is a multiple of DMMV_X (32) but not of 2*DMMV_X (64), the last
warp iteration accesses elements at col >= ncols, producing NaN for the
final row and wrong values for interior rows.

Fix: tighten can_use_dequantize_mul_mat_vec to require ne[0] %
(2*DMMV_X) == 0 for F16/BF16 types, and update the ASSERT in the BF16
launcher to match. Quantized types use block-structured kernels with
different access patterns and keep the existing DMMV_X check.

Verified: test-backend-ops MUL_MAT passes 913/913 on Intel Arc Pro B70.
Previously failing: m=128/129 n=1 k=1056 cases (NaN and ERR > 0.0005).

Co-Authored-By: Claude Sonnet 4.6 <redacted>
---------

Co-authored-by: Claude Sonnet 4.6 <redacted>
3 months agoggml-zendnn : add Q8_0 quantization support (llama/23414)
Sachin Sharma [Fri, 22 May 2026 11:16:55 +0000 (16:46 +0530)]
ggml-zendnn : add Q8_0 quantization support (llama/23414)

* ggml-zendnn : add Q8_0 quantization support

* ggml-zendnn : sync with latest ZenDNN

* ggml-zendnn : address review comments for Q8_0