]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/log
pkg/ggml/sources/llama.cpp
4 months agovendor : update cpp-httplib to 0.43.1 (#22143)
Alessandro de Oliveira Faria (A.K.A.CABELO) [Tue, 21 Apr 2026 14:45:48 +0000 (11:45 -0300)]
vendor : update cpp-httplib to 0.43.1 (#22143)

* vendor : update cpp-httplib to 0.43.0

* vendor : update cpp-httplib to 0.43.0

4 months agometal : workaround macOS GPU interactivity watchdog (#22216)
Georgi Gerganov [Tue, 21 Apr 2026 14:24:55 +0000 (17:24 +0300)]
metal : workaround macOS GPU interactivity watchdog (#22216)

4 months agovulkan: Support F16 OP_FILL (#22177)
Jeff Bolz [Tue, 21 Apr 2026 09:01:56 +0000 (11:01 +0200)]
vulkan: Support F16 OP_FILL (#22177)

4 months agomtmd: correct mtmd_decode_use_mrope() (#22188)
Xuan-Son Nguyen [Tue, 21 Apr 2026 08:53:37 +0000 (10:53 +0200)]
mtmd: correct mtmd_decode_use_mrope() (#22188)

4 months agollama-ext : fix exports (#22202)
Georgi Gerganov [Tue, 21 Apr 2026 08:04:46 +0000 (11:04 +0300)]
llama-ext : fix exports (#22202)

4 months agosync : ggml
Georgi Gerganov [Tue, 21 Apr 2026 08:03:42 +0000 (11:03 +0300)]
sync : ggml

4 months agoggml : bump version to 0.10.0 (ggml/1463)
Georgi Gerganov [Tue, 21 Apr 2026 08:02:56 +0000 (11:02 +0300)]
ggml : bump version to 0.10.0 (ggml/1463)

4 months agofit-params : refactor + add option to output estimated memory per device (#22171)
Georgi Gerganov [Tue, 21 Apr 2026 06:54:36 +0000 (09:54 +0300)]
fit-params : refactor + add option to output estimated memory per device (#22171)

* fit-params : add option to output estimated memory per device

* cont : minor

* cont : refactor

* cont : move fit params implementation to libcommon

* cont : header

* cont : headers

* cont : codeowners

4 months agoserver : fix hardcoded proxy connection timeout in router mode (#18760) (#22003)
xris99 [Tue, 21 Apr 2026 04:41:14 +0000 (06:41 +0200)]
server : fix hardcoded proxy connection timeout in router mode (#18760) (#22003)

Fixes: https://github.com/ggml-org/llama.cpp/issues/18760
Co-authored-by: Christian <redacted>
4 months agoggml-cuda: flush legacy pool on OOM and retry (#22155)
leonardHONG [Mon, 20 Apr 2026 21:30:38 +0000 (05:30 +0800)]
ggml-cuda: flush legacy pool on OOM and retry (#22155)

* ggml-cuda: flush legacy pool on OOM and retry

Signed-off-by: 梁厚宏 <redacted>
* Address review comments: add explicit sync, update destructor, clean up MUSA macros

Signed-off-by: 梁厚宏 <redacted>
---------

Signed-off-by: 梁厚宏 <redacted>
4 months agomtmd: correct get_n_pos / get_decoder_pos (#22175)
Xuan-Son Nguyen [Mon, 20 Apr 2026 21:29:19 +0000 (23:29 +0200)]
mtmd: correct get_n_pos / get_decoder_pos (#22175)

4 months agoserver : remove /api endpoints (#22165)
Georgi Gerganov [Mon, 20 Apr 2026 17:41:19 +0000 (20:41 +0300)]
server : remove /api endpoints (#22165)

* server : remove /api endpoints

* cont : remove /api/tags

4 months agoTensor-parallel: Fix delayed AllReduce on Gemma-4 MoE (#22129)
Gaurav Garg [Mon, 20 Apr 2026 16:25:39 +0000 (21:55 +0530)]
Tensor-parallel: Fix delayed AllReduce on Gemma-4 MoE (#22129)

* Fix delayed AllReduce on Gemma-4 MoE

Skip forward past nodes that don't consume the current one, and allow a chain of MULs.

* Check for all sources before skipping nodes

* Address review comments

4 months agoTP: fix 0-sized tensor slices, AllReduce fallback (#21808)
Johannes Gäßler [Mon, 20 Apr 2026 16:09:39 +0000 (18:09 +0200)]
TP: fix 0-sized tensor slices, AllReduce fallback (#21808)

* TP: fix 0-sized tensor slices, AllReduce fallback

* fix layer structure <-> GPU count aliasing

* add missing std::fill

* fix CUDA device set, max ggml ctx size

4 months agoggml-cpu: Optimized x86 and generic cpu q1_0 dot (follow up) (#21636)
pl752 [Mon, 20 Apr 2026 16:02:54 +0000 (21:02 +0500)]
ggml-cpu: Optimized x86 and generic cpu q1_0 dot (follow up) (#21636)

* Implemented optimized q1_0 dot for x86 and generic

* Removed redundant helper definition

* Removed two redundant instructions from AVX q1_0 dot

* Fixed inconsistency with fp16 conversion for generic q1_0 dot and deduplicated generic fallback

* Style cleanup around AVX q1_0 dot

* Replaced explicitly unrolled blocks with inner for loop for q1_0

* Replaced scalar ARM q1_0 impl with new generic one

4 months agoggml-webgpu: updated matrix-vector multiplication (#21738)
neha-ha [Mon, 20 Apr 2026 14:37:17 +0000 (07:37 -0700)]
ggml-webgpu: updated matrix-vector multiplication (#21738)

* merged properly, but slow q3_k and q5_k with u32 indexing

* Start on new mat-vec

* New format float paths working

* Working q4_0

* Work on remaining legacy q-types

* port k-quants to new matvec

* remove old shader

* Remove old constants, format

* remove accidental file

---------

Co-authored-by: Neha Abbas <redacted>
Co-authored-by: Reese Levine <redacted>
4 months agomtmd: refactor mtmd_decode_use_mrope (#22161)
Xuan-Son Nguyen [Mon, 20 Apr 2026 12:45:11 +0000 (14:45 +0200)]
mtmd: refactor mtmd_decode_use_mrope (#22161)

4 months agofix: GLM-DSA crash in llama-tokenize when using vocab_only (#22102)
SamareshSingh [Mon, 20 Apr 2026 07:32:46 +0000 (02:32 -0500)]
fix: GLM-DSA crash in llama-tokenize when using vocab_only (#22102)

* llama: fix crash in print_info for GLM-DSA when vocab_only is set

* addressed code review comments

* cont : simplify

---------

Co-authored-by: Georgi Gerganov <redacted>
4 months agoserver : refactor "use checkpoint" logic (#22114)
Georgi Gerganov [Mon, 20 Apr 2026 05:42:37 +0000 (08:42 +0300)]
server : refactor "use checkpoint" logic (#22114)

4 months ago[SYCL] Fix reorder MMVQ assert on unaligned vocab sizes (#22035)
Katostrofik [Mon, 20 Apr 2026 05:39:45 +0000 (01:39 -0400)]
[SYCL] Fix reorder MMVQ assert on unaligned vocab sizes (#22035)

* [SYCL] Fix reorder MMVQ assert on unaligned vocab sizes

The reorder mul_mat_vec_q dispatchers for Q4_0, Q8_0, Q4_K, and Q6_K
asserted that block_num_y was a multiple of 16 subgroups. Models with
a vocab size not divisible by 16 (for example HY-MT at 120818) aborted
on model load when the output projection tripped the assert.

I replaced the assert with padding: block_num_y now rounds up to a
whole number of subgroup-sized workgroups. The kernel already has the
row bounds check (`if (row >= nrows) return;`) so the extra padded
threads early-exit cleanly. Row values are uniform across a subgroup
so the collective reduce stays safe.

For aligned vocab sizes the padded block_num_y equals the old value,
so the kernel launch is identical and there is no regression.

Thanks to @arthw for flagging the relationship to #21527.

Fixes #22020.

AI assisted coding, tested on Intel B70 hardware.

* sycl: use WARP_SIZE for num_subgroups in reorder MMVQ launches

Replaces the hardcoded 16 with WARP_SIZE in the four reorder_mul_mat_vec
launch helpers (Q4_0, Q8_0, Q4_K, Q6_K). Compile-time no-op on the Intel
target where WARP_SIZE is 16, but makes the relationship to subgroup
size explicit. Per review by @NeoZhangJianyu on #22035.

Assisted by Claude.

4 months agoserver: rename --clear-idle to --cache-idle-slots (#21741)
Yes You Can Have Your Own [Mon, 20 Apr 2026 05:30:24 +0000 (08:30 +0300)]
server: rename --clear-idle to --cache-idle-slots (#21741)

4 months agovendor : update cpp-httplib to 0.42.0 (#21781)
Alessandro de Oliveira Faria (A.K.A.CABELO) [Sun, 19 Apr 2026 22:41:43 +0000 (19:41 -0300)]
vendor : update cpp-httplib to 0.42.0 (#21781)

4 months agoCUDA: refactor mma data loading for AMD (#22051)
Johannes Gäßler [Sun, 19 Apr 2026 16:26:59 +0000 (18:26 +0200)]
CUDA: refactor mma data loading for AMD (#22051)

* CUDA: refactor mma data loading for AMD

* fix CDNA MMQ occupancy

* fix CDNA3 mma

* fix RDNA3 compile

4 months agocommon/autoparser : allow space after tool call (#22073)
Aldehir Rojas [Sun, 19 Apr 2026 11:28:35 +0000 (06:28 -0500)]
common/autoparser : allow space after tool call (#22073)

4 months agoHIP: Remove unesscary NCCL_CHECK (#21914)
uvos [Sun, 19 Apr 2026 10:59:44 +0000 (12:59 +0200)]
HIP: Remove unesscary NCCL_CHECK (#21914)

4 months agomtmd: add pos_0 to mtmd_image_tokens_get_decoder_pos (breaking change) (#22082)
Xuan-Son Nguyen [Sun, 19 Apr 2026 09:57:21 +0000 (11:57 +0200)]
mtmd: add pos_0 to mtmd_image_tokens_get_decoder_pos (breaking change) (#22082)

* mtmd: add pos_0 to mtmd_image_tokens_get_decoder_pos

* fix build

4 months agoggml : reduce CPU overhead in meta backend (#22041)
Gaurav Garg [Sun, 19 Apr 2026 09:48:35 +0000 (15:18 +0530)]
ggml : reduce CPU overhead in meta backend (#22041)

* cache subgraph splits when cgraph is unchanged

Skip per-call subgraph construction in ggml_backend_meta_graph_compute when the same ggml_cgraph is used consecutively.

Assign uid to every sub-graph so that CUDA's fast uid check path hits too.

* Address review comments

* Keep the scope as is

* Rename last_uid and last_n_subgraphs field. Remove last_max_tmp_size field. Refactor code.

* Address review comments

* Update ggml/src/ggml-backend-meta.cpp

Co-authored-by: Johannes Gäßler <redacted>
* Update ggml/src/ggml-backend-meta.cpp

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

Co-authored-by: Johannes Gäßler <redacted>
4 months agoci : install spirv-headers for vulkan-cross (#22109)
Sigbjørn Skjæret [Sun, 19 Apr 2026 07:32:08 +0000 (09:32 +0200)]
ci : install spirv-headers for vulkan-cross (#22109)

4 months agoconvert : support sentence-transformer 5.4 config files (#22087)
Dowon [Sun, 19 Apr 2026 07:25:39 +0000 (16:25 +0900)]
convert : support sentence-transformer 5.4 config files (#22087)

* convert : support sentence-transformer 5.4 config files

* fix: embeddinggemma

* fix: mapping

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

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

Co-authored-by: Sigbjørn Skjæret <redacted>
4 months agocmake: remove CMP0194 policy to restore MSVC builds (#21934)
texasich [Sun, 19 Apr 2026 07:25:05 +0000 (02:25 -0500)]
cmake: remove CMP0194 policy to restore MSVC builds (#21934)

#21630 added the CMP0194 NEW policy to silence a CMake warning, but on Windows runners it caused CMake to prefer the MinGW toolchain for ASM and broke MSVC builds.

Reverting only that policy block restores the previous working behavior. The CMake 4.1+ warning comes back, but that is cosmetic and does not break any platform.

Reported-by: oobabooga
Refs: #21630

Co-authored-by: texasich <redacted>
4 months agoserver : speculative checkpointing (#19493)
Sascha Rogmann [Sun, 19 Apr 2026 07:24:06 +0000 (09:24 +0200)]
server : speculative checkpointing (#19493)

* server : speculative decoding using checkpoints

* server : fix draft check with checkpoints

* server : rename spec vars

* server : log levels

* server : refactored spec logic to speculative.cpp

* server : renamed spec checkpoints option

* server : fix spec checkpoints, logging

* speculative : checkpoints with draft model, logging

* server : n_tokens_cur and create_checkpoint in draft

* server : fix server_speculative_callback (slot.id)

* spec : fix ngram-map/begin idx_last_check

* spec : init ckpt (begin() wasn't called)

* chore: update webui build output

* server : restore sampler in spec checkpoint and clear mem

* cont : avoid --spec-use-checkpoints argument

* cont : remove server_prompt_checkpoint_with_size

* spec : rename (leave_draft_state)

* cont : clean-up

* cont : do not ignore partial drafts even if the are short

* cont : spec callback owned by session

* cont : simplify

* cont : avoid empty speculative session

* cont : simplify

* cont : simplify

* cont : enable mtmd speculative decoding

* cont : keep the spec sampler alive

* cont : simplify

* cont : fix nullptr deref + draft checkpoints

* cont : remove common_speculative_accept_response

* cont : remove callback

* cont : simplify

* cont : minor

* cont : simplify

* cont : fix accepted number

---------

Co-authored-by: Georgi Gerganov <redacted>
4 months agorpc : refactor the RPC transport (#21998)
Radoslav Gerganov [Sun, 19 Apr 2026 07:21:53 +0000 (10:21 +0300)]
rpc : refactor the RPC transport (#21998)

* rpc : refactor the RPC transport

Move all transport related code into a separate file and use the
socket_t interface to hide all transport implementation details.

* fix win32

* better socket_t construction

4 months agoserver: Expose `media_tag` on /props endpoint. (#22028)
Cetarthoriphros [Sat, 18 Apr 2026 22:27:17 +0000 (19:27 -0300)]
server: Expose `media_tag` on /props endpoint. (#22028)

4 months agomodel : refactor bias tensor variable names (#22079)
Sigbjørn Skjæret [Sat, 18 Apr 2026 18:12:00 +0000 (20:12 +0200)]
model : refactor bias tensor variable names (#22079)

* refactor bias tensor variable names

* use create_tensor_qkv for jina-bert-v2

4 months agoandroid : libcommon -> libllama-common (#22076)
Sigbjørn Skjæret [Sat, 18 Apr 2026 09:19:40 +0000 (11:19 +0200)]
android : libcommon -> libllama-common (#22076)

4 months agoggml-backend-meta: add multi-segment read support in get_tensor (#22063)
SamareshSingh [Sat, 18 Apr 2026 08:04:51 +0000 (03:04 -0500)]
ggml-backend-meta: add multi-segment read support in get_tensor (#22063)

4 months agoci : free disk space for rocm release (#22012)
Sigbjørn Skjæret [Sat, 18 Apr 2026 07:37:30 +0000 (09:37 +0200)]
ci : free disk space for rocm release (#22012)

4 months agoconvert : fix (ignore for now) typings errors (#22002)
Sigbjørn Skjæret [Sat, 18 Apr 2026 07:36:41 +0000 (09:36 +0200)]
convert : fix (ignore for now) typings errors (#22002)

4 months agollama: fit ctx size for CPU only (#21568)
Johannes Gäßler [Sat, 18 Apr 2026 06:16:04 +0000 (08:16 +0200)]
llama: fit ctx size for CPU only (#21568)

4 months agoggml-webgpu: fix compiler warnings and refactor FlashAttention encoding (#21052)
Reese Levine [Fri, 17 Apr 2026 16:17:11 +0000 (09:17 -0700)]
ggml-webgpu: fix compiler warnings and refactor FlashAttention encoding (#21052)

* Update workflows to remove dependence on llvmpipe

* Try setting Dawn_DIR

* remove c++20 initializers

* Move to proper guid

* Try avoiding segfaults on vulkan backend process exit

* Remove compiler warnings on parameter casting

* Fix soft_max and update reg_tile accumulation to f32 for better precision

* Refactor flash_attn a bit

* remove c++20 initializers and format

* Increase div precision for NVIDIA

* revert div precision and comment out ggml-ci node for now

* Formatting

* Try debugging on a failing CI node

* Revert "Try debugging on a failing CI node"

This reverts commit 1971e33cba919915e12bcfd5828abfbd54ca942e.

4 months agoCUDA: use LRU based eviction for cuda graphs (#21611)
Aman Gupta [Fri, 17 Apr 2026 15:24:21 +0000 (23:24 +0800)]
CUDA: use LRU based eviction for cuda graphs (#21611)

* CUDA: use a ring-buffer for cuda graphs

* bump limit to 128

* use LRU eviction

* better naming

* do periodic clean-up

4 months agoci : add android arm64 build and release (#21647)
Yuri Khrustalev [Fri, 17 Apr 2026 09:32:24 +0000 (05:32 -0400)]
ci : add android arm64 build and release (#21647)

* server: respect the ignore eos flag

* ci: add android arm64 build and release

* patch

* pin android-setup actions to v4

* Apply suggestions from code review

Co-authored-by: Sigbjørn Skjæret <redacted>
* lf in the suggestion

---------

Co-authored-by: Sigbjørn Skjæret <redacted>
4 months agomtmd: add missing struct tag (#22023)
65a [Fri, 17 Apr 2026 08:48:33 +0000 (01:48 -0700)]
mtmd: add missing struct tag (#22023)

4 months agolibs : rename libcommon -> libllama-common (#21936)
Georgi Gerganov [Fri, 17 Apr 2026 08:11:46 +0000 (11:11 +0300)]
libs : rename libcommon -> libllama-common (#21936)

* cmake : allow libcommon to be shared

* cmake : rename libcommon to libllama-common

* cont : set -fPIC for httplib

* cont : export all symbols

* cont : fix build_info exports

* libs : add libllama-common-base

* log : add common_log_get_verbosity_thold()

4 months agomodel : Gemma4 model type detection (#22027)
Eric Zhang [Fri, 17 Apr 2026 08:07:11 +0000 (16:07 +0800)]
model : Gemma4 model type detection (#22027)

* model : Gemma4 model type detection

* model : Gemma4 model type detection

4 months agoopencl: refactor q8_0 set_tensor and mul_mat host side dispatch for Adreno (#21938)
lhez [Fri, 17 Apr 2026 05:28:33 +0000 (22:28 -0700)]
opencl: refactor q8_0 set_tensor and mul_mat host side dispatch for Adreno (#21938)

* opencl: refactor q8_0 gemm/gemv Adreno dispatch

* opencl: refactor q8_0 set_tensor

* opencl: fix whitespace

4 months agocli : use get_media_marker (#22017)
Sigbjørn Skjæret [Thu, 16 Apr 2026 22:12:31 +0000 (00:12 +0200)]
cli : use get_media_marker (#22017)

4 months agocmake: use glob to collect src/models sources (#22005)
Xuan-Son Nguyen [Thu, 16 Apr 2026 21:25:16 +0000 (23:25 +0200)]
cmake: use glob to collect src/models sources (#22005)

4 months agohexagon: optimize HMX matmul operations (#21071)
nullname [Thu, 16 Apr 2026 20:48:34 +0000 (04:48 +0800)]
hexagon: optimize HMX matmul operations (#21071)

* optimize hmx_mat_mul functions by calculating row and column tiles upfront

* refactor core_dot_chunk_fp16 to use size_t for tile counts and improve readability

* wip

* set scale outside of loop

* wip

* refactor core_mma_chunk_fp16 and mat_mul_qk_0_d16a32 to use size_t for tile counts

* wip

* wip

* refactor transfer_output_chunk_fp16_to_fp32 to use size_t for dimensions

* refactor core_dot_chunk_fp16 to use size_t for tile row stride calculation

* wip

* refactor hmx_mat_mul functions to use hvx_vec_splat_f16 for column scales initialization

* refactor hmx_mat_mul_permuted_w16a32_batched to streamline scale setting and locking

* refactor core_dot_chunk_fp16 to improve tile stride calculations for output

* refactor hmx_mat_mul functions to use Q6_V_vsplat_R for column scales initialization

* fix compiling error

* wip

* optimize row and column tile indexing in core_mma_chunk_fp16 function

* wip

* Revert "wip"

This reverts commit cde679eff79c4a28dd2d89d32f710015e09592b6.

* Add size limit check for HAP_mmap in htp_iface_mmap and drop_mmap functions

* wip

4 months agomodel: using single llm_build per arch (#21970)
Xuan-Son Nguyen [Thu, 16 Apr 2026 19:10:22 +0000 (21:10 +0200)]
model: using single llm_build per arch (#21970)

* model: using single llm_build per arch

* fix merge

* nits

4 months agoopencl: add q5_K gemm and gemv kernels for Adreno (#21595)
shaofeiqi [Thu, 16 Apr 2026 19:08:33 +0000 (12:08 -0700)]
opencl: add q5_K gemm and gemv kernels for Adreno (#21595)

4 months agoserver: tests: fetch random media marker via /apply-template (#21962) (#21980)
Pascal [Thu, 16 Apr 2026 17:46:21 +0000 (19:46 +0200)]
server: tests: fetch random media marker via /apply-template (#21962) (#21980)

* server: tests: fetch random media marker via /apply-template (#21962 fix)

* server: allow pinning media marker via LLAMA_MEDIA_MARKER env var

get_media_marker() checks LLAMA_MEDIA_MARKER at first call and uses it
as-is if set, falling back to the random marker otherwise.

Tests no longer need to fetch the marker dynamically via /apply-template:
the fixture sets LLAMA_MEDIA_MARKER=<__media__> so the hardcoded prompts
work as before.

Address review feedback from ngxson

* server: make get_media_marker() thread-safe via magic statics

Use a C++11 static local with a lambda initializer instead of a global
static with an empty-check. The runtime guarantees initialization exactly
once without explicit locking.

Address review feedback from ggerganov

* nits

* nits

4 months agomodel : refactor QKV into common build_qkv and create_tensor_qkv helpers (#21245)
PikaPikachu [Thu, 16 Apr 2026 15:41:34 +0000 (23:41 +0800)]
model : refactor QKV into common build_qkv and create_tensor_qkv helpers (#21245)

* model : refactor QKV into common build_qkv and create_tensor_qkv helpers

* model : extend build_qkv to bert/mpt/dbrx/olmo/lfm2/nemotron-h/granite-hybrid/gemma3n-iswa/t5-dec and fix wqkv_s

4 months agomodel : support NVFP4 tensors for Gemma4 (#21971)
Sigbjørn Skjæret [Thu, 16 Apr 2026 14:51:47 +0000 (16:51 +0200)]
model : support NVFP4 tensors for Gemma4 (#21971)

* support nvfp4 tensors for Gemma4

* add wo_s to build_attn

* add wo_s to build_attn

* fix glm4

4 months agocodeowners: add team member comments (#21714)
Ruben Ortlam [Thu, 16 Apr 2026 10:13:11 +0000 (12:13 +0200)]
codeowners: add team member comments (#21714)

4 months agoConvert: Fix NemotronH Config Parsing (#21664)
Anav Prasad [Thu, 16 Apr 2026 10:11:45 +0000 (10:11 +0000)]
Convert: Fix NemotronH Config Parsing (#21664)

* fix NemotronH vocab loading by using trust_remote_code for unsupported config patterns

* fix NemotronH tokenizer loading by overriding set_vocab with trust_remote_code

4 months agoggml: add graph_reused (#21764)
Aman Gupta [Thu, 16 Apr 2026 09:21:28 +0000 (17:21 +0800)]
ggml: add graph_reused (#21764)

* ggml: add graph_reused

* use versioning instead of reuse flag

* increment version with atomic

* use top bits for split numbering

* add assert

* move counter to ggml.c

* set uid in split_graph only

* fix windows

* address further review comments

* get next_uid rather than doing bit manipulation

* rename + add comment about uid

4 months agometal: Implement ROLL op (#21946)
Kusha Gharahi [Thu, 16 Apr 2026 08:54:37 +0000 (03:54 -0500)]
metal: Implement ROLL op (#21946)

* nix: support unified apple-sdk

* Impl roll op for Metal

* Revert "nix: support unified apple-sdk"

This reverts commit abfa473360471532c547de8b202c780507924d4b.

* update ops.md

* update op docs

4 months agoggml-cpu: add 128-bit RVV implementation for Quantization Vector Dot (#20633)
rehan-10xengineer [Thu, 16 Apr 2026 08:15:15 +0000 (13:15 +0500)]
ggml-cpu: add 128-bit RVV implementation for Quantization Vector Dot (#20633)

* ggml-cpu: add 128-bit impls for i-quants, ternary quants

* ggml-cpu: add 128-bit impls for iq2_xs, iq3_s, iq3_xxs, tq2_0

Co-authored-by: Rehan Qasim <redacted>
* ggml-cpu: refactor; add rvv checks

---------

Co-authored-by: taimur-10x <redacted>
Co-authored-by: Rehan Qasim <redacted>
4 months agoggml : implemented simd_gemm kernel for riscv vector extension (#20627)
rehan-10xengineer [Thu, 16 Apr 2026 08:14:26 +0000 (13:14 +0500)]
ggml : implemented simd_gemm kernel for riscv vector extension (#20627)

Co-authored-by: Rehan Qasim <redacted>
4 months agodevops : added spirv-headers to nix (#21965)
Yuannan [Thu, 16 Apr 2026 08:12:52 +0000 (08:12 +0000)]
devops : added spirv-headers to nix (#21965)

4 months agoggml-webgpu: compute pass batching and removing profiling overhead (#21873)
Reese Levine [Thu, 16 Apr 2026 08:12:19 +0000 (01:12 -0700)]
ggml-webgpu: compute pass batching and removing profiling overhead (#21873)

* Update register tiling matmul to use f32 accumulation

* fix profiling code

* Fix register tiling matmul for chrome, i'm blaming dawn

* Update batch tuning value for iOS

* compile fix

* Fix use of new load function

* Move to a single query set for GPU profiling

* Move to batching compute passes when not profiling

* Refactor build_multi

* remove iOS throttling now that we're batching compute passes

4 months agoci : Use ggml-org/ccache-action on RISC-V as well (#21632)
Ludovic Henry [Thu, 16 Apr 2026 08:11:25 +0000 (10:11 +0200)]
ci : Use ggml-org/ccache-action on RISC-V as well (#21632)

4 months ago[SYCL] Fix Q8_0 reorder: garbage on 2nd prompt + crash on full VRAM (#21638)
Katostrofik [Thu, 16 Apr 2026 05:34:05 +0000 (01:34 -0400)]
[SYCL] Fix Q8_0 reorder: garbage on 2nd prompt + crash on full VRAM (#21638)

* [SYCL] Fix Q8_0 reorder: add missing dequantize path for GEMM

The Q8_0 reorder optimization (#21527) was missing a reorder-aware
dequantizer for the GEMM code path used during prompt processing.
After token generation reordered Q8_0 weights (via DMMV/MMVQ), the
next prompt processing pass would read them with the standard
dequantizer, producing garbage output.

Add dequantize_block_q8_0_reorder() and wire it into both
ggml_get_to_fp16_sycl() and ggml_get_to_fp32_sycl(), matching the
pattern already used by Q4_0, Q4_K, and Q6_K.

Fixes #21589

AI (Claude) was used to assist with root cause investigation and
writing the kernel code. All code was human-reviewed and tested
on real hardware.

* SYCL: fix reorder crash when device memory is full

The reorder optimization allocates a temporary buffer the full size of
the weight tensor on the device. When VRAM is nearly full (large models
on a single GPU), this allocation fails and the subsequent memcpy crashes
on a NULL pointer.

Fix: try device allocation first, fall back to host memory if device
memory is full. The reorder kernel still works correctly reading from
host memory over PCIe. This is slower for the one-time reorder (~21 t/s
vs ~38 t/s on Intel Arc Pro B70), but the optimization is preserved for
all subsequent inference. If both device and host allocation fail, skip
the reorder and fall back to the unoptimized kernel path.

Also fixes a bug where opt_for_reorder() marked tensors as reordered
even when the reorder was skipped due to allocation failure. This caused
DMMV/MMVQ kernels to read the original AoS data as if it were SoA,
producing garbage output or NaN results.

Tested on Intel Arc Pro B70 (32GB) with Q8_0, Q4_K_M models. Coding was
AI-assisted (Claude), reviewed and tested on hardware by a human.

Fixes #20478

* SYCL: add RAII temp buffer class + macro guard for host fallback

Replace sycl_ext_malloc_with_fallback/sycl_ext_free_fallback free
functions with sycl_reorder_temp_buffer RAII class. The host_fallback
bool is now a private member, and cleanup happens automatically at
scope exit.

Add GGML_SYCL_HOST_MEM_FALLBACK cmake option (default ON) to guard
the host memory fallback code path. Device access to host memory
requires Linux kernel 6.8+ (Ubuntu 26.04+); users on older kernels
can set -DGGML_SYCL_HOST_MEM_FALLBACK=OFF to disable it.

Addresses arthw's review on PR #21638.

Co-Authored-By: Claude Opus 4.6 (1M context) <redacted>
* SYCL: document GGML_SYCL_HOST_MEM_FALLBACK build option in SYCL.md

Co-Authored-By: Claude Opus 4.6 (1M context) <redacted>
* SYCL: add reorder-aware DMMV dequantizers for Q4_K and Q6_K

Q4_K and Q6_K had reorder support for MMVQ and GEMM paths but not
DMMV. When the DMMV path encountered reordered data it would abort.

Add DMMV kernels that read from the SOA reorder layout for both
types. Same math as the non-reorder versions, different memory
access pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <redacted>
---------

Co-authored-by: Claude Opus 4.6 (1M context) <redacted>
4 months agoserver: use random media marker (#21962)
Xuan-Son Nguyen [Wed, 15 Apr 2026 21:52:22 +0000 (23:52 +0200)]
server: use random media marker (#21962)

* server: use random media marker

* nits

* remove legacy <__image__> token

* revert special char in random

4 months agovulkan: optimize im2col (#21713)
Ruben Ortlam [Wed, 15 Apr 2026 17:04:51 +0000 (19:04 +0200)]
vulkan: optimize im2col (#21713)

* vulkan: improve im2col memory write layout

* cap workgroups

* minimal device tuning

* use vendor_id instead of subgroup size

4 months agocuda: Q1_0 initial backend (#21629)
Pasha Khosravi [Wed, 15 Apr 2026 16:38:38 +0000 (09:38 -0700)]
cuda: Q1_0 initial backend (#21629)

* [cuda] initial Q1_0 backend

* remove unused code, fix AMD MMA guard

* attempt to support dp4a

* Apply suggestions from code review

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

Co-authored-by: Johannes Gäßler <redacted>
4 months agoggml-webgpu: Fix dequantization helpers to not pass in pointers (#21872)
Reese Levine [Wed, 15 Apr 2026 16:14:40 +0000 (09:14 -0700)]
ggml-webgpu: Fix dequantization helpers to not pass in pointers (#21872)

* Fix dequantization helpers to not pass in pointers

* Increase XIELU precision

4 months agoCUDA: require explicit opt-in for P2P access (#21910)
Johannes Gäßler [Wed, 15 Apr 2026 14:01:46 +0000 (16:01 +0200)]
CUDA: require explicit opt-in for P2P access (#21910)

4 months agoCUDA: manage NCCL communicators in context (#21891)
Johannes Gäßler [Wed, 15 Apr 2026 13:58:40 +0000 (15:58 +0200)]
CUDA: manage NCCL communicators in context (#21891)

* CUDA: manage NCCL communicators in context

* add check that all backends are CUDA

* remove unused vector, limit init to > 1 GPUs

* fix warnings

* fix cuda device, cache allreduce

4 months agorpc : add native RDMA transport for RPC backend (RoCEv2) (#20590)
Valeriy Dubov [Wed, 15 Apr 2026 13:44:02 +0000 (16:44 +0300)]
rpc : add native RDMA transport for RPC backend (RoCEv2) (#20590)

4 months agodocs: more extensive RoPE documentation [no ci] (#21953)
Xuan-Son Nguyen [Wed, 15 Apr 2026 12:45:16 +0000 (14:45 +0200)]
docs: more extensive RoPE documentation [no ci] (#21953)

* more extensive ggml_rope documentation

* add more docs

* nits

4 months agoci: disable test-backend-ops on Vulkan llvmpipe run and resture default timeout ...
Ruben Ortlam [Wed, 15 Apr 2026 08:55:21 +0000 (10:55 +0200)]
ci: disable test-backend-ops on Vulkan llvmpipe run and resture default timeout (#21901)

4 months agoautoparser: support case of JSON_NATIVE with per-call markers (test case: Reka-Edge...
Piotr Wilkin (ilintar) [Wed, 15 Apr 2026 08:51:50 +0000 (10:51 +0200)]
autoparser: support case of JSON_NATIVE with per-call markers (test case: Reka-Edge) (#21892)

4 months agoread n_ctx back after making llama_context (#21939)
Matt [Wed, 15 Apr 2026 07:24:57 +0000 (00:24 -0700)]
read n_ctx back after making llama_context (#21939)

4 months agohexagon: optimization for HMX mat_mul (#21554)
Yiwei Shao [Tue, 14 Apr 2026 21:09:03 +0000 (14:09 -0700)]
hexagon: optimization for HMX mat_mul (#21554)

* hexagon: add async HMX worker

Introduce hmx-worker (dedicated thread for HMX compute) to overlap HMX
matmul with HVX dequant/DMA stages in the pipeline path, replacing the
previous synchronous HMX calls that blocked the main thread.

* hexagon: cost-based VTCM chunk search for out-stationary matmul

* hexagon: fix futex race in hmx_worker_drain
Store the boolean to local variable avoid atomic load twice

* hex-mm: hmx optimize scatter/transpose and use HMX intrinsics

* hex-vmem: drop vmem limit a touch under 3GB on v73

* hexagon: add fwd declaration of htp_context

* hex-hmx: replace hmx-worker with hmx-queue that mimics dma-queue interface

Simplifies the overall implemantion, reduces thread wakeup roundtrips.

* hex-mm: add debug log to hmx work func called from hmx-queue

* Update hmx-queue.h

Co-authored-by: Max Krasnyansky <redacted>
---------

Co-authored-by: Kim-Chyan Gan <redacted>
Co-authored-by: Max Krasnyansky <redacted>
Co-authored-by: Max Krasnyansky <redacted>
4 months agoggml : remove ggml-ext.h (#21869)
Xuan-Son Nguyen [Tue, 14 Apr 2026 14:32:58 +0000 (16:32 +0200)]
ggml : remove ggml-ext.h (#21869)

* ggml: correct placement of ggml-ext.h

* ggml : remove ggml-ext.h

---------

Co-authored-by: Georgi Gerganov <redacted>
4 months agometal : fix FA support logic (#21898)
Georgi Gerganov [Tue, 14 Apr 2026 14:32:29 +0000 (17:32 +0300)]
metal : fix FA support logic (#21898)

4 months agomtmd: add mtmd_image_tokens_get_decoder_pos() API (#21851)
Xuan-Son Nguyen [Tue, 14 Apr 2026 14:07:41 +0000 (16:07 +0200)]
mtmd: add mtmd_image_tokens_get_decoder_pos() API (#21851)

* mtmd: add mtmd_image_tokens_get_decoder_pos() API

* consistent naming

* fix build

4 months agovulkan: Programmatically add RoundingModeRTE to all shaders when the device supports...
Jeff Bolz [Tue, 14 Apr 2026 13:17:45 +0000 (15:17 +0200)]
vulkan: Programmatically add RoundingModeRTE to all shaders when the device supports it (#21572)

* vulkan: Programmatically add RoundingModeRTE to all shaders when the device supports it

* use FetchContent to get SPIRV-Headers

* Fetch spirv-headers unconditionally

* remove fetchcontent, rely on installed headers

* fix ubuntu job

* Update docs/build.md

4 months agoci : re-enable mac workflows (#21894)
Georgi Gerganov [Tue, 14 Apr 2026 12:58:09 +0000 (15:58 +0300)]
ci : re-enable mac workflows (#21894)

* ci : re-enable mac workflows

* vulkan : fix compile warning

4 months agometal : add XIELU unary op (#20802)
Seyoung Jeong [Tue, 14 Apr 2026 12:43:59 +0000 (21:43 +0900)]
metal : add XIELU unary op (#20802)

4 months agovendor : update BoringSSL to 0.20260413.0 (#21881)
Adrien Gallouët [Tue, 14 Apr 2026 11:25:09 +0000 (13:25 +0200)]
vendor : update BoringSSL to 0.20260413.0 (#21881)

Signed-off-by: Adrien Gallouët <redacted>
4 months agoggml : fix ARM NEON nvfp4 dot product on non-dotprod targets (#21559)
Richard Davison [Tue, 14 Apr 2026 11:23:45 +0000 (13:23 +0200)]
ggml : fix ARM NEON nvfp4 dot product on non-dotprod targets (#21559)

4 months agocmake: fix CMP0194 warning on Windows with MSVC (#21630)
texasich [Tue, 14 Apr 2026 10:47:56 +0000 (05:47 -0500)]
cmake: fix CMP0194 warning on Windows with MSVC (#21630)

* cmake: fix CMP0194 warning on Windows with MSVC

Set CMP0194 policy to NEW before project() call in ggml/CMakeLists.txt to suppress the "MSVC is not an assembler for language ASM" warning introduced in CMake 4.1.

The ggml project enables ASM globally for Metal (macOS) and KleidiAI (ARM) backends. On Windows/MSVC, no assembler sources are used, but CMake 4.1+ warns because cl.exe is not a valid ASM compiler.

This follows the same pattern used in ggml-vulkan (CMP0114, CMP0147).

Closes ggml-org/llama.cpp#20311

* cmake: apply cisc's formatting suggestion

---------

Co-authored-by: texasich <redacted>
4 months agoggml-webgpu: Update register tiling matmul to use f32 accumulation (#21644)
Reese Levine [Tue, 14 Apr 2026 10:46:41 +0000 (03:46 -0700)]
ggml-webgpu: Update register tiling matmul to use f32 accumulation (#21644)

* Update register tiling matmul to use f32 accumulation

* fix profiling code

* Fix register tiling matmul for chrome, i'm blaming dawn

* Update batch tuning value for iOS

* compile fix

* Fix use of new load function

4 months agocommon: skip reasoning budget sampler when no budget is requested (#21870)
Berk Idem [Tue, 14 Apr 2026 10:43:06 +0000 (06:43 -0400)]
common: skip reasoning budget sampler when no budget is requested (#21870)

* common: skip reasoning budget sampler when no budget is requested

After I added thinking_start_tag / thinking_end_tag for gemma4 in #21697, the reasoning budget sampler gets unconditionally created even when no budget is configured (the default -1). The same applies to kimi_k2, lfm2, lfm2_5, and ministral_3 which also set these tags. The budget gets converted to INT_MAX, so the sampler never actually forces any tokens but still runs per-token checks (start tag matching in IDLE state, token-to-piece conversion + UTF-8 checks in COUNTING state).

More importantly, the mere existence of the sampler (non-null rbudget) disables backend sampling. Backend sampling lets the GPU select tokens directly, avoiding a full logits transfer from GPU to CPU every token. This could explain the 30% speed regression reported in #21784 (98 t/s to 70 t/s on Vulkan).

So I added a reasoning_budget_tokens >= 0 check to the sampler creation condition. When the budget is unlimited, the sampler is not created, backend sampling stays enabled, and no per-token overhead is added. When a budget is explicitly set (0, 128, 1024, etc.), the sampler is created and works as before.

* common: preserve rbudget when grammar is lazy

Following up on the review feedback on #21870: keep the reasoning budget sampler when grammar_lazy is true, so the thinking-block grammar suppression from #20970 still works when tools are in use. This way, we only skip the sampler when both no budget is set AND grammar is not lazy.

4 months agovulkan: Support GGML_TYPE_NVFP4 (#21455)
Jeff Bolz [Tue, 14 Apr 2026 09:34:23 +0000 (11:34 +0200)]
vulkan: Support GGML_TYPE_NVFP4 (#21455)

This adds nvfp4 support for get_rows, dequant, and mul_mat(_id). For
mul_mat, it does not add support for the dp4/q8_1 path, it's all via
fp16/fp32.

4 months agoserver: support OAI /v1/audio/transcriptions API (#21863)
Xuan-Son Nguyen [Tue, 14 Apr 2026 09:09:52 +0000 (11:09 +0200)]
server: support OAI /v1/audio/transcriptions API (#21863)

* server: support OAI /v1/audio/transcriptions API

* address autoreview comments

* correct default response_format value

4 months agocommon/gemma4 : handle parsing edge cases (#21760)
Aldehir Rojas [Mon, 13 Apr 2026 23:18:18 +0000 (18:18 -0500)]
common/gemma4 : handle parsing edge cases (#21760)

4 months agodocs: listing qwen3-asr and qwen3-omni as supported (#21857)
Xuan-Son Nguyen [Mon, 13 Apr 2026 20:28:17 +0000 (22:28 +0200)]
docs: listing qwen3-asr and qwen3-omni as supported (#21857)

* docs: listing qwen3-asr and qwen3-omni as supported

* nits

4 months agochat: dedicated DeepSeek v3.2 parser + "official" template (#21785)
Piotr Wilkin (ilintar) [Mon, 13 Apr 2026 20:23:53 +0000 (22:23 +0200)]
chat: dedicated DeepSeek v3.2 parser + "official" template (#21785)

4 months agoci: Also exempt 'security' tag from auto-close (#21844)
Christian Kastner [Mon, 13 Apr 2026 17:18:44 +0000 (19:18 +0200)]
ci: Also exempt 'security' tag from auto-close (#21844)

4 months agovulkan: Flash Attention DP4A shader for quantized KV cache (#20797)
Ruben Ortlam [Mon, 13 Apr 2026 12:21:31 +0000 (14:21 +0200)]
vulkan: Flash Attention DP4A shader for quantized KV cache (#20797)

* use integer dot product for quantized KV flash attention

* small improvements

* fix SHMEM_STAGING indexing

* add missing KV type quants

* fixes

* add supported quants to FA tests

* readd fast paths for <8bit quants

* fix mmq gate and shmem checks

4 months agocommon : add download cancellation and temp file cleanup (#21813)
Adrien Gallouët [Mon, 13 Apr 2026 09:18:23 +0000 (11:18 +0200)]
common : add download cancellation and temp file cleanup (#21813)

Signed-off-by: Adrien Gallouët <redacted>
4 months agoserver: Expose build_info in router mode (#21835)
Gaspard Petit [Mon, 13 Apr 2026 09:14:42 +0000 (05:14 -0400)]
server: Expose build_info in router mode (#21835)

4 months agoCUDA: Limit DeviceSegmentedSort to immediate mode (#21718)
Oliver Simons [Mon, 13 Apr 2026 09:14:06 +0000 (11:14 +0200)]
CUDA: Limit DeviceSegmentedSort to immediate mode (#21718)

* CUDA: Limit DeviceSegmentedSort to immediate mode

DeviceSegmentedSort is currently not capturable in a cuda graph. Hence,
we have to go for the slower DeviceSegmentedRadixSort in that case.

Perf numbers on RTX Pro 6000 Blackwell Max-Q:
DeviceSegmentedRadixSort in graph mode (i.e. CUDA Graphs)

  ARGSORT(type=f32,ne=[2048,512,1,1],order=1):                 12291 runs -   105.94 us/run -     8192 kB/run -   73.75 GB/s
  ARGSORT(type=f32,ne=[4096,512,1,1],order=1):                 10245 runs -   115.08 us/run -    16384 kB/run -  135.77 GB/s
  ARGSORT(type=f32,ne=[8192,512,1,1],order=1):                  5125 runs -   221.22 us/run -    32768 kB/run -  141.26 GB/s
  ARGSORT(type=f32,ne=[16384,512,1,1],order=1):                 2565 runs -   430.98 us/run -    65536 kB/run -  145.02 GB/s
  ARGSORT(type=f32,ne=[32768,512,1,1],order=1):                 1028 runs -  1185.83 us/run -   131072 kB/run -  105.41 GB/s
  ARGSORT(type=f32,ne=[65536,512,1,1],order=1):                  387 runs -  2748.62 us/run -   262144 kB/run -   90.95 GB/s

DeviceSegmentedSort in immediate mode

  ARGSORT(type=f32,ne=[2048,512,1,1],order=1):                 16388 runs -    71.17 us/run -     8192 kB/run -  109.78 GB/s
  ARGSORT(type=f32,ne=[4096,512,1,1],order=1):                 12294 runs -    81.38 us/run -    16384 kB/run -  192.00 GB/s
  ARGSORT(type=f32,ne=[8192,512,1,1],order=1):                  5125 runs -   240.81 us/run -    32768 kB/run -  129.77 GB/s
  ARGSORT(type=f32,ne=[16384,512,1,1],order=1):                 2565 runs -   406.60 us/run -    65536 kB/run -  153.71 GB/s
  ARGSORT(type=f32,ne=[32768,512,1,1],order=1):                 1285 runs -   873.23 us/run -   131072 kB/run -  143.15 GB/s
  ARGSORT(type=f32,ne=[65536,512,1,1],order=1):                  516 runs -  2288.46 us/run -   262144 kB/run -  109.24 GB/s

* Add test case for dispatch to DeviceSegmentedRadixSort

We currently lack a way to force graph mode in CUDA, patch callback to
invoke ggml_backend_compare_graph_backend twice to enforce each test to
run in graph mode

4 months agomtmd: use causal attn for gemma 4 audio (#21824)
Xuan-Son Nguyen [Mon, 13 Apr 2026 07:47:55 +0000 (09:47 +0200)]
mtmd: use causal attn for gemma 4 audio (#21824)

4 months agowebui: add setting for first-line chat titles (#21797)
Rohan Jain [Mon, 13 Apr 2026 07:30:46 +0000 (13:00 +0530)]
webui: add setting for first-line chat titles (#21797)

* webui: add setting for first-line chat titles

Add an opt-in setting (`titleGenerationUseFirstLine`) to use the first
non-empty line of a prompt as the generated conversation title.

Previously, the complete multi-line prompt was being used, which created
long titles for complex queries. Coupled with
"Ask for confirmation before changing conversation title", the dialog
would overflow.

* Update tools/server/webui/src/lib/utils/text.ts

Co-authored-by: Aleksander Grygier <redacted>
* Update tools/server/webui/src/lib/utils/text.ts

Co-authored-by: Aleksander Grygier <redacted>
* webui: Run build to update the bundle

As requested in:
https://github.com/ggml-org/llama.cpp/pull/21797#pullrequestreview-4094935065

* webui: Fix missing import for NEWLINE_SEPARATOR

---------

Co-authored-by: Aleksander Grygier <redacted>
4 months agowebui: MCP Diagnostics improvements (#21803)
Aleksander Grygier [Mon, 13 Apr 2026 05:58:38 +0000 (07:58 +0200)]
webui: MCP Diagnostics improvements (#21803)

* Add MCP Connection diagnostics and CORS hint to web-ui

* tidy up test

* webui: Refactor and improve MCP diagnostic logging

---------

Co-authored-by: evalstate <redacted>