Commit Graph

4389 Commits

Author SHA1 Message Date
Kawrakow 86e33fd6f4
Initial Gemma4 support (#1581)
* Gemma4: WIP

* Gemma4: WIP - runs with totally wrong results

* Gemma4: WIP - add CPU 512, 512 FA

* Gemma4: WIP

It gives a meaningful response in llama-cli, but PPL is still much too
high. Is this due to tokenizer issues?

* Gemma4: this works

I had forgotten the softcap on the final output.

* Remove log

* Gemma4: WIP E4B/E2B

* Gemma4: Q4B/E2B appear to work now

* gemma4: tokenizer fixes
2026-04-06 10:01:08 +02:00
Adam Caldwell 6d4cdef511
Optimize mul_mat_q8_1_r8_q8_2 with AVX-512 for faster Q4_K/Q5_K prompt processing (#1578)
Add HAVE_FANCY_SIMD path that processes 16 rows at a time using 512-bit
operations, combining two R8 groups via _mm512_inserti32x8. Reuses the
existing qx_r8_q8_dot_product 512-bit overload for the inner dot product.
Also updates num_rows for Q8_1 to 16 under HAVE_FANCY_SIMD.

Co-authored-by: Adam Caldwell <accaldwell@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 09:07:23 +02:00
firecoperana 5e8bb724ce
server: support slot save/restore/erase for mtmd tokens and checkpoints (#1584)
Co-authored-by: firecoperana <firecoperana>
2026-04-05 08:41:04 +02:00
Kawrakow 0147cf4837
Add additional explanations to the pinned memory log (#1582) 2026-04-04 08:53:58 +02:00
Kawrakow fd71191b2a
Update README.md 2026-04-04 08:32:37 +02:00
mcm007 d557d6c098
Update docs (#1574)
* Update README.md

- Model support
- KV cache improvements

* Update parameters.md

- KV Q4_0 improvements
- wgt, with notice
- mtmd-kq-type
2026-04-03 08:30:29 +02:00
Kawrakow bc89aedd2b
Bonsai support (ARM_NEON) (#1571)
* Bonsai: ARM_NEON

* Bonsai: this is faster on AVX2

* Remove forgotten debug logs

---------

Co-authored-by: Iwan Kawrakow <iwan.kawrakow@gmail.com>
2026-04-03 08:29:15 +02:00
Kawrakow 90ec1b80c4
Bonsai support (AVX2, generic) (#1570)
* Bonsai support (AVX2, generic)

* Fix ARM build

---------

Co-authored-by: Iwan Kawrakow <iwan.kawrakow@gmail.com>
2026-04-02 16:54:08 +02:00
Kawrakow 73742c5db9
mtmd: be able to use alternative types for the K*Q multiplication (#1567)
* mtmd: allow using types other than f32 for K*Q

* Do not cast q if kq_type is quantized

* Fix formatting

* More formatting
2026-04-02 08:04:05 +02:00
Kawrakow 6ea7f321e8
Fix unknown tensor type warnings (#1565) 2026-04-01 09:45:32 +02:00
Kawrakow 93c1e241d8
Fix BF16 mmproj on the CPU (#1564) 2026-04-01 09:17:58 +02:00
Kawrakow 9660eb4487
Control compute buffer sizes for large batches (#1560)
* Worst graph output tokens

* This is better
2026-04-01 07:57:52 +02:00
Kawrakow bc78a1e93b
CPU FA: check if types are supported (#1562) 2026-03-31 16:19:21 +02:00
Kawrakow 8b575c4b1f
Fix re-quantizing a model using row-interleaved quants (#1561) 2026-03-31 15:35:10 +02:00
Kawrakow bd7daa7176
Even better Q4_0 KV cache (CPU) (#1556) 2026-03-31 08:08:34 +02:00
Kawrakow b9a2ce4677
Even better Q4_0 KV cache (#1547) 2026-03-30 10:06:54 +02:00
mcm007 028fc79710
Update README.md and parameters docs (#1550)
* Update parameters.md withe recent changes

* Update README.md with recent changes

- Hadamard for V cache
- AVX-VNNI optimizations
- Auto-fit
2026-03-29 18:52:08 +02:00
hksdpc255 46f9f0fb31
fix #1524 (#1543) 2026-03-29 18:50:09 +02:00
Kawrakow 3fa98d3213
Enable all CPU-backend FA supported quants by default (#1549) 2026-03-29 14:36:09 +02:00
Kawrakow bc2c74c9db
Add --fit to llama-bench (#1542) 2026-03-29 08:05:07 +02:00
Kawrakow 7831c69e27
Do not override mmap if GGML_CUDA_NO_PINNED is set (#1546) 2026-03-29 08:04:43 +02:00
Samuel Oliveira Alves c050bb9f3f
graph: Remove duplicate functions in MTP (#1530) 2026-03-28 15:43:24 +01:00
Kawrakow f83a29ff5a
Honor manual splits (#1540) 2026-03-28 13:03:43 +01:00
Kawrakow a95981013a
V-cache Hadamard transform (#1527) 2026-03-28 11:28:50 +01:00
Kawrakow 798af8676a
Correct available split modes in llama-bench (#1539) 2026-03-28 09:28:01 +01:00
Kawrakow 93ae47e167
Fix CUDA Hadamard transfrom bug (#1526) 2026-03-27 10:37:35 +01:00
Kawrakow 78977c0c0d
Fix jinja (#1518) 2026-03-26 17:24:11 +01:00
Kawrakow 8ab016e2d5
Fix bug in CPU floash attention for bf16 KV cache (#1521) 2026-03-26 17:22:27 +01:00
Kawrakow e46601cb19
Log probabilities on token sampling crash (#1519)
* Log probabilities on token sampling crash

* Typo
2026-03-26 14:34:41 +01:00
Kawrakow c06067fa14
Ignore MTP layer(s) when computing required memory (#1516) 2026-03-26 10:42:51 +01:00
Kawrakow 9eaf105ae8
Print info when allocating large amounts of pinned host memory (#1517) 2026-03-26 10:42:35 +01:00
Alec Koumjian aa7fdb3259
ggml-cuda: fix shared memory sizing in OpenAI argsort kernel (#1512) 2026-03-26 08:00:00 +01:00
Kawrakow 095bd3d3b2
Use pinned memory also with mmap when tensor overrides (#1510) 2026-03-26 06:15:54 +01:00
Kawrakow a84d90a4b8
Fix bug introduced in #1506 (#1515) 2026-03-26 06:04:51 +01:00
Kawrakow 4b1a6560a8
Update parameters documentation with new options (#1511)
Added descriptions for `--fit` and `--fit-margin`.
2026-03-25 18:23:44 +01:00
Kawrakow dd75fd054c
Fix KV cache for split mode graph with layers left on CPU (#1506) 2026-03-25 17:53:45 +01:00
Kawrakow d66dc7c0c4
CUDA: restore pinned memory usage for tensor overrides (#1508) 2026-03-25 17:18:32 +01:00
Samuel Oliveira Alves 1f3e832cb3
Improve mtp acceptance rate (#1499)
* wip: port MTP architecture

Ports the Multi-Token Prediction (MTP) architecture to the older `llama.cpp` codebase used by `ikllama`.

Changes include:
- Updating `llama_batch` to support `mtp_params`.
- Modifying `llama_decode_internal` (and `encode`) to handle MTP operations (Warmup, Update, Draft).
- Adding public APIs for MTP state management (`llama_set_draft_input_hidden_state`).
- Adapting the embedding extraction logic to skip MTP update passes.

* Refactors `server_slot` to support generic speculative decoding (MTP or Draft Model).

* core: enable hybrid outputs (logits + embeddings) for MTP support

* fix(mtp): correct KV-cache slot finding for updates

* fix(mtp): persist hidden states to prevent context corruption during drafting

* refactor(mtp): clean unused code

* fix(mtp): update server to new functions name

* fix(mtp): fix graph and save hidden state

* mtp: refactor integration, context params and kv cache search

* mtp: fix hidden state extraction and speculative acceptance flow

* server: fix MTP warmup for long prompts and reset token buffer

* llama: refactor MTP operation state to context parameters

* server: fix n_past calculation in MTP acceptance

* llama: fix mtp enable flags

* speculative: refactor MTP to use common_speculative interface

* context: remove unused signatures

* clip: fix deprecated enum-enum conversion warning

* common: fix format string crash in help message

* context: fix mtp activation logic

* llamat: always use the extracted embedding

* llama: get all embeddings to kv cache

* llama: revert logit to not run mtp for not supported arch

* llama: allocate all the n_outputs for MTP

* wip

* server-context: get only the last embedding for hidden state

* ggml-backend: fix array of bounds in debug build

* server-context: run mt kv update to each prompt batch

* revert segmentation fault fixes

* glm-mtp(feat): optimize graph embedding and recursive drafting
2026-03-25 10:20:22 +01:00
Adam Caldwell 3c4a7d18bd
mul_mat_q8_0_r8_q8_2: combine first/second half dot products before float conversion (#1505)
Co-authored-by: Adam Caldwell <accaldwell@users.noreply.github.com>
2026-03-25 09:47:10 +01:00
Kawrakow b6bac1aedb
Auto-fit for dense models (#1504)
* Auto-fit for dense models

* Minor
2026-03-25 08:28:15 +01:00
Kawrakow 86f4f516e5
Auto-fit offloaded tensors to available VRAM (MoE models) (#1501)
* WIP: automatically fit model in available VRAM

* WIP

* This seems pretty solid
2026-03-25 07:29:29 +01:00
Kawrakow 5451b149d4
Revert "Slightly better CPU performance for SWA models (#1496)" (#1503)
This reverts commit f4125e8b1f.
2026-03-25 07:20:34 +01:00
Kawrakow 233225db8f
Take into account layer sizes for setting GPU layers (count 2) (#1498)
* Also take into account KV cache

* Take into account attn_wkv_b and mla = 3 compute buffers

* WIP

* Minor
2026-03-24 08:18:28 +01:00
Aliez Ren f6c8b5f2cb
Update nix flake: sync with upstream, fix for newer nixpkgs (#1371)
* Update nix flake: sync with upstream, fix for newer nixpkgs

- Sync package.nix with upstream: add rocmGpuTargets/useRpc params,
  fix env optionals→optionalAttrs, remove unused inputs
- Rewrite devshells.nix to use mkShell directly instead of passthru
- Fix CUDA license check in nixpkgs-instances.nix for list-type licenses
- Update flake inputs (nixpkgs, flake-parts) to latest
- Update references from ggerganov/llama.cpp to ikawrakow/ik_llama.cpp

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Apply nix review suggestions from baileylu121 (#1371)

- Use legacyPackages instead of import to avoid extra nixpkgs instances
- Use inherit (pkgs) stdenv idiom
- Remove unnecessary lib.pipe wrapper in devshells.nix
- Simplify license normalization with lib.toList in nixpkgs-instances.nix

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 08:17:52 +01:00
Kawrakow f4125e8b1f
Slightly better CPU performance for SWA models (#1496) 2026-03-24 07:53:16 +01:00
mcm007 bbc07002f7
Update docker and it's configs (#1497)
* Update ik_llama-cuda.Containerfile

- DGGML_NATIVE=ON, as most users are building images locally

- Latest llama-swap version

* Update ik_llama-cpu.Containerfile

- DGGML_NATIVE=ON, as most users are building images locally

- Latest llama-swap version

* Update README.md

- DGGML_NATIVE=ON is now default

* Update ik_llama-cuda-swap.config.yaml

- Adapt to the latest version

* Update ik_llama-cpu-swap.config.yaml

- Adapt to the latest version

* Update ik_llama-cuda-swap.config.yaml

- Add model with aliases

* Update ik_llama-cpu-swap.config.yaml

- Add model with aliases
2026-03-24 07:52:54 +01:00
Nexes the Elder 094f76ee86
Cleaner log for adjusted splits (#1494)
* sweep-bench: add more skipped patterns to --minilog

* cleaner log for adjusted splits

* Add totalization for adjusted splits

* Clean up semicolons

* Addition for totalizer ^^

* Change accordingly to review

* Forgotten leftover removed

* 'total' instead of 'totalized'
2026-03-24 07:49:40 +01:00
firecoperana cdf9142aa5
fix grammar stack empty error for qwen3.5 (#1490)
* fix grammar stack empty error for qwen3.5

* Add to --help

---------

Co-authored-by: firecoperana <firecoperana>
2026-03-24 07:48:20 +01:00
Kawrakow b7a2bde4cc
Take into account layer sizes for setting GPU layers (cont) (#1476)
* Also take into account KV cache

* Take into account attn_wkv_b and mla = 3 compute buffers
2026-03-23 17:46:53 +01:00
Kawrakow 4eb08208f2
Fix misleading quantize error message (#1493) 2026-03-23 13:55:18 +01:00