]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/log
pkg/ggml/sources/llama.cpp
5 weeks agoci : separate webui from server (#18072)
Sigbjørn Skjæret [Tue, 16 Dec 2025 07:17:26 +0000 (08:17 +0100)]
ci : separate webui from server (#18072)

* separate webui from server

* add public to path

5 weeks agowebui: Improve copy to clipboard with text attachments (#17969)
Aleksander Grygier [Tue, 16 Dec 2025 06:38:46 +0000 (07:38 +0100)]
webui: Improve copy to clipboard with text attachments (#17969)

* feat: Create copy/paste user message including "pasted text" attachments

* chore: update webui build output

* chore: update webui static output

* fix: UI issues

* chore: update webui static output

* fix: Decode HTML entities using `DOMParser`

* chore: update webui build output

* chore: update webui static output

5 weeks agowebui: Add setting to always show sidebar on Desktop (#17809)
Aleksander Grygier [Tue, 16 Dec 2025 06:31:37 +0000 (07:31 +0100)]
webui: Add setting to always show sidebar on Desktop (#17809)

* feat: Add setting to always show Sidebar on Desktop

* chore: update webui build output

* feat: Add auto-show sidebar setting

* fix: Mobile settings dialog UI

* chore: update webui build output

* feat: UI label update

* chore: update webui build output

* chore: update webui build output

* chore: update webui build output

* refactor: Cleanup

* chore: update webui build output

5 weeks agollama : add support for NVIDIA Nemotron 3 Nano (#18058)
Daniel Bevenius [Tue, 16 Dec 2025 06:19:26 +0000 (07:19 +0100)]
llama : add support for NVIDIA Nemotron 3 Nano (#18058)

* llama : add support for NVIDIA Nemotron Nano 3

This commit adds support for the NVIDIA Nemotron Nano 3 model, enabling
the conversion and running of this model.

Co-authored-by: Georgi Gerganov <redacted>
5 weeks agoWebui: Disable attachment button and model selector button when prompt textbox is...
Darius Lukas [Tue, 16 Dec 2025 06:15:49 +0000 (01:15 -0500)]
Webui: Disable attachment button and model selector button when prompt textbox is disabled. (#17925)

* Pass disabled state to the file attachments button and the model
selector button.

* Update index.html.gz

* Fix model info card in non-router mode.

* Update index.html.gz

5 weeks agoconvert : move rope_parameters to TextModel class (#18061)
Sigbjørn Skjæret [Mon, 15 Dec 2025 21:03:16 +0000 (22:03 +0100)]
convert : move rope_parameters to TextModel class (#18061)

* make sure to search text_config for rope parameters

* move rope_parameters to TextModel class

5 weeks agoggml-hexagon: mm for mtmd (#17894)
Shouyu [Mon, 15 Dec 2025 18:53:56 +0000 (13:53 -0500)]
ggml-hexagon: mm for mtmd  (#17894)

* feat: add run_mtmd script for hexagon

* fix: fix issue in fp16xfp32 mm

* fix: remove opt_experiment for fp16xfp32 mm

* fix: ggml-hexagon: matmul fp16xfp32 support non-contigious src0

* fix: fix syntax check for run-mtmd.sh for cli

5 weeks agomodel : add KORMo model (#18032)
HelloKS [Mon, 15 Dec 2025 17:51:43 +0000 (02:51 +0900)]
model : add KORMo model (#18032)

* vocab: add KORMo Tokenizer

* model: add KORMoForCausalLM

* vocab: change pretokenizer to qwen2

* lint: fix unintended line removal

* model: make qwen2 bias tensor optional

* model: use qwen2 architecture for KORMo

5 weeks agokv-cache: Fix state restore fragmented cache (#17982)
ssweens [Mon, 15 Dec 2025 17:28:35 +0000 (09:28 -0800)]
kv-cache: Fix state restore fragmented cache (#17982)

* kv-cache : fix state restore with fragmented cache (#17527)

Change find_slot to allow non-contiguous allocation during state restore. Fixes 'failed to find available cells in kv cache' error when restoring state to fragmented cache.

* tests : update logic

* cleanup: tightened state_read_meta sig, added is_contiguous case

* fix: state_read_meta arg reorder loose ends

---------

Co-authored-by: Georgi Gerganov <redacted>
5 weeks agoFix unreadable user markdown colors and truncate long texts in deletion dialogs ...
Pascal [Mon, 15 Dec 2025 15:34:53 +0000 (16:34 +0100)]
Fix unreadable user markdown colors and truncate long texts in deletion dialogs (#17555)

* webui: limit conversation name length in dialogs

* webui: fix unreadable colors on links and table cell hover in user markdown

* webui: keep table borders visible in user markdown

* webui: updating unified exports

* Update tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentThumbnailFile.svelte

Co-authored-by: Aleksander Grygier <redacted>
* chore: update webui build output

* chore: update webui build output

* chore: update webui build output

---------

Co-authored-by: Aleksander Grygier <redacted>
5 weeks agometal: use shared buffers on eGPU (#17866)
Jeremy Demeule [Mon, 15 Dec 2025 14:14:49 +0000 (15:14 +0100)]
metal: use shared buffers on eGPU (#17866)

* metal: use shared buffers on eGPU

With #15906, I noticed on important regression when using metal backend on eGPU.
This commit restore the previous behavior and add an option to force its activation.

* metal: use shared buffers on eGPU

* metal: use shared buffers on eGPU

5 weeks agomtmd: refactor audio preprocessing (#17978)
Xuan-Son Nguyen [Mon, 15 Dec 2025 13:16:52 +0000 (14:16 +0100)]
mtmd: refactor audio preprocessing (#17978)

* mtmd: refactor audio preprocessing

* refactor

Co-authored-by: Tarek <redacted>
* wip

* wip (2)

* improve constructor

* fix use_natural_log

* fix padding for short input

* clean up

* remove need_chunking

---------

Co-authored-by: Tarek <redacted>
5 weeks agocli: fixed dead links to tools/main for cli and completion, fixed code owners (#17993)
Andrew Aladjev [Mon, 15 Dec 2025 10:47:04 +0000 (13:47 +0300)]
cli: fixed dead links to tools/main for cli and completion, fixed code owners (#17993)

Co-authored-by: Andrew Aladjev <redacted>
5 weeks agowebui: add "delete all conversations" button to import/export tab (#17444)
Thomas Jarosch [Mon, 15 Dec 2025 10:29:29 +0000 (11:29 +0100)]
webui: add "delete all conversations" button to import/export tab (#17444)

* webui: add "delete all conversations" button to import/export tab

- Add 'Delete all conversations' functionality with confirmation dialog
- Add Trash icon and destructive styling for clear visual indication
- Redirects to "?new_chat=true#/" by using conversationsStore.deleteAll()

* chore: update webui build output

5 weeks agollama: automatically set parameters not set by the user in such a way that maximizes...
Johannes Gäßler [Mon, 15 Dec 2025 08:24:59 +0000 (09:24 +0100)]
llama: automatically set parameters not set by the user in such a way that maximizes GPU utilization (#16653)

* llama: automatically fit args to free memory

llama-fit-params tool

* fix CI

* hints for bug reports, ensure no reallocation

* fix segfault with Vulkan

* add llama-fit-params to CI

* fix CI

* fix CI

* fix CI

* minor adjustments

* fix assignment of 1 dense layer

* fix logger not being reset on model load failure

* remove --n-gpu-layer hint on model load failure

* fix llama-fit-params verbosity

* fix edge case

* fix typo [no ci]

5 weeks ago[SYCL] Support gpt-oss by OPs add-id, mul_mat for mxfp4, swiglu_oai (#17826)
Neo Zhang Jianyu [Mon, 15 Dec 2025 02:35:15 +0000 (10:35 +0800)]
[SYCL] Support gpt-oss by OPs add-id, mul_mat for mxfp4, swiglu_oai (#17826)

* support gpt-oss GPU by OP add-id, mul_mat for mxfp4, swiglu_oai, fix warning

* fix fault ut case, update ops.md

* rebase, fix format issue

5 weeks agomodel : add glm-asr support (#17901)
piDack [Mon, 15 Dec 2025 02:18:46 +0000 (10:18 +0800)]
model : add glm-asr support (#17901)

* [model] add glm-asr support

* fix format for ci

* fix convert format for ci

* update glm_asr convert script & use build_ffn for glm_asr clip & use build_stack for padding and review

* check root architecture for convert hf script

* fix conficlt with upstream

* fix convert script for glm asr & format clip-impl

* format

* restore hparams text

* improved conversion

---------

Co-authored-by: Sigbjørn Skjæret <redacted>
6 weeks agopreset: handle negated arg, reverse the meaning if needed (#18041)
Xuan-Son Nguyen [Sun, 14 Dec 2025 21:08:10 +0000 (22:08 +0100)]
preset: handle negated arg, reverse the meaning if needed (#18041)

6 weeks agoconvert : refactor rope scaling handling (#18013)
Sigbjørn Skjæret [Sun, 14 Dec 2025 15:04:37 +0000 (16:04 +0100)]
convert : refactor rope scaling handling (#18013)

* refactor rope scaling handling

* ws--

* missed a couple

* use find_hparam

6 weeks agomtmd: enhance image resizing in llava_uhd (#18014)
Haowei Wu [Sun, 14 Dec 2025 14:57:52 +0000 (22:57 +0800)]
mtmd: enhance image resizing in llava_uhd (#18014)

6 weeks agovulkan: fix mul_mat_vec_iq1_s formatting (#18026)
Ruben Ortlam [Sun, 14 Dec 2025 13:52:46 +0000 (14:52 +0100)]
vulkan: fix mul_mat_vec_iq1_s formatting (#18026)

6 weeks agograph: add f_attn_temp_offset (#18025)
Xuan-Son Nguyen [Sun, 14 Dec 2025 12:05:59 +0000 (13:05 +0100)]
graph: add f_attn_temp_offset (#18025)

6 weeks agocommon : refactor common_sampler + grammar logic changes (#17937)
Georgi Gerganov [Sun, 14 Dec 2025 08:11:13 +0000 (10:11 +0200)]
common : refactor common_sampler + grammar logic changes (#17937)

* common : refactor common_sampler + grammar logic changes

* tests : increase max_tokens to get needed response

* batched : fix uninitialized samplers

6 weeks agovulkan: Fix data race/hang in scalar/cm1 flash attention (#17887)
Jeff Bolz [Sun, 14 Dec 2025 08:00:00 +0000 (02:00 -0600)]
vulkan: Fix data race/hang in scalar/cm1 flash attention (#17887)

6 weeks agovulkan: improve mul_mat_vec_iq1_s speed (#17874)
lovedheart [Sun, 14 Dec 2025 07:47:49 +0000 (08:47 +0100)]
vulkan: improve mul_mat_vec_iq1_s speed (#17874)

6 weeks agovulkan: faster q6_k matmul (#17813)
Eve [Sun, 14 Dec 2025 07:29:37 +0000 (07:29 +0000)]
vulkan: faster q6_k matmul (#17813)

* q6_k faster mul mat

* 8 values

* fix comment

* switch to two at a time

* start ci for .glsl files

6 weeks agomodel-conversion : cast logits to float32 (#18009)
Georgi Gerganov [Sun, 14 Dec 2025 06:58:13 +0000 (08:58 +0200)]
model-conversion : cast logits to float32 (#18009)

6 weeks agomodels : fix YaRN regression + consolidate logic (#18006)
Georgi Gerganov [Sun, 14 Dec 2025 06:34:56 +0000 (08:34 +0200)]
models : fix YaRN regression + consolidate logic (#18006)

* models : fix YaRN regression + consolidate logic

* cont : fix the fix

* cont : remove header

* cont : add header

6 weeks agoggml : arm repack fix build
Georgi Gerganov [Sat, 13 Dec 2025 20:54:14 +0000 (22:54 +0200)]
ggml : arm repack fix build

6 weeks agosync : ggml
Georgi Gerganov [Sat, 13 Dec 2025 08:07:07 +0000 (10:07 +0200)]
sync : ggml

6 weeks agoggml : arm repack fix build (whisper/0)
Georgi Gerganov [Sat, 13 Dec 2025 06:04:09 +0000 (08:04 +0200)]
ggml : arm repack fix build (whisper/0)

6 weeks agocmake : set `CMAKE_RUNTIME_OUTPUT_DIRECTORY` for non standalone build (ggml/1394)
Congcong Cai [Fri, 12 Dec 2025 14:37:38 +0000 (22:37 +0800)]
cmake : set `CMAKE_RUNTIME_OUTPUT_DIRECTORY` for non standalone build (ggml/1394)

Some backend depends on CMAKE_RUNTIME_OUTPUT_DIRECTORY to create temporary file like metal backened.
Missing CMAKE_RUNTIME_OUTPUT_DIRECTORY will cause some cmake error like permission denied (try to copy file to root).
This PR wants to setup a default path for CMAKE_RUNTIME_OUTPUT_DIRECTORY when it does not exist.

6 weeks agoscripts: add script to compare logprobs of llama.cpp against other frameworks (#17947)
Xuan-Son Nguyen [Sat, 13 Dec 2025 21:33:29 +0000 (22:33 +0100)]
scripts: add script to compare logprobs of llama.cpp against other frameworks (#17947)

* scripts: add script to compare logits of llama.cpp against other frameworks

* accept custom prompt file

* fix code style

* clarify endpoint

* fix displaying

* use abs for diff

* fix vllm case

* rm output file

* rename to compare-logprobs

* add "pattern"

6 weeks agoserver-models.cpp: add missing <filesystem> (#18000)
Sergey Fedorov [Sat, 13 Dec 2025 21:02:43 +0000 (05:02 +0800)]
server-models.cpp: add missing <filesystem> (#18000)

Fixes: https://github.com/ggml-org/llama.cpp/issues/17999
6 weeks agollama_context: synchronize before reallocating output buffer (#17974)
Jeff Bolz [Sat, 13 Dec 2025 15:19:51 +0000 (09:19 -0600)]
llama_context: synchronize before reallocating output buffer (#17974)

6 weeks agoarg: fix common_params_parse not accepting negated arg (#17991)
Xuan-Son Nguyen [Sat, 13 Dec 2025 11:53:37 +0000 (12:53 +0100)]
arg: fix common_params_parse not accepting negated arg (#17991)

6 weeks agocmake: correct scope - link ws2_32 for MinGW/w64devkit builds in cpp-httplib (#17972)
Gustavo Rocha Dias [Sat, 13 Dec 2025 11:46:36 +0000 (08:46 -0300)]
cmake: correct scope - link ws2_32 for MinGW/w64devkit builds in cpp-httplib (#17972)

* fix - w64devkit build

* fix - w64devkit build private scope

6 weeks agovulkan: support get_rows for i32 (#17941)
Jeff Bolz [Sat, 13 Dec 2025 09:12:53 +0000 (03:12 -0600)]
vulkan: support get_rows for i32 (#17941)

6 weeks agovulkan: support GGML_OP_DIAG (#17893)
Jeff Bolz [Sat, 13 Dec 2025 09:07:49 +0000 (03:07 -0600)]
vulkan: support GGML_OP_DIAG (#17893)

6 weeks agovulkan: Multi-pass softmax for large number of cols (#17892)
Jeff Bolz [Sat, 13 Dec 2025 09:04:29 +0000 (03:04 -0600)]
vulkan: Multi-pass softmax for large number of cols (#17892)

When the number of cols is large, split each row across multiple workgroups.
There are three phases that communicate partial results through temp buffers:
(1) compute max partials
(2) take max of partials, compute sum(exp(x-max)) partials
(3) sum partials, compute scaled result

6 weeks agospeculative-simple : free batch on exit (#17985)
Georgi Gerganov [Sat, 13 Dec 2025 07:48:34 +0000 (09:48 +0200)]
speculative-simple : free batch on exit (#17985)

6 weeks agocommon : skip model validation when --completion-bash is requested (#17975)
Sigbjørn Skjæret [Sat, 13 Dec 2025 07:40:50 +0000 (08:40 +0100)]
common : skip model validation when --completion-bash is requested (#17975)

6 weeks agovulkan: Allow non-pow2 n_experts in topk_moe (#17872)
Jeff Bolz [Sat, 13 Dec 2025 07:40:04 +0000 (01:40 -0600)]
vulkan: Allow non-pow2 n_experts in topk_moe (#17872)

6 weeks agoadd llama-completion to completion-bash executables (#17976)
Sigbjørn Skjæret [Sat, 13 Dec 2025 07:35:50 +0000 (08:35 +0100)]
add llama-completion to completion-bash executables (#17976)

6 weeks agomodel-conversion : use CONVERTED_MODEL value for converted model [no ci] (#17984)
Daniel Bevenius [Sat, 13 Dec 2025 07:34:26 +0000 (08:34 +0100)]
model-conversion : use CONVERTED_MODEL value for converted model [no ci] (#17984)

* model-conversion : use CONVERTED_MODEL value for converted model [no ci]

This commit updates the model verification scripts to use the
CONVERTED_MODEL environment variable instead of using the MODEL_PATH
(the original model path) as the basis for the converted model file
name.

The motivation for this that currently if the converted model file name
differs from the original model directory/name the verification scripts
will look for the wrong .bin files that were generating when running the
models.
For example, the following steps were not possible:
```console
(venv) $ huggingface-cli download google/gemma-3-270m-it --local-dir ggml-org/gemma-3-270m
(venv) $ python3 convert_hf_to_gguf.py ggml-org/gemma-3-270m --outfile test-bf16.gguf --outtype bf16
(venv) $ cd examples/model-conversion/
(venv) $ export MODEL_PATH=../../ggml-org/gemma-3-270m
(venv) $ export CONVERTED_MODEL=../../test-bf16.gguf
(venv) $ make causal-verify-logits
...
Data saved to data/llamacpp-test-bf16.bin
Data saved to data/llamacpp-test-bf16.txt
Error: llama.cpp logits file not found: data/llamacpp-gemma-3-270m.bin
Please run scripts/run-converted-model.sh first to generate this file.
make: *** [Makefile:62: causal-verify-logits] Error 1
```

With the changes in this commit, the above steps will now work as
expected.

6 weeks agocommon: support negated args (#17919)
Xuan-Son Nguyen [Fri, 12 Dec 2025 22:58:53 +0000 (23:58 +0100)]
common: support negated args (#17919)

* args: support negated args

* update docs

* fix typo

* add more neg options

* Apply suggestions from code review

Co-authored-by: Sigbjørn Skjæret <redacted>
* rm duplicated arg

* fix LLAMA_ARG_NO_HOST

* add test

---------

Co-authored-by: Sigbjørn Skjæret <redacted>
6 weeks agoclip: move model cgraphs into their own files (#17965)
Xuan-Son Nguyen [Fri, 12 Dec 2025 20:14:48 +0000 (21:14 +0100)]
clip: move model cgraphs into their own files (#17965)

* clip: move model cgraphs into their own files

* more explicit enums

* fix linux build

* fix naming

* missing headers

* nits: add comments for contributors

6 weeks agoci : change the cann version and the container pull method (#17953)
jiahao su [Fri, 12 Dec 2025 19:43:00 +0000 (03:43 +0800)]
ci : change the cann version and the container pull method (#17953)

fix error format

Update build.yml

Remove unnecessary zip files

fix

update

6 weeks agodocker : include legacy llama-completion binary (#17964)
Sigbjørn Skjæret [Fri, 12 Dec 2025 18:39:23 +0000 (19:39 +0100)]
docker : include legacy llama-completion binary (#17964)

6 weeks agoCUDA: fix overflow in MMA kernel without stream-k (#17939)
Johannes Gäßler [Fri, 12 Dec 2025 16:43:58 +0000 (17:43 +0100)]
CUDA: fix overflow in MMA kernel without stream-k (#17939)

6 weeks agomodels : fix the attn_factor for mistral3 graphs + improve consistency (#17945)
Georgi Gerganov [Fri, 12 Dec 2025 15:12:40 +0000 (17:12 +0200)]
models : fix the attn_factor for mistral3 graphs + improve consistency (#17945)

* models : fix the attn_factor for mistral3 graphs

* cont : rework attn_factor correction logic

* cont : make deepseek2 consistent

* cont : add TODO

* cont : special-case DSv2

* cont : revert Mistral 3 Large changes

* cont : fix DS2 to use the original attn_factor

* cont : minor comments

6 weeks agocann : fix ops broken by circular padding guard (#17825)
Sigbjørn Skjæret [Fri, 12 Dec 2025 14:49:27 +0000 (15:49 +0100)]
cann : fix ops broken by circular padding guard (#17825)

6 weeks agoggml-cpu : fix RISC-V Q4_0 repack select and RVV feature reporting (#17951)
ixgbe [Fri, 12 Dec 2025 14:26:03 +0000 (22:26 +0800)]
ggml-cpu : fix RISC-V Q4_0 repack select and RVV feature reporting (#17951)

* ggml-cpu:fix RISC-V Q4_0 repack select and RVV feature reporting

Signed-off-by: Wang Yang <redacted>
* using the name VLEN instead of CNT

* Update ggml/include/ggml-cpu.h

---------

Signed-off-by: Wang Yang <redacted>
Co-authored-by: Georgi Gerganov <redacted>
6 weeks agomtmd: explicitly forbidden inclusion of private header and libcommon (#17946)
Xuan-Son Nguyen [Fri, 12 Dec 2025 14:16:06 +0000 (15:16 +0100)]
mtmd: explicitly forbidden inclusion of private header and libcommon (#17946)

6 weeks agowebui: Fix parsing non-LaTeX occurrencies of `\(` or `\)` (#17810)
Aleksander Grygier [Fri, 12 Dec 2025 14:13:36 +0000 (15:13 +0100)]
webui: Fix parsing non-LaTeX occurrencies of `\(` or `\)` (#17810)

* fix: Improve latex protection logic to prevent turning non-latex `\(` into `$`

* chore: update webui build output

6 weeks agoarg: add -mm and -mmu as short form of --mmproj and --mmproj-url (#17958)
Xuan-Son Nguyen [Fri, 12 Dec 2025 13:06:06 +0000 (14:06 +0100)]
arg: add -mm and -mmu as short form of --mmproj and --mmproj-url (#17958)

* arg: add -mm and -mmu as short form of --mmproj and --mmproj-url

* correct order

* update docs

6 weeks agomodel-conversion : remove max diff check in compare-logits [no ci] (#17954)
Daniel Bevenius [Fri, 12 Dec 2025 12:25:16 +0000 (13:25 +0100)]
model-conversion : remove max diff check in compare-logits [no ci] (#17954)

This commit removes the maximum difference check from the
compare-logits.py which would stop early if the difference between
the logits exceeded a threshold.

The motivation for removing this is that it can be useful to be able to
get the complete log for debugging/reporting purposes.

6 weeks agocommon : add minimalist multi-thread progress bar (#17602)
Adrien Gallouët [Fri, 12 Dec 2025 11:44:35 +0000 (12:44 +0100)]
common : add minimalist multi-thread progress bar (#17602)

Signed-off-by: Adrien Gallouët <redacted>
6 weeks agocmake: link ws2_32 for MinGW/w64devkit builds in cpp-httplib (#17949)
Gustavo Rocha Dias [Fri, 12 Dec 2025 11:02:28 +0000 (08:02 -0300)]
cmake: link ws2_32 for MinGW/w64devkit builds in cpp-httplib (#17949)

6 weeks agoHIP: enable mmf for RDNA3 (#17879)
yulo [Fri, 12 Dec 2025 10:34:33 +0000 (18:34 +0800)]
HIP: enable mmf for RDNA3 (#17879)

* enable mmf for RDNA3

* disable mmf for some shape

* move some mmvf to mmf

* more mmfv to mmf

* 3 is good in mmvf

---------

Co-authored-by: zhang hui <redacted>
6 weeks agoAdd a search field on model selector / improve mobile display (#17765)
Pascal [Thu, 11 Dec 2025 17:21:21 +0000 (18:21 +0100)]
Add a search field on model selector / improve mobile display (#17765)

* webui: add search field to model selector and fixes mobile viewport overflow

* webui: simplify model search style and code

* refacor: Search Input component & consistent UI for Models Selector search

* feat: Use Popover component + improve interactions

* fix: Fetching props for only loaded models in ROUTER mode

* webui: prevent models selector popover from overflowing viewport

Use Floating UI's auto-positioning with 50dvh height limit and proper
collision detection instead of forcing top positioning. Fixes overflow
on desktop and mobile keyboard issues

* webui: keep search field near trigger in models selector

Place search at the 'near end' (closest to trigger) by swapping layout
with CSS flexbox order based on popover direction. Prevents input from
moving during typing as list shrinks

* chore: update webui build output

---------

Co-authored-by: Aleksander Grygier <redacted>
6 weeks agoSOLVE_TRI extension to more dimensions (#17793)
Piotr Wilkin (ilintar) [Thu, 11 Dec 2025 16:20:43 +0000 (17:20 +0100)]
SOLVE_TRI extension to more dimensions (#17793)

* Extended TRI

* Fix whitespace

* chore: update webui build output

* Just use cuBLAS for everything...

* Merge both versions

* Remove incorrect imports causing failures for CI

* Still failing... remove all direct cublas imports and rely on common imports from "common.cuh"

* Defines for hipBlas

* Aaaand MUSA defines...

* I hate this job...

* Stupid typo...

* Update ggml/src/ggml-cuda/solve_tri.cu

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

Co-authored-by: Johannes Gäßler <redacted>
6 weeks agoggml-alloc : fix reuse-parent logic for misaligned sizes (#17884)
Georgi Gerganov [Thu, 11 Dec 2025 12:30:10 +0000 (14:30 +0200)]
ggml-alloc : fix reuse-parent logic for misaligned sizes (#17884)

6 weeks agobatch : fix sequence id ownership (#17915)
Georgi Gerganov [Thu, 11 Dec 2025 12:29:47 +0000 (14:29 +0200)]
batch : fix sequence id ownership (#17915)

* batch : fix sequence id ownage

* cont : reduce allocations

6 weeks agodocs: use port 8080 in Docker examples (#17903)
Yuichiro Utsumi [Thu, 11 Dec 2025 09:12:07 +0000 (18:12 +0900)]
docs: use port 8080 in Docker examples (#17903)

6 weeks agoggml-hexagon: fix `rope` failure at `test-backend-ops` (#17565)
nullname [Wed, 10 Dec 2025 22:45:43 +0000 (06:45 +0800)]
ggml-hexagon: fix `rope` failure at `test-backend-ops` (#17565)

* fix test failure

* fix: correct scaling calculations in rope_cache_init

* fix: optimize element copying in rope_hex_f32 using memcpy

* fix: optimize loop boundaries in rope_hex_f32 for better performance

* feat: add profiling macros for performance measurement in operations

6 weeks agoci: fix riscv64-native build (#17916)
Sigbjørn Skjæret [Wed, 10 Dec 2025 22:24:31 +0000 (23:24 +0100)]
ci: fix riscv64-native build (#17916)

6 weeks agomtmd: some small clean up (#17909)
Xuan-Son Nguyen [Wed, 10 Dec 2025 21:20:06 +0000 (22:20 +0100)]
mtmd: some small clean up (#17909)

* clip: add support for fused qkv in build_vit

* use bulid_ffn whenever possible

* fix internvl

* mtmd-cli: move image to beginning

* test script: support custom args

6 weeks agocli: enable jinja by default (#17911)
Xuan-Son Nguyen [Wed, 10 Dec 2025 21:19:42 +0000 (22:19 +0100)]
cli: enable jinja by default (#17911)

* cli: enable jinja by default

* Update common/arg.cpp

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

Co-authored-by: Sigbjørn Skjæret <redacted>
6 weeks agoserver: add presets (config) when using multiple models (#17859)
Pascal [Wed, 10 Dec 2025 21:18:21 +0000 (22:18 +0100)]
server: add presets (config) when using multiple models (#17859)

* llama-server: recursive GGUF loading

Replace flat directory scan with recursive traversal using
std::filesystem::recursive_directory_iterator. Support for
nested vendor/model layouts (e.g. vendor/model/*.gguf).
Model name now reflects the relative path within --models-dir
instead of just the filename. Aggregate files by parent
directory via std::map before constructing local_model

* server : router config POC (INI-based per-model settings)

* server: address review feedback from @aldehir and @ngxson

PEG parser usage improvements:
- Simplify parser instantiation (remove arena indirection)
- Optimize grammar usage (ws instead of zero_or_more, remove optional wrapping)
- Fix last line without newline bug (+ operator instead of <<)
- Remove redundant end position check

Feature scope:
- Remove auto-reload feature (will be separate PR per @ngxson)
- Keep config.ini auto-creation and template generation
- Preserve per-model customization logic

Co-authored-by: aldehir <redacted>
Co-authored-by: ngxson <redacted>
* server: adopt aldehir's line-oriented PEG parser

Complete rewrite of INI parser grammar and visitor:
- Use p.chars(), p.negate(), p.any() instead of p.until()
- Support end-of-line comments (key=value # comment)
- Handle EOF without trailing newline correctly
- Strict identifier validation ([a-zA-Z_][a-zA-Z0-9_.-]*)
- Simplified visitor (no pending state, no trim needed)
- Grammar handles whitespace natively via eol rule

Business validation preserved:
- Reject section names starting with LLAMA_ARG_*
- Accept only keys starting with LLAMA_ARG_*
- Require explicit section before key-value pairs

Co-authored-by: aldehir <redacted>
* server: fix CLI/env duplication in child processes

Children now receive minimal CLI args (executable, model, port, alias)
instead of inheriting all router args. Global settings pass through
LLAMA_ARG_* environment variables only, eliminating duplicate config
warnings.

Fixes: Router args like -ngl, -fa were passed both via CLI and env,
causing 'will be overwritten' warnings on every child spawn

* add common/preset.cpp

* fix compile

* cont

* allow custom-path models

* add falsey check

* server: fix router model discovery and child process spawning

- Sanitize model names: replace / and \ with _ for display
- Recursive directory scan with relative path storage
- Convert relative paths to absolute when spawning children
- Filter router control args from child processes
- Refresh args after port assignment for correct port value
- Fallback preset lookup for compatibility
- Fix missing argv[0]: store server binary path before base_args parsing

* Revert "server: fix router model discovery and child process spawning"

This reverts commit e3832b42eeea7fcb108995966c7584479f745857.

* clarify about "no-" prefix

* correct render_args() to include binary path

* also remove arg LLAMA_ARG_MODELS_PRESET for child

* add co-author for ini parser code

Co-authored-by: aldehir <redacted>
* also set LLAMA_ARG_HOST

* add CHILD_ADDR

* Remove dead code

---------

Co-authored-by: aldehir <redacted>
Co-authored-by: ngxson <redacted>
Co-authored-by: Xuan Son Nguyen <redacted>
Co-authored-by: aldehir <redacted>
6 weeks agoFix race conditions in threadpool when dealing with dynamic/frequent n_threads change...
Max Krasnyansky [Wed, 10 Dec 2025 20:32:23 +0000 (12:32 -0800)]
Fix race conditions in threadpool when dealing with dynamic/frequent n_threads changes (#17748)

* tests: update barrier test to check for race condition in active threads

* cpu: combine n_graph and n_threads into a single atomic update

* tests: add multi-graph test for test_barrier

6 weeks agoggml : remove GGML_KQ_MASK_PAD constant (#17910)
Georgi Gerganov [Wed, 10 Dec 2025 18:53:16 +0000 (20:53 +0200)]
ggml : remove GGML_KQ_MASK_PAD constant (#17910)

* ggml : remove GGML_KQ_MASK_PAD constant

* cont : remove comment

6 weeks agocuda : add missing support check for xielu (#17895)
Sigbjørn Skjæret [Wed, 10 Dec 2025 15:16:20 +0000 (16:16 +0100)]
cuda : add missing support check for xielu (#17895)

6 weeks agocli: new CLI experience (#17824)
Xuan-Son Nguyen [Wed, 10 Dec 2025 14:28:59 +0000 (15:28 +0100)]
cli: new CLI experience (#17824)

* wip

* wip

* fix logging, add display info

* handle commands

* add args

* wip

* move old cli to llama-completion

* rm deprecation notice

* move server to a shared library

* move ci to llama-completion

* add loading animation

* add --show-timings arg

* add /read command, improve LOG_ERR

* add args for speculative decoding, enable show timings by default

* add arg --image and --audio

* fix windows build

* support reasoning_content

* fix llama2c workflow

* color default is auto

* fix merge conflicts

* properly fix color problem

Co-authored-by: bandoti <redacted>
* better loading spinner

* make sure to clean color on force-exit

* also clear input files on "/clear"

* simplify common_log_flush

* add warning in mtmd-cli

* implement console writter

* fix data race

* add attribute

* fix llama-completion and mtmd-cli

* add some notes about console::log

* fix compilation

---------

Co-authored-by: bandoti <redacted>
6 weeks agomodel : Qwen3-Next-80B-A3B has 48 layers (#17898)
Eric Zhang [Wed, 10 Dec 2025 14:22:40 +0000 (22:22 +0800)]
model : Qwen3-Next-80B-A3B has 48 layers (#17898)

* model : Qwen3-Next-80B-A3B has 48 layers

* model : Add 80B-A3B type name

6 weeks agodocs : update opencl ops (#17904)
lhez [Wed, 10 Dec 2025 14:20:00 +0000 (06:20 -0800)]
docs : update opencl ops (#17904)

6 weeks agoCUDA: fix unpadded strides in MMA FA kernel (#17891)
Johannes Gäßler [Wed, 10 Dec 2025 11:39:56 +0000 (12:39 +0100)]
CUDA: fix unpadded strides in MMA FA kernel (#17891)

6 weeks agoconvert: allow using quantized Mistral weight (#17889)
Xuan-Son Nguyen [Wed, 10 Dec 2025 09:26:22 +0000 (10:26 +0100)]
convert: allow using quantized Mistral weight (#17889)

* convert: allow using quantized Mistral weight

* data_torch.ndim

* update dequant fn

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

Co-authored-by: compilade <redacted>
6 weeks agofix softmax for iGPU (#17838)
Neo Zhang Jianyu [Wed, 10 Dec 2025 08:59:57 +0000 (16:59 +0800)]
fix softmax for iGPU (#17838)

6 weeks agocommon : add parser for ministral/mistral large 3/devstral 2 (#17713)
Aldehir Rojas [Tue, 9 Dec 2025 23:31:04 +0000 (17:31 -0600)]
common : add parser for ministral/mistral large 3/devstral 2 (#17713)

6 weeks agodocs : update cpu and cuda ops (#17890)
Sigbjørn Skjæret [Tue, 9 Dec 2025 22:31:29 +0000 (23:31 +0100)]
docs : update cpu and cuda ops (#17890)

* update cuda ops

* update CPU as well

6 weeks agometal: SSM kernel improvements (#17876)
Gabe Goodhart [Tue, 9 Dec 2025 19:30:02 +0000 (12:30 -0700)]
metal: SSM kernel improvements (#17876)

* feat: Add a batched version of ssm_conv

This was done using Claude Code. It found a number of optimizations around
how the threads were organized, resulting in a huge performance boost!

Branch: Mamba2SSD

Signed-off-by: Gabe Goodhart <redacted>
* feat: Optimized SSM_SCAN kernel for metal

This used Claude Code and resulted in a modest performance improvement
while maintaining correctness.

Branch: Mamba2SSD

Signed-off-by: Gabe Goodhart <redacted>
* test: Add test-backend-ops perf tests for SSM_CONV

Branch: SSMKernelImprovements

Signed-off-by: Gabe Goodhart <redacted>
* test: Real representitive tests for SSM_CONV

Branch: SSMKernelImprovements

Signed-off-by: Gabe Goodhart <redacted>
* refactor: Use function constant for ssm_conv batch size

Branch: SSMKernelImprovements

Signed-off-by: Gabe Goodhart <redacted>
* test: backend op tests for ssm_scan from granite4 1b-h

Branch: SSMKernelImprovements

Signed-off-by: Gabe Goodhart <redacted>
* style: remove commented out templates

Branch: SSMKernelImprovements

Signed-off-by: Gabe Goodhart <redacted>
* feat: float4 version of ssm_conv_batched

Branch: SSMKernelImprovements

Signed-off-by: Gabe Goodhart <redacted>
* fix: Add missing ggml_metal_cv_free

Signed-off-by: Gabe Goodhart <redacted>
Co-authored-by: Georgi Gerganov <redacted>
---------

Signed-off-by: Gabe Goodhart <redacted>
Co-authored-by: Georgi Gerganov <redacted>
6 weeks agoAdd DIAG for CUDA (#17873)
Piotr Wilkin (ilintar) [Tue, 9 Dec 2025 19:28:57 +0000 (20:28 +0100)]
Add DIAG for CUDA (#17873)

* Add DIAG for CUDA

* Refactor parameters

6 weeks agodocs: clarify that CPU support should be first (#17886)
Johannes Gäßler [Tue, 9 Dec 2025 19:10:36 +0000 (20:10 +0100)]
docs: clarify that CPU support should be first (#17886)

6 weeks agoggml : Provide macos-specific backtrace printing to avoid terminal death (#17869)
Gabe Goodhart [Tue, 9 Dec 2025 16:29:07 +0000 (09:29 -0700)]
ggml : Provide macos-specific backtrace printing to avoid terminal death (#17869)

* fix: Provide macos-specific backtrace printing to avoid terminal death

Branch: MacOSSafeBacktrace

Signed-off-by: Gabe Goodhart <redacted>
* fix: Add GGML_BACKTRACE_LLDB env var to enable using lldb for backtrace

Branch: MacOSSafeBacktrace

Signed-off-by: Gabe Goodhart <redacted>
---------

Signed-off-by: Gabe Goodhart <redacted>
6 weeks agometal : print node names for debugging (#17882)
Georgi Gerganov [Tue, 9 Dec 2025 13:25:49 +0000 (15:25 +0200)]
metal : print node names for debugging (#17882)

6 weeks agoggml : allow fill node alloc inplace (#17870)
Sigbjørn Skjæret [Tue, 9 Dec 2025 11:23:47 +0000 (12:23 +0100)]
ggml : allow fill node alloc inplace (#17870)

6 weeks agocmake: fix Mach-O current version number (#17877)
Rhys-T [Tue, 9 Dec 2025 11:17:41 +0000 (06:17 -0500)]
cmake: fix Mach-O current version number (#17877)

PR #17091 set the VERSION of various libraries to 0.0.abcd, where abcd
is the LLAMA_BUILD_NUMBER. That build number is too large to fit in the
Mach-O 'current version' field's 'micro' part, which only goes up to
255. This just sets the Mach-O current version to 0 to get it building
properly again.

Fixes #17258.

6 weeks agomodel : nit, DeepSeek V1 MoE is 16B and GigaChat is 20B (#12652)
Sigbjørn Skjæret [Tue, 9 Dec 2025 11:15:06 +0000 (12:15 +0100)]
model : nit, DeepSeek V1 MoE is 16B and GigaChat is 20B (#12652)

* nit, DeepSeek V1 MoE is 16B

* base type on n_ff_exp instead

6 weeks agoconsole: allow using arrow left/right, home/end keys and history mode (#17836)
Xuan-Son Nguyen [Tue, 9 Dec 2025 10:53:59 +0000 (11:53 +0100)]
console: allow using arrow left/right, home/end keys and history mode (#17836)

* console: allow using arrow left/right to edit the line (with UTF-8 support)

* console: fix arrow keys on Windows using private-use Unicode

* console: add Home/End key support for Windows and Linux

* console: add basic Up/Down history navigation

* fix build

* console: allow using arrow left/right to edit the line (with UTF-8 support)

* console: fix arrow keys on Windows using private-use Unicode

* console: add Home/End key support for Windows and Linux

* console: add basic Up/Down history navigation

* console: remove unreachable wc == 0 check after VK switch

* console: add Ctrl+Left/Right word navigation

- Add KEY_CTRL_ARROW_LEFT and KEY_CTRL_ARROW_RIGHT codes
- Windows: detect CTRL modifier via dwControlKeyState
- Linux: parse ANSI sequences with modifier (1;5D/C)
- Implement move_word_left/right with space-skipping logic
- Refactor escape sequence parsing to accumulate params

* console: add Delete key support

- Windows: VK_DELETE detection
- Linux: ESC[3~ sequence parsing
- Forward character deletion with UTF-8 support

* console: implement bash-style history editing

- Edit any history line during UP/DOWN navigation, edits persist
- Pressing Enter appends edited version as new history entry
- Original line stay untouched in their positions

* clean up

* better history impl

* fix decode_utf8

---------

Co-authored-by: Pascal <redacted>
6 weeks agoCANN: add support for partial RoPE and Vision mode (#17543)
Chenguang Li [Tue, 9 Dec 2025 09:53:23 +0000 (17:53 +0800)]
CANN: add support for partial RoPE and Vision mode (#17543)

* cann: add support for partial RoPE and Vision mode

Add support for two important RoPE variants: partial rotation (rope_dims < ne0)
and Vision mode rotation.

1. Support for partial RoPE (rope_dims < ne0):
   - Split tensor into head (first rope_dims dimensions) and tail portions
   - Apply rotation only to head portion using RotaryPositionEmbedding operator
   - Copy unrotated tail portion directly from source to destination
   - Handle both contiguous and non-contiguous tensor layouts

2. Support for Vision mode (GGML_ROPE_TYPE_VISION):
   - Set rope_dims = ne0 for Vision mode to rotate entire tensor
   - Vision mode pairs dimension i with dimension i+n_dims (where n_dims = ne0/2)
   - No tail handling needed since entire tensor is rotated

Implementation details:
   - Use has_tail flag to determine execution path: head/tail splitting when
     rope_dims < ne0, or full tensor rotation when rope_dims == ne0
   - Support both F32 and F16 data types with intermediate F32 conversion
   - Copy non-contiguous tensors to contiguous buffers before calling
     RotaryPositionEmbedding operator for compatibility
   - Improve cache invalidation logic to include rope_dims and indep_sects
     parameters

These enhancements enable CANN backend to handle various RoPE configurations
used in modern vision-language models and models with partial rotation.

* cann: fix review comment

6 weeks agoCUDA: fix FP16 overflow in tile FA kernel (#17875)
Johannes Gäßler [Tue, 9 Dec 2025 08:34:02 +0000 (09:34 +0100)]
CUDA: fix FP16 overflow in tile FA kernel (#17875)

6 weeks agollama : add token matching support to llama-grammar (#17816)
Aldehir Rojas [Tue, 9 Dec 2025 06:32:57 +0000 (00:32 -0600)]
llama : add token matching support to llama-grammar (#17816)

* llama : add token support to llama-grammar

* fix inverse token comment

* refactor trigger_patterns to replay tokens instead of the entire string

* add token documentation

* fix test-llama-grammar

* improve test cases for tokens

6 weeks agomodel : support Rnj-1 (#17811)
philip-essential [Tue, 9 Dec 2025 03:49:03 +0000 (19:49 -0800)]
model : support Rnj-1 (#17811)

* add support for rnj1

* refactor gemma3 to support rnj-1

* address review comments

6 weeks agograph : use fill instead of scale_bias in grouped expert selection (#17867)
Sigbjørn Skjæret [Mon, 8 Dec 2025 20:29:59 +0000 (21:29 +0100)]
graph : use fill instead of scale_bias in grouped expert selection (#17867)

* use fill instead of scale_bias in grouped expert selection

* do not explicitly use _inplace

6 weeks agomodel-conversion : add token ids to prompt token output [no ci] (#17863)
Daniel Bevenius [Mon, 8 Dec 2025 16:13:08 +0000 (17:13 +0100)]
model-conversion : add token ids to prompt token output [no ci] (#17863)

This commit adds the token ids to the printed prompt outputs.

The motivation for this is that is can be useful to see the actual token
ids alongside the token strings for debugging.

6 weeks agoserver: delegate result_state creation to server_task (#17835)
Xuan-Son Nguyen [Mon, 8 Dec 2025 16:04:38 +0000 (17:04 +0100)]
server: delegate result_state creation to server_task (#17835)

* server: delegate result_state creation to server_task

* remove unued states

* add more docs

6 weeks agoci : support bfloat16 SYCL release package (#17855)
Neo Zhang [Mon, 8 Dec 2025 14:09:39 +0000 (22:09 +0800)]
ci : support bfloat16 SYCL release package (#17855)

* support bfloat16 release package

* add fallback file

6 weeks agoserver: improve speed of speculative decoding (#17808)
Xuan-Son Nguyen [Mon, 8 Dec 2025 13:35:28 +0000 (14:35 +0100)]
server: improve speed of speculative decoding (#17808)

* server: improve speed of speculative decoding

* fix small draft case

* add link to the PR

* server : fix generation time measurement

* server : fix draft acceptance logs (add SRV_CNT, SLT_CNT macros)

* server : add comment

* add PR to docs

---------

Co-authored-by: Georgi Gerganov <redacted>
6 weeks agoMake graph_max_nodes vary by ubatch size (#17794)
Piotr Wilkin (ilintar) [Mon, 8 Dec 2025 13:32:41 +0000 (14:32 +0100)]
Make graph_max_nodes vary by ubatch size (#17794)

* Make graph_max_nodes vary by ubatch size for models where chunking might explode the graph

* Update src/llama-context.h

Co-authored-by: Georgi Gerganov <redacted>
* Add missing const

---------

Co-authored-by: Georgi Gerganov <redacted>