]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/log
pkg/ggml/sources/llama.cpp
4 months agoconvert : force f16 or f32 on step3-vl conv weights (#21646)
Sigbjørn Skjæret [Sun, 12 Apr 2026 17:22:29 +0000 (19:22 +0200)]
convert : force f16 or f32 on step3-vl conv weights (#21646)

4 months agomtmd: add gemma 4 test (vision + audio) [no ci] (#21806)
Xuan-Son Nguyen [Sun, 12 Apr 2026 14:29:03 +0000 (16:29 +0200)]
mtmd: add gemma 4 test (vision + audio) [no ci] (#21806)

* mtmd: add gemma 4 test (vision + audio)

* add to docs

4 months agomtmd: add Gemma 4 audio conformer encoder support (#21421)
Stephen Cox [Sun, 12 Apr 2026 12:15:26 +0000 (00:15 +1200)]
mtmd: add Gemma 4 audio conformer encoder support (#21421)

* mtmd: add Gemma 4 audio conformer encoder support

Add audio processing for Gemma 4 E2B/E4B via a USM-style Conformer.

Architecture:
- 12-layer Conformer: FFN → Self-Attention → Causal Conv1D → FFN → Norm
- Subsampling Conv Projection: 2x Conv2D(stride=2) with LayerNorm
- Full self-attention with sinusoidal RPE and sliding window mask (24)
- Logit softcapping at 50.0, ClippableLinear clamping
- Output: 1024 → 1536 → RMSNorm → multimodal embedder

Mel preprocessing (dedicated mtmd_audio_preprocessor_gemma4a):
- HTK mel scale, 128 bins, magnitude STFT, mel_floor=1e-3
- Standard periodic Hann window (320 samples), zero-padded to FFT size
- Semicausal left-padding (frame_length/2 samples)
- Frame count matched to PyTorch (unfold formula)
- No pre-emphasis, no Whisper-style normalization
- Mel cosine similarity vs PyTorch: 0.9998

Key fixes:
- Tensor loading dedup: prevent get_tensor() from creating duplicate
  entries in ctx_data. Fixed with std::set guard.
- ClippableLinear clamp_info loading moved after per-layer tensors.
- Sliding window mask (24 positions) matching PyTorch context_size.
- Skip Whisper normalization for Gemma4 mel output.

Tested on E2B and E4B with CPU and Vulkan backends.
Transcribes: "Glad to see things are going well and business is starting
to pick up" (matching ground truth).

Ref: #21325

4 months agofix: Proper messages rendering for "Show raw output" (#21672)
Aleksander Grygier [Sun, 12 Apr 2026 11:08:11 +0000 (13:08 +0200)]
fix: Proper messages rendering for "Show raw output" (#21672)

4 months agodocs: add guide on how to add multimodal support (#21778)
Xuan-Son Nguyen [Sun, 12 Apr 2026 11:02:38 +0000 (13:02 +0200)]
docs: add guide on how to add multimodal support (#21778)

* docs: add guide on how to add multimodal support

* nits

4 months agoCUDA: skip compilation of superfluous FA kernels (#21768)
Johannes Gäßler [Sat, 11 Apr 2026 16:52:11 +0000 (18:52 +0200)]
CUDA: skip compilation of superfluous FA kernels (#21768)

4 months agomtmd : add MERaLiON-2 multimodal audio support (#21756)
Sirui He [Sat, 11 Apr 2026 12:15:48 +0000 (20:15 +0800)]
mtmd : add MERaLiON-2 multimodal audio support (#21756)

* mtmd : add MERaLiON-2 multimodal audio support

Adds support for A*STAR's MERaLiON-2 audio-language model (3B and 10B)
to the multimodal framework.

Architecture:
- Whisper large-v2 encoder for audio feature extraction
- Gated MLP adaptor: ln_speech -> frame stack (x15) -> Linear+SiLU -> GLU -> out_proj
- Gemma2 3B / 27B decoder

The mmproj GGUF is generated via convert_hf_to_gguf.py --mmproj on the full
MERaLiON-2 model directory (architecture: MERaLiON2ForConditionalGeneration).
The decoder is converted separately as a standard Gemma2 model after stripping
the text_decoder. weight prefix.

New projector type: PROJECTOR_TYPE_MERALION

Supports tasks: speech transcription (EN/ZH/MS/TA), translation, spoken QA.

Model: https://huggingface.co/MERaLiON/MERaLiON-2-3B
       https://huggingface.co/MERaLiON/MERaLiON-2-10B

* simplify comments in meralion adaptor

* meralion: use format_tensor_name, ascii arrows in comments

4 months agoopencl: add basic support for q5_k (#21593)
shaofeiqi [Sat, 11 Apr 2026 08:46:19 +0000 (01:46 -0700)]
opencl: add basic support for q5_k (#21593)

* opencl: add general q5_k mv

* opencl: add flattened Q5_K mv and general Q5_K mm

* opencl: fix Q5_K unit tests

4 months agoTP: fix Qwen 3 Next data split (#21732)
Johannes Gäßler [Sat, 11 Apr 2026 07:23:42 +0000 (09:23 +0200)]
TP: fix Qwen 3 Next data split (#21732)

4 months agoggml : fix a few instances of missing GGML_TYPE_Q1_0 cases (#21716)
Sigbjørn Skjæret [Sat, 11 Apr 2026 06:45:00 +0000 (08:45 +0200)]
ggml : fix a few instances of missing GGML_TYPE_Q1_0 cases (#21716)

4 months agopy : Bump typer to latest to fix huggingface_hub issue (#21701)
Bartowski [Sat, 11 Apr 2026 06:44:15 +0000 (02:44 -0400)]
py : Bump typer to latest to fix huggingface_hub issue (#21701)

4 months agoCUDA: also store node->src ne/nb for graph equality (#21736)
Aman Gupta [Sat, 11 Apr 2026 02:30:30 +0000 (10:30 +0800)]
CUDA: also store node->src ne/nb for graph equality (#21736)

4 months agofix: Fix broken structured output when using $refs in json_schema (#21699)
Galunid [Fri, 10 Apr 2026 23:26:36 +0000 (01:26 +0200)]
fix: Fix broken structured output when using $refs in json_schema (#21699)

4 months agohexagon: add support for linux on snapdragon (#21707)
Todor Boinovski [Fri, 10 Apr 2026 22:57:23 +0000 (15:57 -0700)]
hexagon: add support for linux on snapdragon (#21707)

* hexagon: add support for debian on ex2

* hexagon: add -fvectotize to c/c++ cmake flags

* hexagon: remove trailing white space

* update onboarding steps

* hexagon: update linux setup documentation

* hexagon: update intallation scripts

* Hexagon: update docs

* hexagon: update onboarding scripts

---------

Co-authored-by: Zack Li <redacted>
4 months agohexagon: improved Op queuing, buffer and cache management (#21705)
Max Krasnyansky [Fri, 10 Apr 2026 22:47:43 +0000 (15:47 -0700)]
hexagon: improved Op queuing, buffer and cache management (#21705)

* hexagon: introduce op request batching and rewrite buffer managment

The host now prepares batches of requests and dispatches them via a single dspqueue message.

Buffers are mapped explicitly by NPU while processing batches.

* hex-dma: disable l2 bypass since to work around new issue due to no flushes between Ops

* hex-utils: add explicit l2flush and l2clear helpers

* hex-opreq: use fine-grain per tensor l2 management

* hex-opreq: avoid redundant invalidates for tensors we already flushed

* hex-opreq: update debug messages

* htp-opreq: reuse ops_context

* hex-opreq: do not flush or invalidate cache lines beyond buffer boundry

* hex-opreq: fix errors in log message

* Revert "hex-opreq: do not flush or invalidate cache lines beyond buffer boundry"

This reverts commit 8b7f0a55a750a6430ce4eb1874c7feb3d720056d.

* hexagon: limit l2 flushes to 1MB which covers l2 cache

* hex-opreq: limit cache flush to 4MB

Looks like 4MB cont. vitual space should cover the 1MB cache.

* hexagon: drop cache flush size to 2MB

* hex-opreq: start reworking opreq packing

* hex-opreq: introduce new way of packing opbatch where tensors are stored separately

* hex-opreq: add a simple fastrpc call to force unmap all buffers

* hex-l2flush: somehow 2MB does not seem robust, also cleanup step size to use line-size

* hex-opreq: bump opreq batch size to 256

* hex-mm: place src1 spad at the top of vtcm for easy reuse

* hex-ops: introduce internal types and disable src1 reuse for now

Nothing new just formalizing the repack / qyn.quant types we've been using.

* htp-opreq: use tensor pointers instead of copies

* hex-opreq: introduce more robust way for tracking vtcm/spad reuse

This removes the SKIP_QUANTIZE flag that became fragile with the addition of HMX and other ops.

* hex-cumsum: fix error post opreq merge

* hex-opreq: move request batch handling into the session

Prepping everything for using dspqueue buffers and doing that inside the session is much cleaner.

* hex-mm: yet another fix for src1 reuse when we're mixing hmx/hvx

* hex-bufs: introduce pinned mmapings and use non-pinned ones for model buffers

* hex-buf: add support for allocating shared/pinned buffer for opreqs

* hex-opbatch: make opbatches configurable

* hex-naming: better name for ggml_hexagon_shared_buffer

* hex-naming: add session->c_name() helper

* hex-opbatch: start using shm but still copy for now

* hex-opbatch: use shared buffer for packing opbatch

* hex-opbatch: beter naming for opbatch related classes and code

* hex-opbatch: reuse batched tensors with same data/dims/strides

* hex-opbatch: update logging

* hex-opbatch: add support for vmem limit for op batching

* hex-opbatch: update htp side to properly support dynamic mmap/unmap

* hex-opbatch: add OB and OQ params for run-completion script and fix the asserts in batch processing

* hex-opbatch: fixed src1 handling in act ops

* hex-act: fix empty src1 handling in swiglu and friends

Simplify preamble macro while at it

* hex-mm: minor fix vtcm and dma handling in matmul

cleaning up some left-overs from merges

* hex-opbatch: allocate extra 1KB for dspqueue overhead

* hexagon: fix softmax for non-aligned tensors and cleanup vtcm alloc

* hex-mm: properly handle hmx_disabled flag

* hex-ops: update comments

* hex-ops: add debug output for get/set-rows

* hex-mmap: optimize un/mapping of buffers

* hex-opreq: global cache flush and invalidate beyond 128KB threshold

* hex-ops: add super simple opfilter regex for debugging

If an Op matches the regex hex backend will reject it.

* hex-opbatch: wireup newer ops missed in merge and update main switch to detect this in future

* hexagon: improved vtcm acquision to remove inter-op overhead

Fully compatible with QNN-HTP coex

* hex-mm: fixed hvx fallback path

* hex-mm: lower the vmem threshold a bit further to ~3GB

* hexagon: update debug & error logs

This also fixes an issue with newer llvm merging repack and non-repack
functions. We use those pointer to distinguish between buffer types.

* hexagon: move ops context into main context

Just a cleanup. We don't need separate contexts at this point.

* hex-opbatch: cleanup naming and headers for opbatch and related descriptors

* hex-fa: it's now better to enable FA during TG to reduce graph splits

* hexagon: remove GGML_HEXAGON_EXPERIMENTAL env var

It's no longer useful. Please use more flexible GGML_HEXAGON_OPFILTER to disable Ops
if needed for debugging or validation.

* hexagon: fixed editorconfig check

* Update ggml/src/ggml-hexagon/ggml-hexagon.cpp

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

Co-authored-by: Trivikram Reddy <redacted>
Co-authored-by: Sigbjørn Skjæret <redacted>
4 months agocommon : better align to the updated official gemma4 template (#21704)
Aldehir Rojas [Fri, 10 Apr 2026 21:12:53 +0000 (16:12 -0500)]
common : better align to the updated official gemma4 template (#21704)

4 months agocommon : add callback interface for download progress (#21735)
Adrien Gallouët [Fri, 10 Apr 2026 20:17:00 +0000 (22:17 +0200)]
common : add callback interface for download progress (#21735)

Signed-off-by: Adrien Gallouët <redacted>
4 months agomodel : make Gemma 4 shared-KV tail attn_k tensors optional on load (#21739)
MoonRide303 [Fri, 10 Apr 2026 19:45:50 +0000 (21:45 +0200)]
model : make Gemma 4 shared-KV tail attn_k tensors optional on load (#21739)

4 months agoggml-webgpu: support non-square subgroup matrix configs for Intel GPUs (#21669)
Rithik Sharma [Fri, 10 Apr 2026 17:52:38 +0000 (10:52 -0700)]
ggml-webgpu: support non-square subgroup matrix configs for Intel GPUs (#21669)

4 months agoggml-webgpu: address quantization precision and backend lifecycle managment (#21521)
Chen Yuan [Fri, 10 Apr 2026 17:52:01 +0000 (13:52 -0400)]
ggml-webgpu: address quantization precision and backend lifecycle managment (#21521)

* ggml(webgpu): fix the busy-polls in Emscripten  in the waitAny after #20618, and remove the busy webgpu log

* Merge with upstream

* Fix GET_ROWS packed integer NaN when using f16 as memory buffer in shader quants

* Update Unary wgsl EXP and EXPM1 for f16 stability

* Fix GET_ROWS IQ4_XS strcut for NaN f16 canonicalization

* Fix numerical percision for unary sqrt when working with f16

* Fix NaN canonicalization for packed integers using f16

* Update err threshold for binary div ops when using f16

* backend: Keep one Dawn/WebGPU instance alive for the lifetime of the static backend

* clean: uncomment existing code logs

* clean: clean the unncessary debug info

* Refactor and generalize dequant helpers

* Remove deprecated quant structs

* Refactor shader defines to reduce repetition

* Remove error override for F16 type

* fix: fix the accidential removal of the proper initialization of ctx

* clean: clean legacy and format code

* fix: did not modify tests ops

---------

Co-authored-by: Jeremy J. Hartmann <redacted>
4 months agoserver : ignore --alias when using --models-preset (#21380)
Adrien Gallouët [Fri, 10 Apr 2026 15:42:56 +0000 (17:42 +0200)]
server : ignore --alias when using --models-preset (#21380)

I'm not sure what the purpose of keeping `--alias` was when using
`--models-preset`, but the result is really weird, as shown in the
following logs:

    $ build/bin/llama-server --models-preset preset.ini --alias "Gemma 4 E4B UD Q8_K_XL"
    ...
    init: using 31 threads for HTTP server
    srv   load_models: Loaded 2 cached model presets
    srv   load_models: Loaded 1 custom model presets from preset.ini
    main: failed to initialize router models: alias 'Gemma 4 E4B UD Q8_K_XL' for model 'angt/test-split-model-stories260K:F32' conflicts with existing model name

So I propose to simply ignore `--alias` too in this case. With this
commit, the server starts in routing mode correctly.

Signed-off-by: Adrien Gallouët <redacted>
4 months agocommon : fix when loading a cached HF models with unavailable API (#21670)
Adrien Gallouët [Fri, 10 Apr 2026 14:37:46 +0000 (16:37 +0200)]
common : fix when loading a cached HF models with unavailable API (#21670)

Signed-off-by: Adrien Gallouët <redacted>
5 months agocommon: mark --split-mode tensor as experimental (#21684)
Johannes Gäßler [Fri, 10 Apr 2026 10:27:27 +0000 (12:27 +0200)]
common: mark --split-mode tensor as experimental (#21684)

5 months agowebui: Static build output improvements (#21667)
Aleksander Grygier [Fri, 10 Apr 2026 09:49:47 +0000 (11:49 +0200)]
webui: Static build output improvements (#21667)

* refactor: Build improvements

* chore: Formatting + package lock update

5 months agocommon : enable reasoning budget sampler for gemma4 (#21697)
Berk Idem [Fri, 10 Apr 2026 09:49:14 +0000 (05:49 -0400)]
common : enable reasoning budget sampler for gemma4 (#21697)

* fix: enable reasoning budget sampler for gemma4

Add thinking_start_tag and thinking_end_tag to
common_chat_params_init_gemma4(). Without these, the reasoning
budget sampler never activates for gemma4.

Make the newline after "thought" optional in the PEG parser to
handle budget=0 (sampler forces end tag before the newline).

Add test case for empty thinking block.

Fixes #21487

* use p.space() instead of p.optional(p.literal("\n")) in gemma4 thought parser

5 months agodocs : fix broken link to ggml-openvino in OPENVINO.md (#21709)
Belem Zhang [Fri, 10 Apr 2026 07:50:08 +0000 (15:50 +0800)]
docs : fix broken link to ggml-openvino in OPENVINO.md (#21709)

5 months agovulkan: Support Q1_0 (#21539)
Jeff Bolz [Fri, 10 Apr 2026 06:35:27 +0000 (01:35 -0500)]
vulkan: Support Q1_0 (#21539)

* vulkan: Support Q1_0

* use get_dm

5 months agocommon : add fluidity to the progress bar (#21671)
Adrien Gallouët [Fri, 10 Apr 2026 06:24:53 +0000 (08:24 +0200)]
common : add fluidity to the progress bar (#21671)

Signed-off-by: Adrien Gallouët <redacted>
5 months agoCUDA: fuse muls (#21665)
Aman Gupta [Fri, 10 Apr 2026 02:24:09 +0000 (10:24 +0800)]
CUDA: fuse muls (#21665)

5 months agoHIP: add CDNA4 (gfx950) architecture support for MI350X/MI355X (#21570)
andyluo7 [Thu, 9 Apr 2026 19:13:32 +0000 (22:13 +0300)]
HIP: add CDNA4 (gfx950) architecture support for MI350X/MI355X (#21570)

Add AMD Instinct MI350X/MI355X (gfx950, CDNA4) support:

- vendors/hip.h: Add CDNA4 preprocessor define for __gfx950__
- common.cuh: Add GGML_CUDA_CC_CDNA4 and GGML_CUDA_CC_IS_CDNA4 macros
- mma.cuh: Route CDNA4 to compatible MFMA instructions:
  * f32 matmul: mfma_f32_16x16x4f32 (xf32 variant unavailable on gfx950)
  * bf16 matmul: mfma_f32_16x16x16bf16_1k (same as CDNA3)
  * int8 matmul: mfma_i32_16x16x32_i8/32x32x16 (same as CDNA3)
- mmq.cuh: Include CDNA4 in stream-k kernel dispatch

CDNA4 is largely compatible with CDNA3 except:
- No xf32 MFMA (mfma_f32_16x16x8_xf32) — routes to f32 path
- Different FP8 format (e4m3fn vs e4m3_fnuz) — not changed here

Tested on AMD Instinct MI355X (gfx950), ROCm 7.0.1:
- Build: compiles cleanly with -DAMDGPU_TARGETS=gfx950
- llama-bench (Qwen2.5-1.5B Q4_K_M, single GPU):
  * f16+FA: 40,013 tok/s prefill, 254 tok/s decode
  * q8_0+FA: functional
- Flash attention: works correctly
- MMQ: works correctly with stream-k dispatch

Co-authored-by: Andy Luo <redacted>
5 months agoggml: backend-agnostic tensor parallelism (experimental) (#19378)
Johannes Gäßler [Thu, 9 Apr 2026 14:42:19 +0000 (16:42 +0200)]
ggml: backend-agnostic tensor parallelism (experimental) (#19378)

* ggml: backend-agnostic tensor parallelism

* support for GPT-OSS, Qwen 3 MoE

* partial Vulkan fix

* add support for 4/8 GPUs

* unconditional peer access

* re-use buffers + ggml contexts

* fix output pattern

* NCCL support

* GGML: HIP: add RCCL support

* Remove shfl and AllReduce from backend interface

* move allocation workaround out of ggml-alloc.c

* 2d tensor set/get support

* Fix the seg fault without NCCL

* Apply suggestion from JohannesGaessler

* support for tensor dims % n_devs != 0

* fix view_offs scaling

* arbitrary num. of GPUs/tensor split

* fix compilation

* better granularity estimate

* Support device-specific host buffer types if all underlying backends expose the same type. This allows using pinned memory instead of pageable memory for CUDA.

Fix compilation errors.

* partial Qwen 3 Next support

* Fix qwen3 30b (#8)

* Fix crash with Qwen-30B-A3B Q4_0

Qwen-30B-A3B Q4_0 has an intermediate dimension of 768. Using a granularity of 256 forces an uneven split between GPUs, which is not supported by the current implementation.

* Decide block size based on tensor quantization type

* Fix crashes due to KV cache serialization (#9)

KV cache serialization requires non-zero offsets on the tensor. Add support in the meta backend to set/get a tensor with a non-zero offset.

* metal : fix build (#7)

* static memory allocations, fix usage count

* fix tensor granularity

* more even memory distribution

* use BF16 for allreduce

* rebase fixup

* better error message for unsupported architectures

* Fix device mismatch during scatter of allReduce. (#11)

There is a mismatch between the dst buffer device and the backend device, causing the use of sync copies

* Enable the previous allreduce implementation. It is better in both perf and stability (#12)

* delay AllReduce for Moe for less I/O

* build : clean-up compile warnings

* backend : move most of the meta backend API to ggml-backend-impl.h

* cont : hide unused public API in the implementation

* llama : use llama_device + remove ggml_backend_dev_is_meta()

* ggml-backend : remove unused alloc include

* minor : remove regex include

* ggml : introduce ggml-ext.h for staging new APIs

* rebase fixup

* fix tests

* llama : more robust logic for determining Meta devices (#16)

* llama : more robust logic for determining Meta devices

* cont : fix devs size check

Co-authored-by: Johannes Gäßler <redacted>
* cont : fix log type

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

Co-authored-by: Johannes Gäßler <redacted>
* disable roundtrip for meta backend

* fix arch selection

* Qwen 3.5 support

* fix Gemma 4 MoE

* fix OpenVino, SYCL

* fix test-llama-archs for CPU-only builds

* Fix Qwen 3.5 MoE

* disable meta backend tests for WebGPU

* tests : filter CPU-based devices from the Meta backend tests (#17)

* meta : formatting, naming, indentation (#18)

* formatting : llama-model.cpp

* formatting : ggml-ext.h

* formatting : ggml-backend-meta.cpp

* meta : add TODO

* add documentation

* better error messages

* fix GPT-OSS

---------

Co-authored-by: Carl Philipp Klemm <redacted>
Co-authored-by: Gaurav Garg <redacted>
Co-authored-by: Georgi Gerganov <redacted>
5 months agoggml : check return value of CUB calls used in argsort and top-k (they all return...
fairydreaming [Thu, 9 Apr 2026 13:17:11 +0000 (15:17 +0200)]
ggml : check return value of CUB calls used in argsort and top-k (they all return cudaError_t) (#21676)

Co-authored-by: Stanisław Szymczyk <redacted>
5 months agorequirements : update transformers to 5.5.1 (#21617)
Daniel Bevenius [Thu, 9 Apr 2026 10:36:29 +0000 (12:36 +0200)]
requirements : update transformers to 5.5.1 (#21617)

* requirements : update transformers to 5.5.0

This commit updates the transformers dependency to version 5.5.0.

The motivation for this is that transformers 5.5.0 includes support for
Gemma4 and is required to be able to convert Gemma4 models. This is also
causing issues for user of gguf-my-repo.

Refs: https://huggingface.co/spaces/ggml-org/gguf-my-repo/discussions/202

* fix huggingface_hub version

* set version of transformers to 5.5.0

* convert : add ty ignore directives to convert_hf_to_gguf.py

This commit adds `ty: ignore` directives to transformers tokenizers
field/methods to avoid type check errors. There might be better ways to
handle this and perhaps this can be done in a follow up commit.

The motivation for this is that it looks like in transformers 5.5.0
AutoTokenizer.from_pretrained can return generic tokenizer types or None
and the type checker now produces an error when the conversion script
accesses field like tokenizer.vocab.

* convert : add ty ignore to suppress type check errors

* convert : remove incorrect type ignores

* convert : fix remaining python checks

I was running a newer version of ty locally but I've switched to
version 0.0.26 which is what CI uses and I was then able to reproduce
the errors. Sorry about the noise.

* update transformers version to 5.5.1

5 months agowebui: add "Send message on Enter" setting (#21577)
JvM [Thu, 9 Apr 2026 10:26:27 +0000 (12:26 +0200)]
webui: add "Send message on Enter" setting (#21577)

* webui: make Enter to send chat a setting

* Shorten description

* Use isMobile hook from $lib/hooks

* Rebuild static output

5 months agocommon : fix ambiguous grammar rule in gemma4 (#21661)
Aldehir Rojas [Thu, 9 Apr 2026 10:25:07 +0000 (05:25 -0500)]
common : fix ambiguous grammar rule in gemma4 (#21661)

* common : fix ambiguous grammar rule in gemma4

* cont : fix missing comma...

5 months agocommon : simplify autoparser tagged parser rules (#21216)
Aldehir Rojas [Thu, 9 Apr 2026 10:24:20 +0000 (05:24 -0500)]
common : simplify autoparser tagged parser rules (#21216)

* common : simplify autoparser tagged parser rules

* cont : remove upper limit on optional args

* cont : revert changes to parsing at the end

* cont : undo arbitrary ordering of optional args

* cont : fix uninitialized required parameters

* revert to simplify merge

* re-apply patches

* restore flexible optional arg ordering tests

5 months agomodel: fix multimodal padding token for gemma3n/gemma4 (#21625)
Xuan-Son Nguyen [Thu, 9 Apr 2026 10:18:23 +0000 (12:18 +0200)]
model: fix multimodal padding token for gemma3n/gemma4 (#21625)

* model: fix multimodal padding token for gemma3n/gemma4

* nits

5 months agomtmd: support dots.ocr (#17575)
Xuan-Son Nguyen [Thu, 9 Apr 2026 10:16:38 +0000 (12:16 +0200)]
mtmd: support dots.ocr (#17575)

* convert gguf

* clip impl

* fix conversion

* wip

* corrections

* update docs

* add gguf to test script

5 months agovocab: add gemma4 tokenizer tests, fix edge case (#21534)
Piotr Wilkin (ilintar) [Thu, 9 Apr 2026 09:41:14 +0000 (11:41 +0200)]
vocab: add gemma4 tokenizer tests, fix edge case (#21534)

* YATF (Yet Another Tokenizer Fix) for Gemma 4. With tests!
* Remove unnecessary hash  from update script.
* minor: move constant

5 months agojinja : support ensure_ascii=true, string repetition and int/float self-filtering...
Kwa Jie Hao [Thu, 9 Apr 2026 09:28:33 +0000 (17:28 +0800)]
jinja : support ensure_ascii=true, string repetition and int/float self-filtering (#21623)

* feat: jinja engine improvements for reka-edge

Port three Jinja engine improvements needed for the reka-edge model:
1. Python-style string repetition ("ab" * 3 → "ababab")
2. ensure_ascii=true support for tojson filter (escapes non-ASCII to \uXXXX)
3. int() builtin on value_int_t (identity, needed for Reka Edge template)

* fix: escape invalid utf8 bytes when ensure_ascii=true

The json_ensure_ascii_preserving_format function does not correctly
handle an edge case where if UTF-8 parsing fails, it adds the non-ascii
character back to the output as a raw byte.

This commit fixes that by adding the unicode standard replacement
character \\ufffd to the output instead. This is the standard behavior
for various programming languages like Python, Rust, Go, etc.

* chore: address PR comments

1. Add todo comment for supporting string repetition for array/tuples
2. Add support for float identity operation
3. Move invalid ascii test case to test_fuzzing

* chore: accept suggestion for common/jinja/value.cpp

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

Co-authored-by: Sigbjørn Skjæret <redacted>
5 months agometal : add missing mm-id specializations for q1_0 (#21662)
Georgi Gerganov [Thu, 9 Apr 2026 07:54:00 +0000 (10:54 +0300)]
metal : add missing mm-id specializations for q1_0 (#21662)

5 months agofix: Model Selector choice sync (#21628)
Aleksander Grygier [Thu, 9 Apr 2026 07:46:27 +0000 (09:46 +0200)]
fix: Model Selector choice sync (#21628)

5 months agoserver : fix grammar commandline args (#21543)
AUTOMATIC1111 [Thu, 9 Apr 2026 07:16:54 +0000 (10:16 +0300)]
server : fix grammar commandline args (#21543)

Co-authored-by: AUTOMATIC <->
5 months agowebui: Add option to pre-encode conversation for faster next turns (#21034)
Aleksander Grygier [Thu, 9 Apr 2026 07:10:18 +0000 (09:10 +0200)]
webui: Add option to pre-encode conversation for faster next turns (#21034)

5 months agosycl : add flash-attn support for head size 512 (#21654)
Akarshan Biswas [Thu, 9 Apr 2026 06:36:48 +0000 (12:06 +0530)]
sycl : add flash-attn support for head size 512 (#21654)

* sycl : add flash-attn support for head size 512

This patch extends the SYCL Flash Attention implementation to support head sizes (DKQ/DV) of 512.

Changes:
- Added DKQ/DV 512 cases to both tile and vector Flash Attention kernels.
- Updated kernel selection logic to allow vector kernels for head sizes up to 512 (previously 256).
- Removed unused/redundant AMD and RDNA-specific configuration functions in `fattn-tile.hpp`.
- Refactored `ggml_backend_sycl_buffer_init_tensor` to use a switch statement for clearer tensor extra buffer initialization.
- Added necessary template instances for the new 512 head size across various quantization types.

* remove defunct mxfp4 reorder from setting buffer type

5 months agoci: drop v5 `all:` composition from labeler.yml (#21627)
Marxist-Leninist [Thu, 9 Apr 2026 06:20:19 +0000 (07:20 +0100)]
ci: drop v5 `all:` composition from labeler.yml (#21627)

actions/labeler@v6 removed the `all:` / `any:` composition keys.
The `server/webui` and `server` entries used `all:` to combine
`any-glob-to-any-file` with negated `all-globs-to-all-files`,
which now errors on every PR with:

    Unknown config options were under "changed-files": all

Flatten both entries to a single `any-glob-to-any-file`. PRs
touching both webui and other server files will now receive both
labels instead of only `server/webui`.

Co-authored-by: Marxist-Leninist <redacted>
5 months agovulkan: unify type macros to use Vx instead of _VECx (#21605)
Ruben Ortlam [Thu, 9 Apr 2026 05:31:51 +0000 (07:31 +0200)]
vulkan: unify type macros to use Vx instead of _VECx (#21605)

5 months agocommon : skip non-primary GGUF split files when selecting model (#21633)
Adrien Gallouët [Thu, 9 Apr 2026 05:28:06 +0000 (07:28 +0200)]
common : skip non-primary GGUF split files when selecting model (#21633)

We should not assume files are listed in order.

Signed-off-by: Adrien Gallouët <redacted>
5 months agoCUDA: also store `node->src->data` ptrs for equality check (#21635)
Aman Gupta [Wed, 8 Apr 2026 17:01:56 +0000 (01:01 +0800)]
CUDA: also store `node->src->data` ptrs for equality check (#21635)

* CUDA: also store node->src->data ptrs for equality check

* address review comments

5 months agofix: free ctx_copy in ggml_opt_free to plug per-training-session leak (#21592)
RealOrko [Wed, 8 Apr 2026 15:40:15 +0000 (16:40 +0100)]
fix: free ctx_copy in ggml_opt_free to plug per-training-session leak (#21592)

* fix: free ctx_copy in ggml_opt_free to plug per-training-session leak

ggml_opt_alloc populates opt_ctx->ctx_copy via a free+init pair every
time the allocated graph shape changes. The last ctx_copy from the
final ggml_opt_alloc call survives until ggml_opt_free is invoked,
but ggml_opt_free was only freeing ctx_static and ctx_cpu, never
ctx_copy. Each opt_ctx lifetime therefore leaks the final per-batch
context — ~900 KB for a typical GNN training session in
sindarin-pkg-tensor, surfaced via AddressSanitizer.

ctx_copy is nullptr-initialized and ggml_free() handles NULL safely,
so the new release is guard-free.

* Update ggml/src/ggml-opt.cpp

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

Co-authored-by: realorko <redacted>
Co-authored-by: Johannes Gäßler <redacted>
5 months agoserver: respect the ignore eos flag (#21203)
Yuri Khrustalev [Wed, 8 Apr 2026 15:12:15 +0000 (11:12 -0400)]
server: respect the ignore eos flag (#21203)

5 months agovocab : remove </s> eog token if gemma4 (#21492)
Aldehir Rojas [Wed, 8 Apr 2026 14:53:06 +0000 (09:53 -0500)]
vocab : remove </s> eog token if gemma4 (#21492)

5 months agowebui : send both backend_sampling == false/true (#18781)
Georgi Gerganov [Wed, 8 Apr 2026 14:35:52 +0000 (17:35 +0300)]
webui : send both backend_sampling == false/true (#18781)

* webui : send both backend_sampling == false/true

* feat: Parameter sync

---------

Co-authored-by: Aleksander Grygier <redacted>
5 months agoPropose fix a couple of typos (#21581)
John Eismeier [Wed, 8 Apr 2026 14:29:03 +0000 (10:29 -0400)]
Propose fix a couple of typos (#21581)

Signed-off-by: John E <redacted>
5 months agokv-cache : extend cache quantization checks (#21586)
Erik Scholz [Wed, 8 Apr 2026 13:08:57 +0000 (15:08 +0200)]
kv-cache : extend cache quantization checks (#21586)

to also check for enabled flash attention, instead of just auto.

5 months agowebgpu : Query for adapter support when registering WebGPU backend (#21579)
Reese Levine [Wed, 8 Apr 2026 13:08:29 +0000 (06:08 -0700)]
webgpu : Query for adapter support when registering WebGPU backend (#21579)

5 months agometal: Q1_0 backend (#21528)
Pasha Khosravi [Wed, 8 Apr 2026 13:07:47 +0000 (06:07 -0700)]
metal: Q1_0 backend (#21528)

* initial Q1_0 Metal backend

* tuning q1_0 metal kernels

* add Q1_0 to test-backend-ops

* add Q1_0<->F32 copy test

* Apply suggestions from code review

Co-authored-by: Georgi Gerganov <redacted>
---------

Co-authored-by: Georgi Gerganov <redacted>
5 months agogemma : perform per-layer projections in the first layer (#21612)
Georgi Gerganov [Wed, 8 Apr 2026 13:06:30 +0000 (16:06 +0300)]
gemma : perform per-layer projections in the first layer (#21612)

* gemma : reduce graph splits by keeping per-layer ops in the input layer

* gemma : put the per-layer proj in the first layer

* cont : move the projection before the layer loop

5 months agoexamples : disable cb_eval callback for --save-logits (#21553)
Daniel Bevenius [Wed, 8 Apr 2026 12:10:33 +0000 (14:10 +0200)]
examples : disable cb_eval callback for --save-logits (#21553)

This commit updates the debug example to not create the
base_callback_data.

The motivation for this is when using `--save-logits`, which is used by
examples/model-conversion scripts, we often don't care about the tensor
outputs and they just add noise to the output. This changes is quiet by
default we can always remove --save-logits to get the tensor outputs
when debugging.

5 months agoparser: fix MiniMax handling (#21573)
Piotr Wilkin (ilintar) [Wed, 8 Apr 2026 10:47:25 +0000 (12:47 +0200)]
parser: fix MiniMax handling (#21573)

5 months agotests : remove obsolete .mjs script (#21615)
Georgi Gerganov [Wed, 8 Apr 2026 10:20:46 +0000 (13:20 +0300)]
tests : remove obsolete .mjs script (#21615)

5 months agochore: Update labeler to have separate labels for `server/webui` and `server` changes...
Aleksander Grygier [Wed, 8 Apr 2026 08:35:31 +0000 (10:35 +0200)]
chore: Update labeler to have separate labels for `server/webui` and `server` changes (#21567)

5 months agochore: Remove legacy files (#21606)
Aleksander Grygier [Wed, 8 Apr 2026 07:55:08 +0000 (09:55 +0200)]
chore: Remove legacy files (#21606)

5 months agomodel : support step3-vl-10b (#21287)
forforever73 [Wed, 8 Apr 2026 07:51:31 +0000 (15:51 +0800)]
model : support step3-vl-10b (#21287)

* feat: support step3-vl-10b

* use fused QKV && mapping tensor in tensor_mapping.py

* guard hardcoded params and drop crop metadata

* get understand_projector_stride from global config

* img_u8_resize_bilinear_to_f32 move in step3vl class

* Apply suggestions from code review

Co-authored-by: Sigbjørn Skjæret <redacted>
* fix the \r\n mess

* add width and heads to MmprojModel.set_gguf_parameters

---------

Co-authored-by: Sigbjørn Skjæret <redacted>
5 months agowebui: fix syntax highlighting lost after streaming for non-common languages (#21206)
Hamish M. Blair [Wed, 8 Apr 2026 06:58:08 +0000 (23:58 -0700)]
webui: fix syntax highlighting lost after streaming for non-common languages (#21206)

* webui: fix syntax highlighting lost for non-common languages after streaming

rehype-highlight uses lowlight internally, which only bundles 37 "common"
languages. The streaming code path uses highlight.js directly (192 languages),
so languages like Haskell highlight correctly while streaming but lose all
color once the code block closes. Pass the full lowlight language set to
rehype-highlight so both paths support the same languages.

* webui: rebuild static files after rebase

5 months agodevops: kleidiai: provide KleidiAI-Enabled ARM Release Artifact (#21259)
Martin Klacer [Wed, 8 Apr 2026 05:06:12 +0000 (06:06 +0100)]
devops: kleidiai: provide KleidiAI-Enabled ARM Release Artifact (#21259)

* Unified macOS release setup with strategy-matrix block
 * Added KleidiAI arm64 macOS release definition

Change-Id: I05520889ffc646488a178d06817a17f29274465a

Signed-off-by: Martin Klacer <redacted>
5 months agoCUDA: make cuda graphs props check faster (#21472)
Aman Gupta [Wed, 8 Apr 2026 01:05:51 +0000 (09:05 +0800)]
CUDA: make cuda graphs props check faster (#21472)

* CUDA: compute fast hash instead of expensive props check

* use seen node

* use memcp

5 months agoggml-cuda: ds_read_b128 for q4_0 and q4_1 mmq kernels (#21168)
iacopPBK [Tue, 7 Apr 2026 19:47:42 +0000 (21:47 +0200)]
ggml-cuda: ds_read_b128 for q4_0 and q4_1 mmq kernels (#21168)

* ds_read_b128 for q4_0 and q4_1 mmq kernels

     Current for loop generates ds_read_b32 instructions with hip compiler, the new solution generates ds_read_b128 instructions for the same operation, saving some LDS bandwidth. Tested on MI50 and RX6800XT, its faster on both.

* Vectorized lds load update: used ggml_cuda_get_max_cpy_bytes and ggml_cuda_memcpy_1 functions for generic implementation

* Explicit for loop in mmq, renamed vec into tmp

* Fixed max_cpy usage in the loading loop

* Fixed typo in q4_1 kernel

* Update ggml/src/ggml-cuda/mmq.cuh

Co-authored-by: Johannes Gäßler <redacted>
* Update ggml/src/ggml-cuda/mmq.cuh

Co-authored-by: Johannes Gäßler <redacted>
* Update ggml/src/ggml-cuda/mmq.cuh

Co-authored-by: Johannes Gäßler <redacted>
* Renoved trailing white line 500

* Update mmq.cuh removed other whitelines

* Remove trailing whitespaces

---------

Co-authored-by: iacopPBK <redacted>
Co-authored-by: Johannes Gäßler <redacted>
Co-authored-by: iacopPBK <redacted>
5 months agogguf-py : fix missing comma after bad merge in tensor-mapping (#21558)
Daniel Bevenius [Tue, 7 Apr 2026 19:24:25 +0000 (21:24 +0200)]
gguf-py : fix missing comma after bad merge in tensor-mapping (#21558)

This commit adds a missing comma in the vision encoder attention qkv
block.

The motivation for this change is that without the comma there will be
a string concatenation of the Kimi-K2.5 and the Nemotron Nano v2 VL
tensor mappings which will be broken.

5 months agokv-cache : support attention rotation for heterogeneous iSWA (#21513)
Georgi Gerganov [Tue, 7 Apr 2026 17:31:28 +0000 (20:31 +0300)]
kv-cache : support attention rotation for heterogeneous iSWA (#21513)

* kv-cache : support attention rotation for heterogeneous iSWA

* cont : remove assert

5 months agoggml-webgpu: parameterize submission size and add iOS specific limits (#21533)
Reese Levine [Tue, 7 Apr 2026 17:30:01 +0000 (10:30 -0700)]
ggml-webgpu: parameterize submission size and add iOS specific limits (#21533)

* Work towards removing bitcast

* Move rest of existing types over

* Add timeout back to wait and remove synchronous set_tensor/memset_tensor

* move to unpackf16 for wider compatibility

* cleanup

* Remove deadlock condition in free_bufs

* Start work on removing parameter buffer pools

* Simplify and optimize further

* simplify profile futures

* Fix stride

* Try using a single command buffer per batch

* formatting

* Add parameters for different browsers in-flight submissions

* Update handling of batch size too

* Throttle ios as much as possible

* Increase timeout for llvm-pipe testing

5 months agoCUDA: check for buffer overlap before fusing (#21566)
Aman Gupta [Tue, 7 Apr 2026 16:57:04 +0000 (00:57 +0800)]
CUDA: check for buffer overlap before fusing (#21566)

* CUDA: check for buffer overlap before fusing

* use ggml_cuda_check_fusion_memory_ranges

5 months agollama-server: fix model params not propagated (#21509)
Aaron Teo [Tue, 7 Apr 2026 13:39:41 +0000 (21:39 +0800)]
llama-server: fix model params not propagated (#21509)

Signed-off-by: Aaron Teo <redacted>
5 months agounicode : add custom Qwen2 regex handler to fix segfault on long input (#21257)
Son H. Nguyen [Tue, 7 Apr 2026 13:13:38 +0000 (22:13 +0900)]
unicode : add custom Qwen2 regex handler to fix segfault on long input (#21257)

* unicode : add custom Qwen2 regex handler to fix segfault on long input

std::regex uses recursive backtracking internally, which causes a stack
overflow (segfault) when tokenizing long sequences of repeated characters
(e.g. 43K 'A's). The Qwen2 tokenizer regex differs from Llama3 only in
the digit pattern (\p{N} vs \p{N}{1,3}), so it was falling through to
the std::regex fallback path instead of using a custom handler.

Add unicode_regex_split_custom_qwen2() following the established pattern
used by gpt2, llama3, kimi_k2, and afmoe custom handlers.

Closes: https://github.com/ggml-org/llama.cpp/issues/21113
* cont : remove TODO comment

* cont : update comment to reflect original regex

* use the correct regex in the comment this time... [no ci]

---------

Co-authored-by: Aldehir Rojas <redacted>
5 months agollama: remove per-arch tensor name lists (#21531)
Johannes Gäßler [Tue, 7 Apr 2026 13:02:03 +0000 (15:02 +0200)]
llama: remove per-arch tensor name lists (#21531)

5 months agoserver : fix restore for checkpoints with pos_min == 0 (#21510)
Georgi Gerganov [Tue, 7 Apr 2026 12:29:17 +0000 (15:29 +0300)]
server : fix restore for checkpoints with pos_min == 0 (#21510)

5 months agoggml : deprecate GGML_OP_ADD1 (#21363)
Georgi Gerganov [Tue, 7 Apr 2026 12:28:27 +0000 (15:28 +0300)]
ggml : deprecate GGML_OP_ADD1 (#21363)

* ggml : deprecate GGML_OP_ADD1

* cont : remove tests

* cont : re-enable vulkan check

5 months agoggml: Vulkan build, Linux -- output error string for errno on fork failure (#20868...
Tom Overlund [Tue, 7 Apr 2026 11:54:55 +0000 (07:54 -0400)]
ggml: Vulkan build, Linux -- output error string for errno on fork failure (#20868) (#20904)

5 months agovulkan: add FA dequant for q4_1, q5_0, q5_1, iq4_nl (#21029)
mkoker [Tue, 7 Apr 2026 11:41:29 +0000 (07:41 -0400)]
vulkan: add FA dequant for q4_1, q5_0, q5_1, iq4_nl (#21029)

Add dequantize4() implementations for Q4_1, Q5_0, Q5_1, and IQ4_NL
in the flash attention base shader. Register them in the shader
generator, pipeline creation, and enable in the scalar/coopmat1 FA
support check.

5 months agowebui : store reasoning_content so it is sent back in subsequent requests (#21249)
Aldehir Rojas [Tue, 7 Apr 2026 11:32:44 +0000 (06:32 -0500)]
webui : store reasoning_content so it is sent back in subsequent requests (#21249)

5 months agoggml-cuda : fix CDNA2 compute capability constant for gfx90a (MI210) (#21519)
Antoine Viallon [Tue, 7 Apr 2026 10:18:55 +0000 (12:18 +0200)]
ggml-cuda : fix CDNA2 compute capability constant for gfx90a (MI210) (#21519)

GGML_CUDA_CC_CDNA2 was set to 0x910
Fix by setting the constant to 0x90a to match the actual gfx90a ISA.

5 months agofix: Detect streaming state in reasoning content blocks (#21549)
Aleksander Grygier [Tue, 7 Apr 2026 10:04:41 +0000 (12:04 +0200)]
fix: Detect streaming state in reasoning content blocks (#21549)

5 months agoFix rtl text rendering (#21382)
Kabir08 [Tue, 7 Apr 2026 09:37:20 +0000 (15:07 +0530)]
Fix rtl text rendering (#21382)

* Fix Arabic RTL text rendering in web UI

- Add dir='auto' attributes to markdown containers and blocks
- Implement post-processing to add dir='auto' to all text elements
- Replace directional CSS properties with logical properties for proper RTL list alignment
- Ensure bidirectional text support for mixed Arabic/English content

* Clean up commented duplicate function

Remove the commented-out duplicate transformMdastNode function
that was left over from refactoring.

* Fix Arabic RTL text rendering in web UI

- Add dir='auto' attributes to markdown containers and blocks
- Implement post-processing to add dir='auto' to all text elements
- Replace directional CSS properties with logical properties for proper RTL list alignment
- Minor code formatting improvements

This ensures bidirectional text support for mixed Arabic/English content in the llama.cpp web UI.

* Implement rehype plugin for comprehensive RTL text support

- Add rehypeRtlSupport plugin that applies dir='auto' to all elements with children
- Replace DOMParser-based approach with efficient HAST tree processing
- Remove hardcoded element lists for better maintainability
- Ensure proper bidirectional text rendering for mixed RTL/LTR content

* Fix RTL text rendering with rehype plugin and cleanup

* fix: prettier formatting

5 months ago[SYCL] Add Q8_0 reorder optimization (~3x tg speedup on Intel Arc) (#21527)
PMZFX [Tue, 7 Apr 2026 08:12:49 +0000 (04:12 -0400)]
[SYCL] Add Q8_0 reorder optimization (~3x tg speedup on Intel Arc) (#21527)

Extend the existing reorder optimization to Q8_0. The reorder
separates scale factors from weight data for coalesced memory
access -- was implemented for Q4_0/Q4_K/Q6_K but Q8_0 was missing.

On Arc Pro B70 (Xe2), Q8_0 tg goes from 4.88 to 15.24 t/s (3.1x)
on Qwen3.5-27B. BW utilization: 21% -> 66%.

The key fix beyond the kernels: Q8_0 was missing from the type
check in ggml_backend_sycl_buffer_init_tensor() that allocates
the extra struct carrying the reorder flag -- so the optimization
was silently skipped.

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.

Fixes: #21517
5 months agodocs: fix typo in build.md (emdawbwebgpu -> emdawnwebgpu) (#21518)
Dmytro Romanov [Tue, 7 Apr 2026 04:37:26 +0000 (06:37 +0200)]
docs: fix typo in build.md (emdawbwebgpu -> emdawnwebgpu) (#21518)

5 months agoggml-webgpu: Add the support of `MUL_MAT_ID` (#21147)
Masashi Yoshimura [Mon, 6 Apr 2026 20:08:46 +0000 (05:08 +0900)]
ggml-webgpu: Add the support of `MUL_MAT_ID` (#21147)

* Add mul_mat_id support to WebGPU

* Apply suggestion from @reeselevine

---------

Co-authored-by: Reese Levine <redacted>
5 months agoggml: add Q1_0 1-bit quantization support (CPU) (#21273)
Pasha Khosravi [Mon, 6 Apr 2026 18:55:21 +0000 (11:55 -0700)]
ggml: add Q1_0 1-bit quantization support (CPU) (#21273)

* ggml: add Q1_0 and Q1_0_g128 1-bit quantization support (CPU)

* add generic fallback for x86

* remove Q1_0 (group size 32)

* rename Q1_0_g128 => Q1_0

* fix Q1_0 LlamaFileType Enum

* Fix trailing spaces; add generic fallback for othre backends

* Apply suggestions from code review

Co-authored-by: Sigbjørn Skjæret <redacted>
* fix /r/n spacing + arch-fallback

---------

Co-authored-by: Sigbjørn Skjæret <redacted>
5 months agocli: fix stripping of \n in multiline input (#21485) upstream/0.0.8681
Bipin Yadav [Mon, 6 Apr 2026 18:54:06 +0000 (00:24 +0530)]
cli: fix stripping of \n in multiline input (#21485)

* llama-cli: fix stripping of \n in multiline input

* Change & string to string_view

* Apply suggestions from code review

Co-authored-by: Sigbjørn Skjæret <redacted>
* Fix EditorConfig linter error

---------

Co-authored-by: Sigbjørn Skjæret <redacted>
5 months ago[CUDA ] Write an optimized flash_attn_stream_k_fixup kernel (#21159)
Gaurav Garg [Mon, 6 Apr 2026 18:34:29 +0000 (00:04 +0530)]
[CUDA ] Write an optimized flash_attn_stream_k_fixup kernel (#21159)

* Write an optimized flash_attn_stream_k_fixup kernel

Write a specialized and more optimized kernel for cases where nblocks_stream_k is multiple of ntiles_dst.
Make nblocks_stream_k to multiple of ntiles_dst if nblocks_stream_k > 2 * ntiles_dst

* Use the new kernel only for nblocks_stream_k_raw > 4 * ntiles_dst to make sure we have enough concurrency on GPUs

* Address review comments

* Address review comments

* Revert variable names to original

5 months agollama-bench: add `-fitc` and `-fitt` to arguments (#21304)
Aman Gupta [Mon, 6 Apr 2026 14:26:02 +0000 (22:26 +0800)]
llama-bench: add `-fitc` and `-fitt` to arguments (#21304)

* llama-bench: add `-fitc` and `-fitt` to arguments

* update README.md

* address review comments

* update compare-llama-bench.py

5 months agovocab : add byte token handling to BPE detokenizer for Gemma4 (#21488)
Aldehir Rojas [Mon, 6 Apr 2026 14:08:37 +0000 (09:08 -0500)]
vocab : add byte token handling to BPE detokenizer for Gemma4 (#21488)

5 months agoconvert : fix block_ff_dim retrieval for lfm2 (#21508)
Sigbjørn Skjæret [Mon, 6 Apr 2026 12:05:18 +0000 (14:05 +0200)]
convert : fix block_ff_dim retrieval for lfm2 (#21508)

5 months agoserver : handle unsuccessful sink.write in chunked stream provider (#21478)
lainon1 [Mon, 6 Apr 2026 12:03:02 +0000 (13:03 +0100)]
server : handle unsuccessful sink.write in chunked stream provider (#21478)

Check the return value of sink.write() in the chunked content provider
and return false when the write fails, matching cpp-httplib's own
streaming contract. This prevents logging chunks as sent when the sink
rejected them and properly aborts the stream on connection failure.

5 months agodocs: add hunyuan-ocr gguf, also add test [no ci] (#21490)
Xuan-Son Nguyen [Mon, 6 Apr 2026 12:02:37 +0000 (14:02 +0200)]
docs: add hunyuan-ocr gguf, also add test [no ci] (#21490)

5 months agoconvert : set "add bos" == True for Gemma 4 (#21500)
Georgi Gerganov [Mon, 6 Apr 2026 10:52:07 +0000 (13:52 +0300)]
convert : set "add bos" == True for Gemma 4 (#21500)

* convert : set "add bos" == True for Gemma 4

* cont : handle old GGUFs

5 months agosycl : handle other FA case (#21377)
Neo Zhang [Mon, 6 Apr 2026 10:28:00 +0000 (18:28 +0800)]
sycl : handle other FA case (#21377)

5 months agohexagon: slight optimization for argosrt output init (#21463)
Yarden Tal [Mon, 6 Apr 2026 01:30:25 +0000 (04:30 +0300)]
hexagon: slight optimization for argosrt output init (#21463)

5 months agollama : correct platform-independent loading of BOOL metadata (#21428)
anchortense [Sun, 5 Apr 2026 23:40:38 +0000 (09:40 +1000)]
llama : correct platform-independent loading of BOOL metadata (#21428)

* model-loader : fix GGUF bool array conversion

* model-loader : fix remaining GGUF bool pointer uses

5 months agomodel : add HunyuanOCR support (#21395)
Richard Davison [Sun, 5 Apr 2026 21:32:14 +0000 (23:32 +0200)]
model : add HunyuanOCR support (#21395)

* HunyuanOCR: add support for text and vision models

- Add HunyuanOCR vision projector (perceiver-based) with Conv2d merge
- Add separate HUNYUAN_OCR chat template (content-before-role format)
- Handle HunyuanOCR's invalid pad_token_id=-1 in converter
- Fix EOS/EOT token IDs from generation_config.json
- Support xdrope RoPE scaling type
- Add tensor mappings for perceiver projector (mm.before_rms, mm.after_rms, etc.)
- Register HunYuanVLForConditionalGeneration for both text and mmproj conversion

* fix proper mapping

* Update gguf-py/gguf/tensor_mapping.py

Co-authored-by: Xuan-Son Nguyen <redacted>
* Update tools/mtmd/clip.cpp

Co-authored-by: Xuan-Son Nguyen <redacted>
* address comments

* update

* Fix typecheck

* Update convert_hf_to_gguf.py

Co-authored-by: Sigbjørn Skjæret <redacted>
* Update convert_hf_to_gguf.py

Co-authored-by: Sigbjørn Skjæret <redacted>
* Update convert_hf_to_gguf.py

Co-authored-by: Sigbjørn Skjæret <redacted>
* Update convert_hf_to_gguf.py

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

Co-authored-by: Xuan-Son Nguyen <redacted>
Co-authored-by: Sigbjørn Skjæret <redacted>
5 months agoci : use default RISE RISC-V Runners (#21263)
Ludovic Henry [Sun, 5 Apr 2026 18:29:48 +0000 (20:29 +0200)]
ci : use default RISE RISC-V Runners (#21263)