10234 Commits

Author SHA1 Message Date
Georgi Gerganov
9d21b57f2e metal : add F16 support for bin ops (#26465) b10234 2026-08-02 22:28:17 +03:00
mgroeber9110
0ab9d6fed7 opencl: limit local workgroup size for GLU operation (#26383) b10233 2026-08-02 11:44:00 -07:00
Georgi Gerganov
fffbcbdb9d metal: implement DeepSeek V4 hyper-connections (#26459)
- Implement GGML_OP_DSV4_HC_COMB, GGML_OP_DSV4_HC_PRE, and
  GGML_OP_DSV4_HC_POST with SIMDgroup register and shuffle optimized kernels.
- Add Metal dispatch and support plumbing and test the production Sinkhorn
  iteration count and embedding width.

Assisted-by: Codex

Co-authored-by: Thiago Padilha <thiago@padilha.cc>
b10232
2026-08-02 21:06:02 +03:00
Pascal
bb4e0e1b3f common: support the DSpark sidecar resolution (#26458)
The dspark- files resolve like the other speculative sidecars: the
-hfd tag applies to them, a requested sidecar resolves without a full
model at the tag, and an explicit -md selection disables the discovery.
When no type is requested, dspark outranks dflash in the auto-selection
since its sidecar carries the extra Markov head.
b10231
2026-08-02 19:25:27 +02:00
Aman Gupta
3581ba0cf5 convert: add option to create separate dspark GGUF (#26452)
* convert: add option to create separate dspark GGUF

* add --no-nextn

* fix convert bug
2026-08-02 23:16:31 +08:00
akleine
c745be2a2c opencl: bugfix increment ref_count in ggml_backend_opencl_init() (#26162)
Incrementing `ref_count` at the beginning is important later
in the `free()` method of the `ggml_backend_opencl_context` at program end.
If we do not increment the `ref_count`, the result would be -1 here,
and consequently, the profiling data would not be flushed and written.
( #ifdef GGML_OPENCL_PROFILING )
b10229
2026-08-02 06:43:00 -07:00
Aman Gupta
596a5795bd DeepseekV4 MTP + DSpark (#25784) b10228 2026-08-02 20:55:34 +08:00
Aldehir Rojas
f5919bf458 chat : add qwen3 specialized parser (#26252)
* Add tagged thinking tool parser

* chat : refactor and add permute helper

* cont : add support for <tool_call> omission

* cont : update tool delimiters

* cont : add comment for qwen3-coder

* cont : fix trigger pattern for <function

---------

Co-authored-by: Bart de Boer <bart.deboer@gmail.com>
b10227
2026-08-02 04:13:20 -05:00
KyleHagy
272700b360 sycl: fix classification of iGPUs (#26105) b10226 2026-08-02 15:10:32 +08:00
Sigbjørn Skjæret
75587a05b3 model : load MiMo V2 MTP tensors only if used (#26412) b10225 2026-08-02 09:03:05 +02:00
Masashi Yoshimura
7a2db1a0cf ggml-webgpu: add support for f16 repeat (#26307) b10224 2026-08-02 08:28:31 +02:00
Xuan-Son Nguyen
11924d4c17 test: fix some CI errors (#26415) b10223 2026-08-02 00:16:29 +02:00
Jeff Bolz
a7a6d0d269 vulkan: extend topk_moe fusion to support sqrt(softplus) (#26124) 2026-08-01 14:18:07 -05:00
Alessandro de Oliveira Faria (A.K.A.CABELO)
815a2a5915 vendor : update BoringSSL to 0.20260730.0 (#26353) b10221 2026-08-01 20:53:00 +02:00
Xuan-Son Nguyen
89482bd665 agents: clarify comment style and jinja knowledge (#26405)
* agents: clarify comment style and jinja knowledge

* improve Security review a bit
2026-08-01 18:45:46 +02:00
Nico
c629da565c cli : persist reasoning_content in chat history (#26362)
* cli : persist reasoning_content in chat history

llama-cli collected reasoning from the stream for display but only
stored assistant content in messages, so --reasoning-preserve could
not re-inject prior thoughts on later turns.
b10219
2026-08-01 18:03:32 +02:00
tc-mb
de699957b9 mtmd: add minicpmv46 downsample (#25993)
* add minicpmv46 downsample

Signed-off-by: tc-mb <tianchi_cai@icloud.com>

* put downsample mode inside gguf.

Signed-off-by: tc-mb <tianchi_cai@icloud.com>

* build mtmd_image_preprocessor_llava_uhd

Signed-off-by: tc-mb <tianchi_cai@icloud.com>

* fix code

Signed-off-by: tc-mb <tianchi_cai@icloud.com>

* add convert

Signed-off-by: tc-mb <tianchi_cai@icloud.com>

* add 4x ignore vit merger

Signed-off-by: tc-mb <tianchi_cai@icloud.com>

---------

Signed-off-by: tc-mb <tianchi_cai@icloud.com>
b10218
2026-08-01 13:38:36 +02:00
Piotr Wilkin (ilintar)
ddd4ec1428 chat : enable tool call in thinking for DS4 (#26269) b10217 2026-08-01 00:13:07 -05:00
Anand Patil
876a432116 vulkan: add POOL_1D op (#25431)
* vulkan : add pool1d push constants and pipeline field

Declared data structures needed for POOL1D OP, which are the vk_op_pool1d_push_constants struct and pipeline_pool1d_f32 field.

* vulkan : add pool1d compute shader

Added pool1d.comp for Vulkan backend mirroring the existing pool2d shader.

* vulkan : add full GGML_OP_POOL_1D support

Added pipeline creation and op dispatch for 1D pooling in the Vulkan backend.

* vulkan : fix pool1d shader logic

Registered pool1d_f32 in vulkan-shaders-gen.cpp and fixed tensor dimension indices and avg pool scale.

* vulkan : fix pool1d end boundary crash and expand test coverage

Fixed an issue where the shader crashed when the end boundary was negative when k0 < p0. Also, added more test cases related to this fix.
b10216
2026-07-31 16:48:58 +02:00
Masato Nakasaka
eb41d503ba vulkan: Introduce driver version check for Windows Intel GPU to mitigate crashing (#25192)
* Removed crash guard for Intel

Crash fixed from driver 32.0.101.8860

* Added driver version check for windows

* Change to convert from driverVersion rather than string

* No need to use signed

* Refactor

* allow GPU other than Xe2+

* adjusted function body position
b10215
2026-07-31 16:26:37 +02:00
Xuan-Son Nguyen
db7d8b24b5 mtmd: add n_embd_head (#26342)
Co-authored-by: Daniel Han <unslothai@gmail.com>
b10214
2026-07-31 15:30:19 +02:00
timkhronos
a09d8abf8c Support rotated kv cache quant (#26180) b10213 2026-07-31 21:06:40 +08:00
fairydreaming
82dbc4f017 llama : load MTP tensors only if they are really used (#26296)
* llama : load MTP tensors only if they are really used

* llama : skip loading MTP (if not used) in remaining models that support MTP

---------

Co-authored-by: Stanisław Szymczyk <sszymczy@gmail.com>
b10212
2026-07-31 14:57:02 +02:00
Jeff Bolz
6f3c0a790b vulkan: update vulkan sdk to 1.4.357.0 (#26303) b10211 2026-07-31 07:27:03 -05:00
Ruixiang Wang
000547513f server: correct accepted tokens when need draft token replay (#26320)
* spec: correct accepted tokens when need draft token replay

* cont : naming

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
b10210
2026-07-31 11:16:17 +03:00
David Friehs
15e755f30d cuda: extract Q2_0 elements via __byte_perm (#25603) b10209 2026-07-31 11:15:44 +03:00
Ozymandias_EBON
9d9a6d29f6 SYCL: add oneMKL GEMM flash attention for XMX-accelerated prompt proc… (#25025)
* SYCL: add oneMKL GEMM flash attention for XMX-accelerated prompt processing

* fattn-mkl: fix interleaved dst layout in normalize kernel

- Fix mkl_fa_normalize_head: use interleaved dst layout
  ((query * n_q_heads + head) * DV) matching TILE's
  flash_attn_combine_results. Previously used dense head-major
  layout which wrote head outputs to wrong addresses, corrupting
  attention for all models except Qwen3.6-27B (where GQA=6 heads
  were sparse enough to avoid visible overlap).

- Remove 7 redundant stream->wait() calls — SYCL in-order queue
  already serializes pure SYCL kernel dependencies. Retain only
  the 4 MKL GEMM ↔ SYCL handshake barriers (oneMKL GEMM uses its
  own internal queue that does not respect SYCL in-order).

- Remove unused dst_row_stride, diagnostic clutter, and dead
  K/V hex dump (fa_diag block in fattn-mkl.cpp).

- Add MKL_FA_DISABLE=1 env var for A/B testing.
- Add FA-DISP watchdog (MKL_FA_DEBUG=1) and FA-DIAG output
  fingerprint (MKL_FA_DIAG=1) in fattn.cpp.

Tested: Gemma-4-26B, Gemma-4-31B, Qwen3.6-27B, Qwen3.6-35B-A3B
Perf (B70/Battlemage, 32K, q8_0 KV):
  Gemma-4-26B:  1473 t/s MKL vs 746 TILE (1.97x)
  Qwen3.6-27B:   609 t/s MKL vs 330 TILE (1.85x)

Co-Authored-By: Claude Code on DeepSeek-v4-Pro

* Thank you for the review feedback: rename env vars, use GGML_LOG_INFO, document in SYCL.md

Completed the following:
- Rename MKL_FA_DISABLE → GGML_SYCL_ENABLE_MKL_FA (inverted: 0 to disable)
- Rename MKL_FA_DEBUG → GGML_SYCL_MKL_FA_DEBUG
- Rename MKL_FA_DIAG → GGML_SYCL_MKL_FA_DIAG
- Replace fprintf(stderr, ...) / fflush(stderr) with GGML_LOG_INFO() macro
- Document all three env vars in docs/backend/SYCL.md under Runtime
- Add comment explaining MKL FA activation trigger (flash-attn + quantized
  KV cache + batch-size >= 1024 + n_kv >= 1024)

Resolves review feedback from arthw.
Again, thank you!!!

Co-Authored-By: Claude Code on DeepSeek-v4-Pro

* Thank you for the review feedback round 2: use ggml_sycl_get_env, remove dup waits, gate perf macros

- Replace raw getenv() with ggml_sycl_get_env() in all 4 env-var checks
  (fattn.cpp: GGML_SYCL_ENABLE_MKL_FA, GGML_SYCL_MKL_FA_DEBUG,
   GGML_SYCL_MKL_FA_DIAG; fattn-mkl.cpp: GGML_SYCL_MKL_FA_DEBUG)
- Remove duplicated stream->wait() before ev.wait_and_throw() in GEMM
  KQ and GEMM VKQ — ev.wait_and_throw() already waits for completion
- Gate MKL_ACCUM macro behind do_print so timing accumulators are
  no-ops in normal operation
- Remove redundant MIT/Intel copyright header from fattn-mkl.cpp
- Remove unused #include <cfloat>
- Expand SYCL.md MKL FA docs with step-by-step activation trigger
  and example llama-cli command

Again, thank you!!!

Co-Authored-By: Claude Code on DeepSeek-v4-Pro

* fattn-mkl: enable MKL FA for all KV cache types

Remove the quantized-only restriction on MKL activation — the MKL
kernel converts any non-F16 K/V to F16 via to_fp16_sycl before GEMM,
so F16 (default), BF16, and F32 caches all benefit from XMX hardware
acceleration.  The type restriction was an unnecessary gate.

Before (F16/BF16 default cache + FA on at 32K prefill): ~356 t/s (TILE path)
After:  ~670 t/s (MKL path, matching quantized-cache baseline)

Minimal change: two conditions removed, one comment updated in fattn.cpp.
No kernel or conversion code changes — the dequant pipeline already
covers all types.

* fattn-mkl: rename mkl_disable -> mkl_enable for clarity

* fattn-mkl: refine MKL FA dispatch gates

Three changes:
1. Remove quantized-only restriction - MKL FA activates for all
   KV cache types (F16 default, BF16, F32, quantized).  The MKL
   kernel converts non-F16 K/V via to_fp16_sycl before GEMM.
2. Rename mkl_disable -> mkl_enable to match env var
   (GGML_SYCL_ENABLE_MKL_FA).
3. Replace batch-size threshold with Q->ne[1] >= 32 gate.
   Keeps TG (Q=1) and MTP drafts (Q=3-8) on VEC path where
   fused kernel beats MKL launch overhead.  Routes all
   multi-token prefill through XMX-accelerated GEMM.

Production data confirms Q patterns: 1-8 TG, 32-127 cache reuse,
128+ full reprocess.  At 32K F16/BF16 FA-on: 356 -> 670 t/s.

* ggml-sycl: fix F16 cache + MKL FA multi-turn corruption; add gate guards

Two changes:

1. Always copy F16 K/V to dense row-major buffers before MKL GEMM.
   Previously F16 was read in-place with raw tensor strides. During
   multi-turn conversations, the accumulated KV cache had different
   stride properties than a fresh prefill, producing corrupted outputs.
   Now dense F16 gets a fast memcpy; interleaved (Gemma) gets a strided
   copy kernel. This matches what the quantized paths already did through
   to_fp16_sycl.

2. Gate MKL FA on unsupported op params (max_bias, logit_softcap, batch
   dim mismatch) and pathological F16 strides (nb[1] not a multiple of
   ne[0]*2). These conditions would previously crash inside the MKL
   kernel. Pathological strides (test-only) and ALiBi/softcap fall
   through to TILE/VEC which handle them correctly.

The stride check uses modulo rather than equality, so both dense
(nb1 == ne0*2) and interleaved (nb1 == H * ne0*2) pass — all real
models use these layouts. Only test cases with overlapping rows
(nb1=32 or nb1=75 for ne0=40) are blocked.

Thanks to hmscider for the oneDNN FA PR (#25222) which surfaced the
same insight: always normalize inputs to contiguous F16 before GEMM.

Co-Authored-By: Claude Code using DeepSeek-V4-Pro <noreply@anthropic.com>

* fattn-mkl: fix quant+GQA KV strides, tighten MKL gate, add K>=1024 tests

Adding K>=1024 flash-attn test cases surfaced several MKL bugs:

- Quant K/V with a padded seq-view (real KV cache) used the wrong
  strides in the dequant path... only the true Gemma interleave
  layout should reconstruct strides. nb[2] vs ne[1]*nb[1]
- Gate was firing on shapes the kernel doesn't handle: head_dim < 64
  or not a multiple of 64, MHA, attention sinks, and
  bf16 decode... fell through to vec which no bf16 case.

Gate MKL to the validated envelope: gqa>=2, head_dim 64 through 512
(has to be a multiple of 64) with matching K/V head size, mask,
no sinks/alibi/softcap... everything else falls back to tile.
Covers Qwen Dense/MoE and Gemma4 Dense/MoE

Ran test-backend-ops -o FLASH_ATTN_EXT: 3641/3641 pass.
Perplexity unchanged... 6.7267 MKL vs 6.7290 stock using
Qwen 27b q5_k_xl

* Update ggml/src/ggml-sycl/fattn.cpp

Co-authored-by: Neo Zhang <zhang.jianyu@outlook.com>

* Update ggml/src/ggml-sycl/fattn.cpp

Co-authored-by: Neo Zhang <zhang.jianyu@outlook.com>

* Update ggml/src/ggml-sycl/fattn.cpp

Co-authored-by: Neo Zhang <zhang.jianyu@outlook.com>

* fattn-mkl: bound attention scratch so it doesn't grow with batch or context... also dropped the bf16 comment in fattn.cpp per arthw review.

* Update ggml/src/ggml-sycl/fattn-mkl.cpp

Co-authored-by: Neo Zhang <zhang.jianyu@outlook.com>

* Update ggml/src/ggml-sycl/fattn-mkl.cpp

Co-authored-by: Neo Zhang <zhang.jianyu@outlook.com>

* apply arthw suggestions: enum for dequant modes, macro for wg_size, env-var one-liners

---------

Co-authored-by: Claude Code using DeepSeek-V4-Pro <noreply@anthropic.com>
Co-authored-by: Neo Zhang <zhang.jianyu@outlook.com>
b10208
2026-07-31 10:43:16 +03:00
Neo Zhang
d5d3e05bf8 [SYCL] support the missed types in cpy (#26005)
* support the missed types in cpy

* use correct funct

* rm unused code
b10207
2026-07-31 10:25:16 +03:00
fairydreaming
69e62fc77c llama : enforce the same K and V cache types for DeepSeek V4; enable FA if V cache is quantized (#25871)
* llama : enforce the same K and V cache types for DeepSeek V4; enable FA if V cache is quantized

* llama : enforce the same K and V cache types for MLA models

---------

Co-authored-by: Stanisław Szymczyk <sszymczy@gmail.com>
b10206
2026-07-31 10:03:30 +03:00
Sachin Sharma
1e22599522 ggml-zendnn : group matmul direct API for mul_mat_id (#25918)
* ggml-zendnn : group matmul API for mul_mat_id

* ggml-zendnn : scale MUL_MAT_ID fallback threshold by expert count
b10205
2026-07-31 09:40:52 +03:00
Neo Zhang
1c5b89ff63 sycl : support dev2dev memcpy by DEV2DEV_MEMCPY_FORWARD (#26234)
Co-authored-by: Neo Zhang Jianyu <jianyu.zhang@intel.com>
b10204
2026-07-31 09:20:28 +03:00
Neo Zhang
a2be61dc87 [SYCL] Support q2 mul_mat (#26231)
* support q2_0 in mul_mat

* support more q2_0 case
b10203
2026-07-31 09:19:41 +03:00
Titaniumtown
1553725965 sycl: fuse RMS_NORM + MUL (#26015) b10202 2026-07-31 09:17:53 +03:00
Masashi Yoshimura
8f4646a63e ggml-webgpu: improve flash_attn_vec for quantized KV at long contexts (#25956)
* improve fa of quantized kv cache

* Fix some bugs and some comments.

* fix v type check and some comments

* Fix build error caused by rebasing

* editorconfig checking pass
b10201
2026-07-31 09:08:40 +03:00
Xuan-Son Nguyen
5f55650a78 mtmd: add lanczos resize method [no release] (#26341) b10200 2026-07-30 21:59:49 +02:00
Xuan-Son Nguyen
b4ca032ae3 server: support inp embd to generate next token (#26313)
* server: support embd for sampled token

* fix ~server_batch()
b10199
2026-07-30 21:40:38 +02:00
Jeff Bolz
ea63b4d32e vulkan: Support quantized concat (#25684) b10198 2026-07-30 13:11:32 -05:00
pmaybank
958d9c0b61 Test support for alternative conv layout (#25617)
* add  bool cwhn = true to conv_2d test cases

* add layout check at graph building time

* extend layout checks for conv2d.cu kernel

* in CPU back-end kernel needs to be stored contiguously to prevent test failures with cwhn=1

* trim white space

* do op support check in vulkan backend

* fix CI failure and vulkan run-time assert failure by introducing new graph build-time check in ggml_backend_vk_device_supports_op

* add additional check in support_op function for Vulkan to fix run-time assert failure
b10197
2026-07-31 01:14:16 +08:00
o7si
432d7ffe2c llama-context : sync pending async copies before clearing embd_seq (#25676) b10196 2026-07-30 19:48:00 +03:00
Georgi Gerganov
47f686f53f tests : avoid building get-model.cpp many times (#26317)
* tests : remove get-model.cpp

* tests : fix quant type selection
b10195
2026-07-30 19:34:04 +03:00
Robert Esclapez
e1a1abb787 ggml-cuda: Allow transpose-free gemmv computation (#26171)
When matrix's weights are shaped 1xK is leverage a transpose-free
computation to use mat_mul_vec_f.
b10194
2026-07-30 21:39:46 +08:00
Georgi Gerganov
6b36c23056 readme : refresh (#26280)
* docs : center badges and links, remove Hot topics

- Use <div align="center"> for GitHub-compatible centering
- Add dev branches and compile times links
- Remove Hot topics section

Assisted-by: llama.cpp:Qwen3.6-27B

* readme : remove sections

* docs : center badges, remove Hot topics, extract sections, remove tools

- Use <div align="center"> for GitHub-compatible centering
- Add dev branches and compile times links
- Add lib llama API and llama-server REST API links
- Remove Hot topics section
- Remove Recent API changes section
- Extract XCFramework section into docs/xcframework.md
- Extract Completions section into docs/completions.md
- Extract Obtaining and quantizing models into docs/models.md
- Remove tools usage sections (llama-cli, llama-server, etc.)
- Move Contributing section to the end

Assisted-by: llama.cpp:Qwen3.6-27B

* cont : arrange links

* cont : fix ws

* cont : remove seminal papers

* cont : change sample model

* cont : trim-down contributing section

* cont : sort backends alphabetically

* cont : words

* cont : add fig captions

* docs : models words

* readme : shorter caption

* cont : fix typo

* cont : add window frame to screenshot
2026-07-30 16:14:37 +03:00
Georgi Gerganov
9ebfc3a8cf sync : ggml b10192 2026-07-30 15:44:24 +03:00
Georgi Gerganov
6a4c3357c8 ggml : bump version to 0.18.0 (ggml/1576) 2026-07-30 15:44:24 +03:00
Pasha Khosravi
9b2a088819 CUDA: add Q2_0 support (#25707) 2026-07-30 12:33:25 +03:00
timkhronos
b2f221684f Remove custom cpu op from the M3 graph, express with stock ops (#26297) b10189 2026-07-30 16:30:18 +08:00
Niklas Wenzel
d0bfb19812 metal: fix memory unwire if model is freed without any GPU operations (#26082)
* metal: fix memory leak if model is freed without any GPU operations

* metal: run dummy work only if residency sets are used

* metal: wrap function in #if defined

* metal: measure system-wide wired memory in test

* metal: always build regression test

Co-authored-by: YiChen Lv <63285796+forforever73@users.noreply.github.com>

---------

Co-authored-by: YiChen Lv <63285796+forforever73@users.noreply.github.com>
b10188
2026-07-30 11:11:27 +03:00
Aleksander Grygier
21a5f5b7f9 ui: IndexedDB and Conversations data fixes (#26278)
* fix: single-flight conversations store init

* refactor: remove unused legacy-migration util

* fix: make createSystemMessage transactional

* fix: delete message branches cascading on edit/regenerate

* fix: stop stamping lastModified on conversation metadata updates

* fix: count cascaded forks in bulk delete toast, bulkify deleteAll

* refactor: drop redundant conversation list respreads

* refactor: create conversation in a single write

* fix: use table constant in toggleConversationPin

* fix: keep the system message placeholder out of the edit form

* fix: keep focus in the system message editor after opening it

* fix: focus the main chat form after submitting a system message

* fix: update timestamp of the correct conversation on stream completion
2026-07-30 10:10:37 +02:00
Jonathan Clohessy
32703b42d6 ggml : Fix issue with kleidiai ci and stringop overflow warning (#26277)
Signed-off-by: Jonathan Clohessy <Jonathan.Clohessy@arm.com>
b10186
2026-07-30 09:17:30 +03:00
Neo Zhang
a6a77bc48d [UT] enhance UT to show all real unsupported backends (#25234)
* enhance UT to show real unsupported backends

* cont : simplify

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
2026-07-30 14:04:58 +08:00