]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/log
pkg/ggml/sources/llama.cpp
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>
3 months agoui: fix stop/continue during an agentic loop (#23356)
Pascal [Mon, 25 May 2026 12:18:59 +0000 (14:18 +0200)]
ui: fix stop/continue during an agentic loop (#23356)

3 months agoconvert : add compressed-tensors NVFP4 support (#21095)
Michael Wand [Mon, 25 May 2026 12:16:11 +0000 (08:16 -0400)]
convert : add compressed-tensors NVFP4 support  (#21095)

* Refactored Compressed Tensors NVFP4 support for new base.py

* Support compressed-tensors NVFP4 conversion

* Moved Qwen MTP remap into filter_tensors

* simplify

* pathlib no longer used

---------

Co-authored-by: Sigbjørn Skjæret <redacted>
3 months agosync : ggml
Georgi Gerganov [Mon, 25 May 2026 09:42:28 +0000 (12:42 +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 agosync : ggml
Georgi Gerganov [Mon, 25 May 2026 09:33:22 +0000 (12:33 +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.h: correct ggml_silu_back arg docstring (a=dy, b=x) (ggml/1500)
Ori Pekelman [Thu, 21 May 2026 12:00:16 +0000 (12:00 +0000)]
ggml.h: correct ggml_silu_back arg docstring (a=dy, b=x) (ggml/1500)

3 months agoggml-alloc: fix out-of-bounds read in ggml_dyn_tallocr_remove_block (ggml/1492)
Dev-X25874 [Thu, 21 May 2026 11:58:08 +0000 (17:28 +0530)]
ggml-alloc: fix out-of-bounds read in ggml_dyn_tallocr_remove_block (ggml/1492)

3 months agoTP: fix ggml context size calculation (#22616)
Johannes Gäßler [Mon, 25 May 2026 09:37:25 +0000 (11:37 +0200)]
TP: fix ggml context size calculation (#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` (#22341)
Gilad S. [Mon, 25 May 2026 09:33:29 +0000 (11:33 +0200)]
ggml: `gguf_init_from_callback` and `gguf_init_from_buffer` (#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 agoserver: MTP layer kv-cache should respect draft type ctk (#23646)
Aman Gupta [Mon, 25 May 2026 08:46:23 +0000 (16:46 +0800)]
server: MTP layer kv-cache should respect draft type ctk (#23646)

3 months agoci : update spacemit toolchain url and enhance curl command (#23642)
alex-spacemit [Mon, 25 May 2026 08:43:24 +0000 (16:43 +0800)]
ci : update spacemit toolchain url and enhance curl command (#23642)

* fix(action): update SpacemiT toolchain URL and version

Change-Id: If4cc1c738a855274103f8c3ad52daa33528acd0c

* fix(action): add -L flag to curl command for URL redirection

Change-Id: I9b6c37390f0c7a733a36308c8fb53d22d234ab06

3 months agoci : fix pre-tokenizer-hashes check (#23651)
Sigbjørn Skjæret [Mon, 25 May 2026 08:41:25 +0000 (10:41 +0200)]
ci : fix pre-tokenizer-hashes check (#23651)

3 months agollama : document that only one on-device state can be saved per sequence (#23520)
Tim Neumann [Mon, 25 May 2026 07:29:28 +0000 (09:29 +0200)]
llama : document that only one on-device state can be saved per sequence (#23520)

3 months agoci : install host compiler on android-ndk build (#23630)
Aldehir Rojas [Mon, 25 May 2026 07:18:08 +0000 (03:18 -0400)]
ci : install host compiler on android-ndk build (#23630)

3 months agoggml : Parallelize quant LUT init (#23595)
Jeff Bolz [Mon, 25 May 2026 07:15:46 +0000 (02:15 -0500)]
ggml : Parallelize quant LUT init (#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 agoui: media attachments before text (#23467)
Saba Fallah [Mon, 25 May 2026 06:50:41 +0000 (08:50 +0200)]
ui: media attachments before text (#23467)

* ui: media attachments before text

* fix prettier formatting

3 months agovendor : update cpp-httplib to 0.45.1 (#23639)
Alessandro de Oliveira Faria (A.K.A.CABELO) [Mon, 25 May 2026 06:45:22 +0000 (03:45 -0300)]
vendor : update cpp-httplib to 0.45.1 (#23639)

3 months agoserver: fix checkpoints creation (#22929)
jacekpoplawski [Mon, 25 May 2026 05:56:18 +0000 (07:56 +0200)]
server: fix checkpoints creation (#22929)

* common : add common_chat_split_by_role

* cont : fix spans to reach end of message

* server: fix checkpoints creation

- extract message_spans from chat templates
- find the prompt token position before the latest user message
- split prompt batching at that position
- create a context checkpoint before the latest user input
- avoid periodic mid-prompt checkpoints when that position is known
- handle multimodal prompts when mapping text/template positions to server prompt tokens
- add --checkpoint-min-step to control minimum spacing between checkpoints

* cont : clean-up

* Support autoparser detection for message barriers

* server: fix message span delimiter and update docs

---------

Co-authored-by: Alde Rojas <redacted>
Co-authored-by: Georgi Gerganov <redacted>
Co-authored-by: Piotr Wilkin <redacted>
3 months agoperplexity : fix even more integer overflows (#23623)
fairydreaming [Mon, 25 May 2026 05:12:39 +0000 (07:12 +0200)]
perplexity : fix even more integer overflows (#23623)

Co-authored-by: Stanisław Szymczyk <redacted>
3 months agoci : move most slim jobs to self-hosted runners (#23619)
Georgi Gerganov [Mon, 25 May 2026 05:11:19 +0000 (08:11 +0300)]
ci : move most slim jobs to self-hosted runners (#23619)

* ci : remove tag from build-self-hosted.yml

* ci : slim -> self-hosted

* ci : prevent heavy CPU jobs from running on fast runners

* ci : prevent cmake pkg to run on dedicated fast runners

* ci : try to bump 3.11 -> 3.13

* ci : move lint back to 3.11

* ci : back to 3.11

* ci : add comment about UI jobs

* ci : move python requirements check to CPU runners

this job is a bit slow for a dedicated "fast" runner

* ci : add self-hosted ui workflow

* ci : fix UI naming

* tmp to check if arm64 fast is compatible with all jobs

* revert last commit

3 months agoci : update build-self-hosted.yml (#23616)
Georgi Gerganov [Sun, 24 May 2026 15:20:10 +0000 (18:20 +0300)]
ci : update build-self-hosted.yml (#23616)

3 months agoconvert : minor fixes for numpy 2.x (#23571)
Sigbjørn Skjæret [Sun, 24 May 2026 07:51:31 +0000 (09:51 +0200)]
convert : minor fixes for numpy 2.x (#23571)

3 months agocmake : fix ui build (#23592)
Aldehir Rojas [Sun, 24 May 2026 07:37:28 +0000 (03:37 -0400)]
cmake : fix ui build (#23592)

* cmake/ui : add -fPIC to llama-ui static lib

* cmake : rename host compiled embed helper

3 months agoserver: add margin for draft model for `fit` (#23485)
Aman Gupta [Sun, 24 May 2026 06:43:08 +0000 (14:43 +0800)]
server: add margin for draft model for `fit` (#23485)

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

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

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

3 months agosnapdragon: update windows toolchain to use hsdk v6.6.0.0 (#23552)
Aparna M P [Sun, 24 May 2026 02:56:41 +0000 (08:26 +0530)]
snapdragon: update windows toolchain to use hsdk v6.6.0.0 (#23552)

3 months agocmake/ui : refactor the build (#23352)
Aldehir Rojas [Sat, 23 May 2026 21:08:22 +0000 (17:08 -0400)]
cmake/ui : refactor the build (#23352)

3 months agorequirements : bump torch to 2.11.0 (#23503)
Aditya Singh [Sat, 23 May 2026 16:24:39 +0000 (09:24 -0700)]
requirements : bump torch to 2.11.0 (#23503)

* requirements: relax torch~=2.6.0 to torch>=2.6.0 for convert_hf_to_gguf

The ~=2.6.0 operator resolves to >=2.6.0, <2.7.0, which fails on
PyPI for platform/CPython combinations where 2.6.x is not present.
The accompanying comment already says 'PyTorch 2.6.0 or later', so
the looser >=2.6.0 matches the documented intent and unblocks
pip install -r requirements/requirements-convert_hf_to_gguf.txt.

Fixes #23408

* requirements: bump torch floor to 2.11.0 per maintainer

* requirements: pin torch to ==2.11.0 per project policy

* requirements: pin mtmd torch and torchvision to 2.11.0/0.26.0 per project policy

* requirements: suppress check_requirements pin warning on mtmd

The check_requirements script flags '==' on lines in files matched by
*/**/requirements*.txt. Append the documented suppression comment to the
pinned torch and torchvision lines (and to the s390x platform marker lines)
so the check passes while keeping the pins required by project policy.

* ty: silence Tensor/Module union check on model[0].auto_model

With torch 2.11.0 stubs, nn.Sequential.__getitem__ now returns
Tensor | Module rather than Module, so model[0].auto_model fails ty
on the SentenceTransformer code path. The runtime behavior is
unchanged because SentenceTransformer always wraps a Module at
index 0. Adding a targeted unresolved-attribute ignore keeps the
type-check green without altering behavior. A follow-up issue
tracks typing the variable explicitly.

3 months agomodel : add NVFP4 MTP scale tensors (#23563)
Michael Wand [Sat, 23 May 2026 11:30:31 +0000 (07:30 -0400)]
model : add NVFP4 MTP scale tensors (#23563)

* Add NVFP4 MTP scale tensors

* Link Qwen3.5 MTP tensors

* Aligned nullptr

3 months agoggml : Check the right iface method before using the fallback 2d get (#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 (#23514)

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

* vulkan: fix windows find_package of SPIRV-Headers

* not windows-only

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

3 months agoserver: only parse empty msg if continuing an assistant msg (#23506)
Aldehir Rojas [Fri, 22 May 2026 15:58:15 +0000 (11:58 -0400)]
server: only parse empty msg if continuing an assistant msg (#23506)

3 months agoperplexity : fix integer overflow (#23496)
fairydreaming [Fri, 22 May 2026 12:50:44 +0000 (14:50 +0200)]
perplexity : fix integer overflow (#23496)

Co-authored-by: Stanisław Szymczyk <redacted>
3 months agoSYCL: improve MoE prefill throughput (#23142)
Alexey Kopytko [Fri, 22 May 2026 12:50:17 +0000 (21:50 +0900)]
SYCL: improve MoE prefill throughput (#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 (#23097)
Alexey Kopytko [Fri, 22 May 2026 12:49:45 +0000 (21:49 +0900)]
sycl : Level Zero detection in ggml_sycl_init (#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 (#23174)
karavayev [Fri, 22 May 2026 12:48:56 +0000 (08:48 -0400)]
SYCL : gated_delta_net K>1 (#23174)

* sycl_gated_delta_net K>1

* editor_config

3 months agoSYCL: add BF16 to DMMV kernel path (~4x tg speedup on Intel Arc) (#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) (#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 agodocs: Update documentation with Granite 4.0/4.1 (#23404)
Jesus Talavera [Fri, 22 May 2026 12:35:46 +0000 (14:35 +0200)]
docs: Update documentation with Granite 4.0/4.1 (#23404)

3 months agoggml-zendnn : add Q8_0 quantization support (#23414)
Sachin Sharma [Fri, 22 May 2026 11:16:55 +0000 (16:46 +0530)]
ggml-zendnn : add Q8_0 quantization support (#23414)

* ggml-zendnn : add Q8_0 quantization support

* ggml-zendnn : sync with latest ZenDNN

* ggml-zendnn : address review comments for Q8_0

3 months agocmake : build router app only during standalone builds (#23521)
fairydreaming [Fri, 22 May 2026 09:55:29 +0000 (11:55 +0200)]
cmake : build router app only during standalone builds (#23521)

Co-authored-by: Stanisław Szymczyk <redacted>
3 months agovocab : fix HybridDNA tokenizer (#23466)
Kashif Rasul [Fri, 22 May 2026 09:17:31 +0000 (11:17 +0200)]
vocab : fix HybridDNA tokenizer (#23466)

* vocab : mark hybriddna k-mers to avoid BPE token collisions

* improved loop

---------

Co-authored-by: Sigbjørn Skjæret <redacted>
3 months agocmake : add install() for impl libraries + fix apple builds (#23511)
Georgi Gerganov [Fri, 22 May 2026 08:46:26 +0000 (11:46 +0300)]
cmake : add install() for impl libraries + fix apple builds (#23511)

* pi : update

* ci : fix ios build

* ci : fix andoroid

* ci : fix apple builds

* cmake : add install() for impl libraries

Add install(TARGETS <target> LIBRARY) for all -impl libraries that were
changed from STATIC to shared (controlled by BUILD_SHARED_LIBS) in
commit bb28c1fe2. Without this, cmake --install fails to copy the shared
libraries, causing runtime errors like:

  llama-server: error while loading shared libraries: libllama-server-impl.so

Ref: https://github.com/ggml-org/llama.cpp/issues/23494#issuecomment-4512912515

Assisted-by: llama.cpp:local pi
* ci : fix xcframework build

3 months agoCUDA: fix PDL CC check for JIT compilation (#23471)
Johannes Gäßler [Thu, 21 May 2026 21:35:29 +0000 (23:35 +0200)]
CUDA: fix PDL CC check for JIT compilation (#23471)

3 months agocmake : remove STATIC from impl libraries, enable LLAMA_BUILD_APP by default (#23462)
Georgi Gerganov [Thu, 21 May 2026 18:13:59 +0000 (21:13 +0300)]
cmake : remove STATIC from impl libraries, enable LLAMA_BUILD_APP by default (#23462)

* cmake : remove STATIC from impl libraries, allow BUILD_SHARED_LIBS control

Remove explicit STATIC from all -impl libraries (server, cli, completion, bench,
batched-bench, fit-params, quantize, perplexity) so BUILD_SHARED_LIBS controls
shared vs static linkage.

Add WINDOWS_EXPORT_ALL_SYMBOLS ON for proper DLL export on Windows.

Assisted-by: llama.cpp:local pi
* cmake : enable LLAMA_BUILD_APP by default

Assisted-by: llama.cpp:local pi
* ci : disable app in build-cmake-pkg.yml

3 months agoUpdate WebGPU support and add link to blog/demo (#23483)
Reese Levine [Thu, 21 May 2026 18:00:27 +0000 (11:00 -0700)]
Update WebGPU support and add link to blog/demo (#23483)

3 months agovulkan: fuse snake activation (mul, sin, sqr, mul, add) (#22855)
Pascal [Thu, 21 May 2026 17:39:42 +0000 (19:39 +0200)]
vulkan: fuse snake activation (mul, sin, sqr, mul, add) (#22855)

* vulkan: fuse snake activation (mul, sin, sqr, mul, add)

Add snake.comp shader with F32 / F16 / BF16 pipelines and
ggml_vk_snake_dispatch_fused. The matcher recognizes the naive 5 op
decomposition emitted by audio decoders (BigVGAN, Vocos) for snake
activation y = x + sin(a*x)^2 * inv_b and rewrites it to a single
elementwise kernel.

test_snake_fuse from the CUDA PR now also compares CPU naive vs
Vulkan fused across F32 / F16 / BF16.

* vulkan: address jeffbolznv review for fused snake activation

Rename T / C to ne0 / ne1 in the shader and push constants to match
the standard naming convention used across the Vulkan backend.

Tighten ggml_vk_can_fuse_snake: require x and dst to be contiguous
(the shader uses idx = i0 + i1 * ne0) and require a / inv_b to be
tightly packed on the broadcast dim (the shader reads data_a[i1]).

* vulkan: tighten snake fusion type checks for all operands (address jeffbolznv review)

* vulkan: reject snake fusion when ne[2] or ne[3] > 1 (address jeffbolznv review)

* vulkan: address 0cc4m review for fused snake activation

snake.comp is renamed to follow the ggml DATA_A_* / A_TYPE convention.
A_TYPE now applies to the activation tensor data_a instead of the
broadcast multiplier, and the bindings become data_a (A_TYPE), data_b
(float), data_c (float) and data_d (D_TYPE). A header at the top of
the shader maps each buffer to its role in y = x + sin(b * x)^2 * c.

On the C++ side, ggml_vk_can_fuse_snake reuses the existing snake_pattern
constant instead of duplicating the op list, sin_node is extracted as a
named local alongside the other chain nodes, and the broadcast operands
a and inv_b are now required to be GGML_TYPE_F32 to match the hardcoded
float bindings on data_b and data_c (the previous a->type == x->type
would silently reject any future BF16 or F16 chain once the supports_op
gate for SIN / SQR is lifted). ggml_vk_snake_dispatch_fused gets an
explicit GGML_TYPE_F32 case and GGML_ABORT on default in place of the
silent f32 fallback, and a stale comment about data_a[i1] / data_inv_b[i1]
is refreshed to match the new binding names.

3 months agofix(flash-attn): replace f32 with kv_type and q_type (#23372)
Chen Yuan [Thu, 21 May 2026 14:58:49 +0000 (10:58 -0400)]
fix(flash-attn): replace f32 with kv_type and q_type (#23372)

3 months agotests : move save-load-state from examples to tests (#23336)
Georgi Gerganov [Thu, 21 May 2026 11:41:50 +0000 (14:41 +0300)]
tests : move save-load-state from examples to tests (#23336)

* tests : move save-load-state from examples to tests

- Move examples/save-load-state/ to tests/test-save-load-state.cpp
- Remove subdirectory reference from examples/CMakeLists.txt
- Add test to tests/CMakeLists.txt as a model test
- Remove CODEOWNERS entry for removed example directory

Assisted-by: llama.cpp:local pi
* cont : update ci

3 months agoserver: expose prompt token counts in /slots endpoint (#23454)
ScrewTSW [Thu, 21 May 2026 11:29:13 +0000 (13:29 +0200)]
server: expose prompt token counts in /slots endpoint (#23454)

Add n_prompt_tokens, n_prompt_tokens_processed, and n_prompt_tokens_cache
to the /slots JSON response. These fields are already tracked internally
but were not exposed, making it impossible for clients to monitor prompt
evaluation progress during processing.

3 months agometal : optimize concat kernel and fix set kernel threads (#23411)
Georgi Gerganov [Thu, 21 May 2026 10:34:08 +0000 (13:34 +0300)]
metal : optimize concat kernel and fix set kernel threads (#23411)

* metal : fix GGML_OP_SET kernel threads

* tests : extend test_cpy to support different src/dst shapes

Extend test_cpy to support different source and destination tensor shapes
for CPY operations (reshaping), where the total number of elements must match.

- Renamed ne -> ne_src, added ne_dst parameter (default: use src shape)
- Added 50 new reshaping test cases covering 1D<->2D<->3D<->4D conversions
- Tests exercise 1024 boundary, small shapes, and large dimensionality changes
- Fixed dangling reference bug (storing & to temporary std::array)
- Updated all existing test calls with permute/transpose args for compatibility

Assisted-by: llama.cpp:local pi
* metal : optimize concat kernel with row batching for small widths

When ne0 < 256, batch multiple rows into a single threadgroup to improve
occupancy. This avoids underutilizing the GPU when processing narrow tensors.

- Dispatch nth = min(256, ne0) threads per group
- Calculate nrptg (rows per threadgroup) to fill up to 256 threads
- Update kernel index calculation to handle the row batching
- Add boundary check for i1 >= ne1

Assisted-by: llama.cpp:local pi
* tests : clean-up

* tests : refactor CPY shape tests to use dimension permutations

Replace 75 hardcoded test cases with a loop over permutations of
{3, 5, 7, 32} (total elements: 3360). Each src permutation is tested
against canonical sorted and reverse dst, skipping identical shapes.
Covers F32, F16, and Q4_0 (when both src and dst ne0 == 32).

Assisted-by: llama.cpp:local pi
3 months agoserver : free draft/MTP resources on sleep to fix VRAM leak (#23461)
Aman Gupta [Thu, 21 May 2026 08:11:11 +0000 (16:11 +0800)]
server : free draft/MTP resources on sleep to fix VRAM leak (#23461)

The destroy() function in server_context_impl only cleaned up the main
model and context (via llama_init.reset()) but did not free the speculative
decoder (spec), draft context (ctx_dft), or draft model (model_dft).

For MTP (Multi-Token Prediction) models, ctx_dft holds GPU-allocated
resources (KV cache, compute buffers) that are not freed when entering
the sleeping state. On each sleep/resume cycle, new resources are
allocated without the old ones being freed, leading to a VRAM leak
that eventually crashes the server with out-of-memory errors.

Fix by explicitly resetting spec, ctx_dft, and model_dft in destroy()
before resetting llama_init, ensuring proper cleanup order to avoid
use-after-free.

ref: https://github.com/ggml-org/llama.cpp/issues/23395

Assisted-by: llama.cpp:local pi
3 months agoserver: re-inject subcommand when router spawns children under unified binary (#23442)
Pascal [Thu, 21 May 2026 08:09:19 +0000 (10:09 +0200)]
server: re-inject subcommand when router spawns children under unified binary (#23442)

3 months agoapp : add batched-bench, fit-params, quantize & perplexity (#23459)
Adrien Gallouët [Thu, 21 May 2026 07:29:44 +0000 (09:29 +0200)]
app : add batched-bench, fit-params, quantize & perplexity (#23459)

* app : add batched-bench, fit-params, quantize & perplexity

Signed-off-by: Adrien Gallouët <redacted>
* Add missing main.cpp

Signed-off-by: Adrien Gallouët <redacted>
* Add EOL

Signed-off-by: Adrien Gallouët <redacted>
---------

Signed-off-by: Adrien Gallouët <redacted>
3 months agomtp: use inp_out_ids for skipping logit computation (#23433)
Aman Gupta [Thu, 21 May 2026 07:23:14 +0000 (15:23 +0800)]
mtp: use inp_out_ids for skipping logit computation (#23433)

when doing a follow-up decode for the draft model, we were always doing the logit computation even though it is not required.

3 months agovocab : add Carbon-3B (HybridDNATokenizer) support (#23410)
Kashif Rasul [Thu, 21 May 2026 06:34:32 +0000 (08:34 +0200)]
vocab : add Carbon-3B (HybridDNATokenizer) support (#23410)

* vocab : add Carbon-3B (HybridDNATokenizer) support

Adds a new BPE pre-type LLAMA_VOCAB_PRE_TYPE_CARBON for the
HybridDNATokenizer used by HuggingFaceBio/Carbon-{500M,3B,8B}.
The base BPE is Qwen3-4B-Base's; what differs is that text inside
<dna>...</dna> regions is chunked into fixed 6-mers (right-padded
with 'A' on the trailing partial), and any base outside ACGT maps
to <oov>.

* src/llama-vocab.{h,cpp}: new pre-type, dispatched from
  llm_tokenizer_bpe_session::tokenize.
* src/llama-vocab-carbon.h: pure helpers (tokenize_carbon,
  emit_dna_kmers) factored out for unit testing — no llama_vocab
  dependency, vocab access goes through a std::function.
* conversion/base.py: detect HybridDNATokenizer by class name in
  get_vocab_base_pre (chktxt collides with Qwen3 base since it
  has no <dna>), and pass trust_remote_code=True in get_vocab_base
  so the custom tokenizer class can load.
* tests/test-tokenizer-carbon.cpp: 12 cases covering single 6-mer,
  multi 6-mer, lowercase, invalid base -> <oov>, partial k-mer
  right-pad, mixed text+DNA, empty <dna></dna>, unterminated <dna>,
  two regions, vocab miss.

* vocab : align Carbon-3B changes with llama.cpp conventions

* Fold tokenize_carbon + emit_dna_kmers inline into
  llm_tokenizer_bpe_session (drop src/llama-vocab-carbon.h),
  matching how every other tokenizer keeps its helpers inside
  llama-vocab.cpp.

* Replace the standalone unit test with the conventional
  test-tokenizer-0 row backed by models/ggml-vocab-carbon.gguf
  (vocab-only conversion) + .inp/.out fixtures covering single
  6-mer, multi 6-mer, lowercase, invalid base -> <oov>, partial
  right-pad, mixed text+DNA, empty <dna></dna>, unterminated <dna>,
  two regions.

* Register "carbon" in convert_hf_to_gguf_update.py's model list
  (pointing at HuggingFaceBio/Carbon-3B) and teach both
  AutoTokenizer call sites in the updater to pass
  trust_remote_code=True for it, matching how t5 is special-cased.

* vocab : move Carbon dispatch to _set_vocab_carbon + LlamaModel branch

Refactor the conversion-side changes to follow the per-tokenizer-family
convention used by _set_vocab_qwen, _set_vocab_interns1, _set_vocab_glm,
etc. instead of conditionalising the shared get_vocab_base /
get_vocab_base_pre paths.

* conversion/base.py: add _set_vocab_carbon — self-contained, loads
  with trust_remote_code=True so HybridDNATokenizer's merged Qwen3 + DNA
  vocab is visible, writes tokenizer.ggml.pre = "carbon" directly.
* conversion/llama.py: branch in LlamaModel.set_vocab on
  tokenizer_config.json["tokenizer_class"] == "HybridDNATokenizer" and
  dispatch to _set_vocab_carbon. Same precedent as conversion/bert.py
  (tokenizer_class branch between BertTokenizer / RobertaTokenizer) and
  conversion/phi.py.
* conversion/base.py: revert the conditional in get_vocab_base and the
  class-name short-circuit in the auto-generated get_vocab_base_pre.

* tests : expand ggml-vocab-carbon.gguf fixtures with model-card examples

Add 6 cases from the Carbon-3B model card on top of the existing edge
coverage: the unterminated basic-completion prompt, the closed 33-bp
example, the metadata-conditioned prompt (with <vertebrate_mammalian>
and <protein_coding_region> which BPE-decompose since they are not in
the vocab), the documented anti-pattern of raw DNA without <dna> tags,
and the two likelihood-scoring examples. Brings the suite to 19 cases.

* vocab : promote HybridDNATokenizer to its own LLAMA_VOCAB_TYPE

Refactor per upstream review:

> This should be its own tokenizer model, ie. carbonhybriddna instead
> of gpt2 and not carbon pre-tokenizer. That way you can keep the
> correct pre-tokenizer, in case that ever changes.

Previously the tokenizer was modelled as LLAMA_VOCAB_TYPE_BPE plus a
new LLAMA_VOCAB_PRE_TYPE_CARBON, which (a) put a CARBON-specific
branch inside llm_tokenizer_bpe_session::tokenize (only existing
pre-types differ in regex, not dispatch logic), and (b) conflated
"hybrid DNA tokenization" with "Qwen3 BPE pre-tokenizer".

This change moves it to its own vocab type, peer to PLAMO2, with the
GGUF model name matching the HF tokenizer class (HybridDNATokenizer):

* include/llama.h: new LLAMA_VOCAB_TYPE_HYBRIDDNA = 7.
* src/llama-vocab.cpp: new llm_tokenizer_hybriddna + session that
  owns std::unique_ptr<llm_tokenizer_bpe> for non-<dna> text and
  routes raw text through a DNA-aware splitter; wired into
  init_tokenizer, tokenize, type_name, byte_to_token, and the
  BPE-style token_to_piece case (DNA k-mers + <dna>/</dna>/<oov>
  are pure ASCII, so byte-level BPE decoding handles them).
  LLAMA_VOCAB_TYPE_HYBRIDDNA gets its own branch in the vocab-type
  config block alongside SPM/WPM/UGM/RWKV, where pre_type is set
  to QWEN2 and the matching add_space_prefix / escape_whitespaces /
  clean_spaces flags are applied — mirroring qwen2's BPE path so
  byte-level BPE merging stays bit-identical to the Python
  reference for non-DNA text.
* src/llama-vocab.h: drop the short-lived LLAMA_VOCAB_PRE_TYPE_CARBON.
* conversion/base.py: _set_vocab_hybriddna writes
  tokenizer.ggml.model = "hybriddna" (no separate pre).
* conversion/llama.py: dispatch on tokenizer_class ==
  "HybridDNATokenizer" same as bert.py / phi.py do.
* models/ggml-vocab-hybriddna.gguf{,.inp,.out}: renamed fixture +
  regenerated metadata.
* convert_hf_to_gguf_update.py: drop the stale chkhsh entry and
  trust_remote_code special-case (no longer needed since dispatch
  is now class-name driven, not chkhsh).

Verified end-to-end against HuggingFaceBio/Carbon-{500M,3B,8B}:
tokenization is bit-identical to the Python HybridDNATokenizer for
all 19 test fixtures plus the model-card metadata-conditioned
prompt; greedy completion produces the same DNA continuation as
the Python reference; spec-dec with 500M as draft for 8B still
works.

* vocab : relax llm_tokenizer_bpe assert to allow HYBRIDDNA

* vocab : drop llm_tokenizer_bpe vocab-type assert

* vocab : write tokenizer.ggml.pre for HYBRIDDNA, share BPE dispatch

* vocab : assert BPE or HYBRIDDNA in llm_tokenizer_bpe

* vocab : annotate #endif with PRETOKENIZERDEBUG

* vocab : drop local hybriddna fixture (moves to ggml-org/vocabs)

* deduplicate

* simplify

* simplify

---------

Co-authored-by: Sigbjørn Skjæret <redacted>
3 months agodoc: fix spec mtp typo (#23435)
Ruixiang Wang [Thu, 21 May 2026 06:30:55 +0000 (08:30 +0200)]
doc: fix spec mtp typo (#23435)

3 months agoui: Improve Git Hooks for UI development (#23403)
Aleksander Grygier [Thu, 21 May 2026 06:27:50 +0000 (08:27 +0200)]
ui: Improve Git Hooks for UI development (#23403)

* refactor: Improve Git Hooks for UI development

* fix: Address review comments

* fix: Use absolute git path for `/hooks`

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

Co-authored-by: Pascal <redacted>
3 months agoggml : Check the right iface method before using the fallback 2d get (#23306)
Matt Corallo [Thu, 21 May 2026 06:24:40 +0000 (06:24 +0000)]
ggml : Check the right iface method before using the fallback 2d get (#23306)

Probably no backends implement only one of 2d get/set, but this
might be annoying for some future backend developer trying to add
2d get/set.

3 months agollama-graph: fix null-buffer crash in llm_graph_input_attn_kv_iswa for SWA-only model...
Daniel Elliott [Thu, 21 May 2026 06:20:51 +0000 (23:20 -0700)]
llama-graph: fix null-buffer crash in llm_graph_input_attn_kv_iswa for SWA-only models (#23131)

When a model has zero non-SWA attention layers (e.g. a SWA-only slice of Gemma 4),
the base KV cache has no layer tensors. The input tensors (self_k_idxs, self_v_idxs,
self_kq_mask) are created as graph input nodes but never consumed by any compute node,
so the backend scheduler never allocates a buffer for them. Calling
mctx->get_base()->set_input_k_idxs() on an unallocated tensor then hits
GGML_ASSERT(buffer) at ggml-backend.cpp:194.

The same scenario applies symmetrically: if a model had zero SWA layers, the SWA
tensors would be unallocated.

Fix: guard both the base and SWA set_input calls with null/buffer checks, matching
the pattern already used by llm_graph_input_mem_hybrid_iswa::set_input (line ~674)
which has the comment: 'base tensors may not be allocated if there are no non-SWA
attention layers'.

Also fix can_reuse() in the same class to skip the ne[0] and kq_mask checks for
unallocated tensors, preventing a null-dereference on the reuse path.

3 months agohexagon: ssm-conv fix for large prompts (#23307)
Todor Boinovski [Thu, 21 May 2026 05:14:13 +0000 (22:14 -0700)]
hexagon: ssm-conv fix for large prompts (#23307)

* hexagon: remove gathers and better handling of vtcm in ssm-conv

* hexagon: relax ssm-conv gating requirements

* hexagon: add new prefill ssm-conv backend test

* hexagon: remove trailing white space

* hex-rope: uninline rope_cache_init, otherwise it breaks after rebaseing with SSM_CONV changes

---------

Co-authored-by: Max Krasnyansky <redacted>
3 months agoapp : show version (#23426)
Adrien Gallouët [Thu, 21 May 2026 04:21:13 +0000 (06:21 +0200)]
app : show version (#23426)

Signed-off-by: Adrien Gallouët <redacted>
3 months agomtmd, model : merge HunyuanOCR into HunyuanVL and fix OCR vision precision (#23329)
wendadawen [Wed, 20 May 2026 22:35:37 +0000 (06:35 +0800)]
mtmd, model : merge HunyuanOCR into HunyuanVL and fix OCR vision precision (#23329)

- HunyuanOCR shares the same HF arch and vision layout as HunyuanVL butwas split into a separate path that skipped the +0.1 bilinear sampler used by the HF reference.
- Collapse OCR into the HUNYUANVL projector + HUNYUAN_VL text arch

3 months agoui: Add max image size option (#22849)
stduhpf [Wed, 20 May 2026 22:00:09 +0000 (00:00 +0200)]
ui: Add max image size option (#22849)

* webui: Add max image size option

* remove magic numbers

* support all image formats

* use const

* Move regex to match b64 images to constants

* use SETTINGS_KEYS to get max image resolution setting

* Do not touch the image if already under the size threshold

3 months agoMove to backend sampling for MTP draft path (#23287)
Gaurav Garg [Wed, 20 May 2026 17:04:45 +0000 (22:34 +0530)]
Move to backend sampling for MTP draft path (#23287)

* Move to backend sampling for MTP draft path

Run top_k(10) on the draft backend. D2H transfers happen only for the top 10 logits

Make backend sampling more robust and fallback to CPU on failure cases, such as with "-sm tensor" or when a backend doesn't support TOP_K.

* Allow sampler chains to be partially offloaded to backend

* Add --spec-draft-backend-sampling argument. Enabled by default.

3 months agoopencl: refactor backend initilization (#23318)
lhez [Wed, 20 May 2026 16:57:36 +0000 (09:57 -0700)]
opencl: refactor backend initilization (#23318)

* opencl: refactor initialization

* opencl: refactor GPU identification

* opencl: rename for consistency

* opencl: cache global mem size in dev_ctx

* opencl: adjust log level

* opencl: load argsort and flash_attn kernels in supports_op

* argsort kernel must be built for supports_op for querying the max
  workgroups
* flash_attn kernel has many variants, only load them when needed

3 months agocommon/speculative : fix nullptr crash in get_devices_str (#23386)
Georgi Gerganov [Wed, 20 May 2026 16:44:30 +0000 (19:44 +0300)]
common/speculative : fix nullptr crash in get_devices_str (#23386)

ggml_backend_dev_by_name always appends a nullptr sentinel to the devices
vector. Skipping nullptr entries prevents assertion failure in
ggml_backend_dev_name.

Assisted-by: llama.cpp:local pi
3 months agomtmd : DeepSeek-OCR image processing fixes, img_tool::resize padding refactor (#23345)
Saba Fallah [Wed, 20 May 2026 15:37:10 +0000 (17:37 +0200)]
mtmd : DeepSeek-OCR image processing fixes, img_tool::resize padding refactor (#23345)

* mtmd : deepseek-ocr fixes, improvements and refactoring

- image processing changes to achieve full parity with Pillow (reference impl)
- SAM mask casting only when flash-attn is on
- SAM refactor (build_sam() extracted so deepseek-ocr-2 can reuse it)
- llama-chat changes to fix server/WebUI issue (new media_markers_first())
- adapted test-chat-template and added test cases for deepseek-ocr
- changed regression test for deepseek-ocr to use CER+chrF scores for ground-truth comparison; removed embedding-model
- ty.toml ignore unresolved-import for tools/mtmd/tests/**

* image-text reordering fix removed

* refactor bool add_padding + pad_rounding enum into a single pad_style enum

3 months agovulkan: optimize operations in the IM2COL shader (#22685)
Daniele [Wed, 20 May 2026 15:15:13 +0000 (17:15 +0200)]
vulkan: optimize operations in the IM2COL shader (#22685)

* vulkan: optimize operations in the IM2COL shader

* Add comments and improve the code formatting