]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/log
pkg/ggml/sources/llama.cpp
3 months agoci : fix s390x release job (#23898)
Georgi Gerganov [Sat, 30 May 2026 06:21:38 +0000 (09:21 +0300)]
ci : fix s390x release job (#23898)

* ci : fix s390x release job

* ci : multi-thread build for `ios-xcode`

* ocd : names

3 months agoci : clear cache instead of "no timestamp" keys + fix macos (#23895)
Georgi Gerganov [Sat, 30 May 2026 05:52:30 +0000 (08:52 +0300)]
ci : clear cache instead of "no timestamp" keys + fix macos (#23895)

* ci : ios use macos-15 again

* ci : add and test ccache-clear

* cont : fix

* cont : set permission

* cont : another permission

* cont : token

* cont : print key

* cont : bring back perms

* cont : test windows

* cont : add token

* cont : cleanup

* ci : make release jobs clean-up their ccache

3 months agollama : do not skip iGPU when only RPC devices are present (#23868)
Radoslav Gerganov [Sat, 30 May 2026 04:48:22 +0000 (07:48 +0300)]
llama : do not skip iGPU when only RPC devices are present (#23868)

After #23007 reclassified integrated CUDA/HIP devices as IGPU, the device
selection logic dropped the local iGPU whenever any RPC server was added,
because RPC devices made `model->devices` non-empty. On systems where the
"iGPU" is the main compute device (e.g. Strix Halo with 128 GiB of unified
memory), this caused all tensors to be allocated on the RPC peer alone and
model loading to fail.

Gate the iGPU inclusion on `gpus.empty()` instead, so RPC peers no longer
suppress the local iGPU.

closes: #23858

3 months agoserver: in SSE mode, send HTTP headers when slot starts (#23884)
Xuan-Son Nguyen [Fri, 29 May 2026 22:06:29 +0000 (00:06 +0200)]
server: in SSE mode, send HTTP headers when slot starts (#23884)

* server: in SSE mode, send HTTP headers when slot starts

* ref to pr

* stream should be false by default

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

3 months agoggml-webgpu: add q4_0/q8_0 SET_ROWS (#23760)
Reese Levine [Fri, 29 May 2026 21:14:11 +0000 (14:14 -0700)]
ggml-webgpu: add q4_0/q8_0 SET_ROWS (#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 agoserver-bench : add speed-bench for speculative decoding benchmarking (#23869)
Ruixiang Wang [Fri, 29 May 2026 21:09:47 +0000 (23:09 +0200)]
server-bench : add speed-bench for speculative decoding benchmarking (#23869)

* spec: add speed-bench support for benchmarking

* speed-bench : add trailing newline to requirements.txt

* speed-bench : bump datasets to 4.8.0 to fix ty check

* server-bench : remove now-unused type: ignore after datasets bump

3 months agoapp: add llama update self updater (#23865)
Pascal [Fri, 29 May 2026 21:02:40 +0000 (23:02 +0200)]
app: add llama update self updater (#23865)

* wip: llama update POC

* cleaning: llama update

* llama-gen-docs

* app: delegate llama update to the install script

* app: spawn the installer detached so llama update can replace a running binary

* cleaning: inline llama update into llama.cpp, drop app-update.{cpp,h}

* app: make llama_update static

Address review from @angt

3 months agoui: handle audio/vnd.wave as audio WAV file (#23754)
ValdikSS [Fri, 29 May 2026 19:41:35 +0000 (22:41 +0300)]
ui: handle audio/vnd.wave as audio WAV file (#23754)

Firefox on Linux uses this MIME type

3 months agovocab : support tokenizer for LFM2.5-8B-A1B (#23826)
Tarek Dakhran [Fri, 29 May 2026 18:25:43 +0000 (20:25 +0200)]
vocab : support tokenizer for LFM2.5-8B-A1B (#23826)

* vocab: Support tokenizer for LFM2.5-8B-A1B

* Keep liquid6 tokenizer in models

3 months agograph : ensure DS32 kq_mask_lid is F32 (#23864)
Sigbjørn Skjæret [Fri, 29 May 2026 17:55:14 +0000 (19:55 +0200)]
graph : ensure DS32 kq_mask_lid is F32 (#23864)

3 months agoserver: remove obsolete scripts (#23870)
Xuan-Son Nguyen [Fri, 29 May 2026 17:47:30 +0000 (19:47 +0200)]
server: remove obsolete scripts (#23870)

3 months agoci : update macos release to use macos-26 runner (#23878)
Georgi Gerganov [Fri, 29 May 2026 17:41:57 +0000 (20:41 +0300)]
ci : update macos release to use macos-26 runner (#23878)

3 months agodownload: add option to skip_download (#23059)
Xuan-Son Nguyen [Fri, 29 May 2026 14:30:55 +0000 (16:30 +0200)]
download: add option to skip_download (#23059)

* download: add option to skip_download

* fix

* fix 2

* if file doesn't exist, respect skip_download flag

3 months agomtmd: Add DeepSeekOCR 2 Support (#20975)
Saba Fallah [Fri, 29 May 2026 14:13:51 +0000 (16:13 +0200)]
mtmd: Add DeepSeekOCR 2 Support (#20975)

* mtmd: DeepSeek-OCR 2 support, with multi-tile dynamic resolution

* introduced clip_image_f32::add_viewsep

* address PR review

- drop redundant ggml_cpy ops in both deepseekocr versions build
- drop no-op ggml_cont in build_sam
- assert num_image_tokens deepseekocr2
- view_seperator as (1, n_embd) at conversion (for both versions)
- drop redundant ggml_reshape_2d

* Update tools/mtmd/models/deepseekocr2.cpp

Co-authored-by: Xuan-Son Nguyen <redacted>
---------

Co-authored-by: Xuan-Son Nguyen <redacted>
3 months agoCUDA: Check PTX version on host side to guard PDL dispatch (#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 (#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 agoserver: bump timeout to 3600s (#23842)
Xuan-Son Nguyen [Fri, 29 May 2026 08:23:17 +0000 (10:23 +0200)]
server: bump timeout to 3600s (#23842)

* server: bump timeout to 3600s

* nits: change wording

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 (#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 agollama: use f16 mask for FA to save VRAM (#23764)
Aman Gupta [Fri, 29 May 2026 07:44:43 +0000 (15:44 +0800)]
llama: use f16 mask for FA to save VRAM (#23764)

* llama: use f16 mask for FA

* review: add llama_cast + formatting

* simplify

3 months agosync : ggml
Georgi Gerganov [Fri, 29 May 2026 06:53:41 +0000 (09:53 +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 agongram-mod : Add missing include (#23857)
Omid Azizi [Fri, 29 May 2026 06:21:37 +0000 (23:21 -0700)]
ngram-mod : Add missing include (#23857)

[no release]

Signed-off-by: Omid Azizi <redacted>
3 months agollama: add llm_graph_input_mtp (#23643)
Aman Gupta [Fri, 29 May 2026 06:17:32 +0000 (14:17 +0800)]
llama: add llm_graph_input_mtp (#23643)

* llama: add llm_graph_input_mtp

* rename input_mtp -> input_token_embd

* add TODO about mtmd embedding

* cont : clean-up

---------

Co-authored-by: Georgi Gerganov <redacted>
3 months agoapp : move licences to llama-app (#23824)
Adrien Gallouët [Fri, 29 May 2026 05:46:11 +0000 (07:46 +0200)]
app : move licences to llama-app (#23824)

Signed-off-by: Adrien Gallouët <redacted>
3 months agocuda : disables launch_fattn PDL enrollment due to compiler bug (#23825)
Andreas Kieslinger [Fri, 29 May 2026 04:46:10 +0000 (06:46 +0200)]
cuda : disables launch_fattn PDL enrollment due to compiler bug (#23825)

3 months agometa : Add missing `buffer` set in allreduce fallback !COMPUTE clear (#23480)
Matt Corallo [Fri, 29 May 2026 03:30:24 +0000 (03:30 +0000)]
meta : Add missing `buffer` set in allreduce fallback !COMPUTE clear (#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 (#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 (#23835)

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

3 months agomtmd-debug: add color and rainbow mode (#23829)
Xuan-Son Nguyen [Thu, 28 May 2026 18:59:14 +0000 (20:59 +0200)]
mtmd-debug: add color and rainbow mode (#23829)

* mtmd-debug: add color and rainbow mode

* fix M_PI

* max_dist

3 months agomtmd: fix gemma 4 projector pre_norm (#23822)
Xuan-Son Nguyen [Thu, 28 May 2026 18:58:55 +0000 (20:58 +0200)]
mtmd: fix gemma 4 projector pre_norm (#23822)

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

* opencl: move backend info print into its own function

* opencl: move new log line

* opencl: fix for non adreno path

3 months agoci : run ui publish on ubuntu-slim (#23818)
Sigbjørn Skjæret [Thu, 28 May 2026 17:58:32 +0000 (19:58 +0200)]
ci : run ui publish on ubuntu-slim (#23818)

* run ui publish on self-hosted fast

* run on ubuntu-slim

3 months agoui: fix audio and video modality detection (#23756)
ValdikSS [Thu, 28 May 2026 15:36:10 +0000 (18:36 +0300)]
ui: fix audio and video modality detection (#23756)

When model props are fetched asynchronously from the server,
modelPropsVersion is incremented to trigger reactivity, but
only the vision effect was listening to it.

3 months agoci : releases use Github-hosted builds for the UI (#23823)
Georgi Gerganov [Thu, 28 May 2026 14:50:32 +0000 (17:50 +0300)]
ci : releases use Github-hosted builds for the UI (#23823)

* ci : releases use Github-hosted builds for the UI

* cont : fix name

3 months agoapp : improve help output (#23805)
Adrien Gallouët [Thu, 28 May 2026 14:45:06 +0000 (16:45 +0200)]
app : improve help output (#23805)

Signed-off-by: Adrien Gallouët <redacted>
3 months agomtmd: n_head_kv defaults to n_head (#23782)
Saba Fallah [Thu, 28 May 2026 14:44:36 +0000 (16:44 +0200)]
mtmd: n_head_kv defaults to n_head (#23782)

removed AI-generated comment

3 months agomtmd: fix gemma 4 audio rms norm eps (#23815)
Xuan-Son Nguyen [Thu, 28 May 2026 14:31:37 +0000 (16:31 +0200)]
mtmd: fix gemma 4 audio rms norm eps (#23815)

* mtmd: fix gemma 4 audio rms norm eps

* Update tools/mtmd/clip.cpp

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

Co-authored-by: Sigbjørn Skjæret <redacted>
3 months agoci : change Vulkan builds to Release to reduce ccache (#23820)
Georgi Gerganov [Thu, 28 May 2026 14:29:11 +0000 (17:29 +0300)]
ci : change Vulkan builds to Release to reduce ccache (#23820)

* ci : disable all CPU variant builds for Vulkan workflow

* cont : change cache key

* cont : change build type

3 months agoarg: Add LLAMA_ARG_API_KEY_FILE environment variable for --api-key-file (#23167)
Mikolaj Kucharski [Thu, 28 May 2026 14:25:40 +0000 (14:25 +0000)]
arg: Add LLAMA_ARG_API_KEY_FILE environment variable for --api-key-file (#23167)

3 months agotest-llama-archs: fix table format [no release] (#23810)
Johannes Gäßler [Thu, 28 May 2026 13:53:54 +0000 (15:53 +0200)]
test-llama-archs: fix table format [no release] (#23810)

3 months agoggml: auto apply iGPU flag CUDA/HIP if integrated device (#23007)
fl0rianr [Thu, 28 May 2026 13:01:14 +0000 (15:01 +0200)]
ggml: auto apply iGPU flag CUDA/HIP if integrated device (#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 (#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 (#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 agoserver: minor tweaks to use more cpp features (#23785)
Funtowicz Morgan [Thu, 28 May 2026 12:00:25 +0000 (14:00 +0200)]
server: minor tweaks to use more cpp features (#23785)

* misc(server): add default port to impl RAII

* misc(server): register_gcp_compat() can be const

* misc(server): use proper cpp const/auto methods

* misc(server): do not reset a unique_ptr, use make_unique instead to be exception safe

3 months agohexagon: minor refresh for HMX FA and MM (#23796)
Max Krasnyansky [Thu, 28 May 2026 11:49:11 +0000 (04:49 -0700)]
hexagon:  minor refresh for HMX FA and MM (#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 (#23687)
Jeff Bolz [Thu, 28 May 2026 11:18:43 +0000 (06:18 -0500)]
vulkan: fast path for walsh-hadamard transform (#23687)

* vulkan: fast path for walsh-hadamard transform

* disable for intel due to segfault

3 months agochat : add Granite 4.1 chat template (#23518)
Jesus Talavera [Thu, 28 May 2026 11:13:33 +0000 (13:13 +0200)]
chat : add Granite 4.1 chat template (#23518)

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

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

3 months agoserver, ui : Add support for HTTP ETags in llama-server (#23701)
Markus Tavenrath [Thu, 28 May 2026 10:21:24 +0000 (20:21 +1000)]
server, ui : Add support for HTTP ETags in llama-server (#23701)

* allow caching of ui elements in llama-server

* use fnv_hash

* Update tools/server/server-http.cpp

etag has to be set always

Co-authored-by: Xuan-Son Nguyen <redacted>
---------

Co-authored-by: Xuan-Son Nguyen <redacted>
3 months agodocker : add ZenDNN Dockerfile (#23716)
Sachin Sharma [Thu, 28 May 2026 09:40:49 +0000 (15:10 +0530)]
docker : add ZenDNN Dockerfile (#23716)

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

Co-authored-by: Stanisław Szymczyk <redacted>
3 months agoperplexity : fix format specifier in LOG_ERR (#23788)
Adrien Gallouët [Thu, 28 May 2026 07:34:58 +0000 (09:34 +0200)]
perplexity : fix format specifier in LOG_ERR (#23788)

Signed-off-by: Adrien Gallouët <redacted>
3 months agoconvert : add FP8 to Q8 conversion (#23250)
ynankani [Thu, 28 May 2026 07:16:17 +0000 (07:16 +0000)]
convert : add FP8 to Q8 conversion (#23250)

Signed-off-by: ynankani <redacted>
3 months agoggml: fixed Arm SVE usage bug in vec.h, vec.cpp (#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 (#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 agoci : refactor (#23789)
Georgi Gerganov [Thu, 28 May 2026 06:44:25 +0000 (09:44 +0300)]
ci : refactor (#23789)

* ci : separate CUDA windows workflow + fix names

* ci : rename workflow

* ci : prefix cache names with workflow name

* ci : rename build.yml -> build-cpu.yml

* ci : cache keys

* ci : fix windows cuda/hip concurrency of release workflow

* ci : fix apple cache names

* ci : add TODOs

* cont : keep just the last cache

* ci : update release concurrency to queue

* ci : move the release trigger to ubuntu-slim

* ci : hip add TODO

* cont : improve words

Co-authored-by: Georgi Gerganov <redacted>
3 months agoHexagon: OP_GATED_DELTA_NET K>1 support (#23531)
ymcki [Thu, 28 May 2026 06:05:25 +0000 (14:05 +0800)]
Hexagon: OP_GATED_DELTA_NET K>1 support (#23531)

* K>1 state snapshot support

* removed picky indent multiple of 4 fixes

3 months agoopencl: OP_GATED_DELTA_NET (#23312)
ymcki [Thu, 28 May 2026 04:23:21 +0000 (12:23 +0800)]
opencl: OP_GATED_DELTA_NET (#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 (#23672)
Reese Levine [Wed, 27 May 2026 21:22:33 +0000 (14:22 -0700)]
ggml-webgpu: remove legacy constants (#23672)

3 months agohexagon: add support for Q4_1 in MUL_MAT and MUL_MAT_ID (#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 (#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 (#23750)
Masashi Yoshimura [Wed, 27 May 2026 16:48:12 +0000 (01:48 +0900)]
ggml-webgpu: Fix how to dispatch WG to some ops (#23750)

3 months agovulkan: Switch MUL_MAT_VEC to 4 K per iteration for F16/32 (#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 (#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 (#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 (#23541)

3 months agovulkan: add REPEAT op support for f16 to f16. (#23298)
l8bloom [Wed, 27 May 2026 14:59:08 +0000 (16:59 +0200)]
vulkan: add REPEAT op support for f16 to f16. (#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 agoci : move ARM jobs to self-hosted + disable kleidiai mac release (#23780)
Georgi Gerganov [Wed, 27 May 2026 14:22:20 +0000 (17:22 +0300)]
ci : move ARM jobs to self-hosted + disable kleidiai mac release (#23780)

* ci : move ARM jobs to 3rd-party runners + disable kleidiai release

* cont : fix deps + fix names

* ocd : fix names

* cont : fix PR links

3 months agovendor : update cpp-httplib to 0.46.0 (#23650)
Alessandro de Oliveira Faria (A.K.A.CABELO) [Wed, 27 May 2026 13:36:24 +0000 (10:36 -0300)]
vendor : update cpp-httplib to 0.46.0 (#23650)

3 months agopyproject : add conversion folder and update dependencies (#23746)
Sigbjørn Skjæret [Wed, 27 May 2026 13:06:18 +0000 (15:06 +0200)]
pyproject : add conversion folder and update dependencies (#23746)

* add conversion folder and update dependencies

* limit python version for triton

* update dev-dependencies section

3 months agoCUDA: restrict PDL to CTK >= 12.3 due to MSVC issues (#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 (#23742)

3 months agoci : bump cuda release to 13.3 (#23749)
Sigbjørn Skjæret [Wed, 27 May 2026 12:06:08 +0000 (14:06 +0200)]
ci : bump cuda release to 13.3 (#23749)

3 months agocommon : fix env names to all have LLAMA_ARG_ prefix (#23778)
Georgi Gerganov [Wed, 27 May 2026 11:52:47 +0000 (14:52 +0300)]
common : fix env names to all have LLAMA_ARG_ prefix (#23778)

3 months agoci : fix windows ccaches (#23777)
Georgi Gerganov [Wed, 27 May 2026 10:54:21 +0000 (13:54 +0300)]
ci : fix windows ccaches (#23777)

* ci : server windows set build type explicitly

* cont : try windows-2025

* ci : use llvm

* cont : use ninja

* cont : fix shell

* ci : set number of jobs correctly

* ci : fix windows with vulkan ccache by using llvm

* ci : server ccache only on master

* ocd : fix job names

[no release]

3 months agoci : remove wasm test (#23733)
Sigbjørn Skjæret [Wed, 27 May 2026 10:11:37 +0000 (12:11 +0200)]
ci : remove wasm test (#23733)

* run tests in correct build folder

* remove wasm test

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

3 months agoci : add ccache to server builds + fix undefined sanitizer build (#23763)
Georgi Gerganov [Wed, 27 May 2026 08:45:12 +0000 (11:45 +0300)]
ci : add ccache to server builds + fix undefined sanitizer build (#23763)

* ci : fix undefined sanitizer build to use Debug build type only

* ci : ccache the server builds

* cont : remove ui dependency + reuse ccache for both ubuntu jobs

* tmp : force ccache save

* Revert "tmp : force ccache save"

This reverts commit a857b03a10b1304d456129a017e0e46b185618ee.

* cont : no need for node.js

3 months agodocs : fix duplicated "the" in granitevision and model-conversion docs (#23767)
quyentonndbs [Wed, 27 May 2026 07:34:06 +0000 (15:34 +0800)]
docs : fix duplicated "the" in granitevision and model-conversion docs (#23767)

Co-authored-by: Kai Tanaka <redacted>
3 months agoconvert: add MiniCPM5 tokenizer support (#23384)
zhangtao2-1 [Wed, 27 May 2026 05:08:33 +0000 (13:08 +0800)]
convert: add MiniCPM5 tokenizer support (#23384)

Add minicpm5 pre-tokenizer hash via convert_hf_to_gguf_update.py and
implement hardcoded regex handling in llama-vocab.cpp, consistent with
other BPE pre-tokenizers.

Co-authored-by: zhangtao <redacted>
3 months agoserver : fix the log message when using SSL (#23393)
Radoslav Gerganov [Wed, 27 May 2026 05:06:30 +0000 (08:06 +0300)]
server : fix the log message when using SSL (#23393)

When llama-server is started with SSL key and cert, the log says that it
listens on http instead of https. This patch fixes this.

3 months agoggml-zendnn : fixed naming of matmul function (#20964)
Vladislav [Tue, 26 May 2026 22:59:35 +0000 (01:59 +0300)]
ggml-zendnn : fixed naming of matmul function (#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 agoci : do not allocate ccache for 3rd-party hosted runners (#23730)
Georgi Gerganov [Tue, 26 May 2026 17:15:01 +0000 (20:15 +0300)]
ci : do not allocate ccache for 3rd-party hosted runners (#23730)

* ci : do not allocate ccache for 3rd-party hosted runners

[no release]

* cont : add prints

[no ci]
[no release]

3 months agoci : move [no release] check to dedicated check_release job (#23734)
Georgi Gerganov [Tue, 26 May 2026 16:49:41 +0000 (19:49 +0300)]
ci : move [no release] check to dedicated check_release job (#23734)

* ci : move [no release] check to dedicated check_release job

Move the workflow-level \`if\` condition that skips builds when the commit
message contains \`[no release]\` into a lightweight \`check_release\` job.
All build jobs now depend on it via \`needs\` and check its output.

This ensures the skip logic is evaluated at the job level rather than at
the workflow level, which is the recommended approach for conditional jobs.

Assisted-by: llama.cpp:local pi
* cont : use `fast` runner

3 months agoci : add `[no release]` keyword + fix sanitizer builds (#23728)
Georgi Gerganov [Tue, 26 May 2026 16:05:48 +0000 (19:05 +0300)]
ci : add `[no release]` keyword + fix sanitizer builds (#23728)

* ci : skip release workflow on master when commit message contains [no release]

Assisted-by: llama.cpp:local pi
* ci : restrict sanitizer builds to x86_64 + fix build type

the spark is apparently too slow for some reason

* tests : fix undefined warning

[no ci]

3 months agoci : move macos jobs to the apple workflow + fix names (#23721)
Georgi Gerganov [Tue, 26 May 2026 13:57:55 +0000 (16:57 +0300)]
ci : move macos jobs to the apple workflow + fix names (#23721)

3 months agovulkan: optimize conv2d and implement coopmat1 support (#22620)
Jeff Bolz [Tue, 26 May 2026 13:48:05 +0000 (08:48 -0500)]
vulkan: optimize conv2d and implement coopmat1 support (#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 agoci : remove vulkan SDK dep from webgpu job (#23718)
Georgi Gerganov [Tue, 26 May 2026 13:40:30 +0000 (16:40 +0300)]
ci : remove vulkan SDK dep from webgpu job (#23718)

* ci : remove vulkan dep from webgpu build

* cont : add ccache to `ubuntu-24-webgpu-wasm`

* ci : fix name + add wasm test

3 months agohexagon: add support for CONCAT op (#23648)
Max Krasnyansky [Tue, 26 May 2026 13:20:05 +0000 (06:20 -0700)]
hexagon: add support for CONCAT op (#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 agoci : move more CPU jobs to self-hosted runners (#23715)
Georgi Gerganov [Tue, 26 May 2026 12:37:40 +0000 (15:37 +0300)]
ci : move more CPU jobs to self-hosted runners (#23715)

3 months agoci : move sanitizer jobs to self-hosted runners (#23713)
Georgi Gerganov [Tue, 26 May 2026 12:22:09 +0000 (15:22 +0300)]
ci : move sanitizer jobs to self-hosted runners (#23713)

3 months agoci : reduce (disable SYCL and CANN builds/releases) (#23705)
Georgi Gerganov [Tue, 26 May 2026 12:21:21 +0000 (15:21 +0300)]
ci : reduce (disable SYCL and CANN builds/releases) (#23705)

* ci : reduce

[no ci]

* cont : disable sycl, cann + rename caches

[no ci]

* cont : cann

[no ci]

3 months agoconvert : support Gemma4ForCausalLM architecture (#23682)
ghleg [Tue, 26 May 2026 05:00:31 +0000 (07:00 +0200)]
convert : support Gemma4ForCausalLM architecture (#23682)

* convert : support Gemma4ForCausalLM architecture (#23674)

* fix indent

---------

Co-authored-by: Oleg Afonin <redacted>
Co-authored-by: Sigbjørn Skjæret <redacted>
3 months agomodels : Attach Mistral3 NVFP4 weight scales (#23629)
Michael Wand [Tue, 26 May 2026 04:59:59 +0000 (00:59 -0400)]
models : Attach Mistral3 NVFP4 weight scales (#23629)

3 months agoSYCL: implement ggml_sycl_pool_vmm (#22862)
Alexey Kopytko [Tue, 26 May 2026 04:59:00 +0000 (13:59 +0900)]
SYCL: implement ggml_sycl_pool_vmm (#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 agotests: test-backend-ops -j <N> to run tests in parallel (#23637)
Jeff Bolz [Tue, 26 May 2026 04:57:56 +0000 (23:57 -0500)]
tests: test-backend-ops -j <N> to run tests in parallel (#23637)

Create a pool of N threads that grab a chunk of up to 100 tests at a time to
iterate through. The number of tests at a time decreases as fewer remain.

Each thread uses its own dev and cpu backend, and set_n_threads_fn is not
called on the cpu backend.

Fix some TSAN issues that arose:
- In init_tensor_uniform, don't use static vector of generators.
- Replace gmtime with versions that don't use a global variable.
- Mutex calls to print_test_result.

3 months agomodel : add support for talkie-1930-13b (#22596)
Niklas Sheth [Tue, 26 May 2026 04:57:38 +0000 (00:57 -0400)]
model : add support for talkie-1930-13b (#22596)

* initial talkie support, coherent

* reorder to follow convention

* absorb inverse rope

* stop folding scalars to improve quantization

* use broadcasting instead of duplication

* style cleanup

* add scaling support to LoraTorchTensor; use that path in conversion

* use layer_out_scale instead of embd_skip_scale

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 (#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 ago[WebGPU] Check batch_compute_passes before sending passes when not doing GPU profilin...
Nikhil Jain [Tue, 26 May 2026 03:32:49 +0000 (20:32 -0700)]
[WebGPU] Check batch_compute_passes before sending passes when not doing GPU profiling (#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 (#23690)
Johannes Gäßler [Tue, 26 May 2026 03:05:51 +0000 (05:05 +0200)]
CUDA: missing PDL sync for FWHT, better fallback (#23690)

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

Co-authored-by: lvyichen <redacted>
3 months agosnapdragon: bump toolchain docker to v0.7 to fix ui build issues (#23680)
Max Krasnyansky [Mon, 25 May 2026 17:57:43 +0000 (10:57 -0700)]
snapdragon: bump toolchain docker to v0.7 to fix ui build issues (#23680)

3 months agoci : reduce PR jobs by matching backend paths (#23675)
Georgi Gerganov [Mon, 25 May 2026 17:54:54 +0000 (20:54 +0300)]
ci : reduce PR jobs by matching backend paths (#23675)

* ci : disable SYCL f16 builds

* ci : extract android and hip into separate workflows

* ci : move webgpu to separate workflow

* ci : move the rpc to a separate workflow

* ci : extract s309x and ppcl jobs

* ci : extract opencl job into a separate workflow

3 months agomodel: tag ffn_latent as MUL_MAT to fix buft probe (#23664)
Pascal [Mon, 25 May 2026 14:05:04 +0000 (16:05 +0200)]
model: tag ffn_latent as MUL_MAT to fix buft probe (#23664)

ffn_latent_down/up are declared GGML_OP_MUL in LLM_TENSOR_INFOS but
nemotron-h feeds them through ggml_mul_mat. The loader buft probe asks
the backend about the declared op, so it tested an elementwise MUL on a
q8_0 weight. That used to return true unconditionally and the weight
stayed on GPU by luck. Once supports_op told the truth, the probe got a
no and the loader pushed the weight and its matmul to CPU, splitting the
graph. Tagging it MUL_MAT asks the real question, the math is unchanged.

Verified on Nemotron 3 Super 120B Q5_K_M: from 64.9 back to 103.22 t/s.

3 months agoCUDA: add fast walsh-hadamard transform (#23615)
Aman Gupta [Mon, 25 May 2026 13:12:10 +0000 (21:12 +0800)]
CUDA: add fast walsh-hadamard transform (#23615)

* CUDA: add fast walsh-hadamard transform

* review: add unrolls + change size_t -> int

* warp size 64

---------

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