8720 Commits
Author SHA1 Message Date
Mario Limonciello (AMD) a9a8430f99 Run job more frequently
This will keep it more aligned with upstream.
b9433 b9428 b9425 b9413 b9402 b9401 b9397 b9380 b9371 b9370 b9369 b9356 b9352 b9351 b9348 b9341 b9333 b9330 b9328 b9307 b9306 b9299 b9298 b9297 b9295 b9294 b9293
2026-05-22 08:08:24 -05:00
George Sofianos 2f7165ae7e fix: add rdna1 and rdna2 targets b9284 b9274 b9247 b9231 b9211 2026-05-17 08:58:26 -05:00
Jeremy Fowers d21d0ab42a Merge pull request #3 from lemonade-sdk/fix-windows-rocm-hip
windows-rocm: enable GGML_HIP
b9193 b9174
2026-05-16 00:22:29 -04:00
Jeremy Fowers e6452b54cd windows-rocm: drop deprecated -DGPU_TARGETS in favor of -DAMDGPU_TARGETS
Per PR review: GPU_TARGETS is the legacy name and AMDGPU_TARGETS is the
canonical one consumed by both HIP's CMake module and ggml's HIP
backend (ggml/src/ggml-hip/CMakeLists.txt:30 forwards AMDGPU_TARGETS to
CMAKE_HIP_ARCHITECTURES). The earlier defensive belt-and-suspenders
"set both" wasn't needed.
2026-05-16 00:00:00 -04:00
Jeremy Fowers 380c908ff2 windows-rocm: silence -Werror=incompatible-pointer-types on x86 CPU quants
The CPU per-microarch variants (now enabled by GGML_CPU_ALL_VARIANTS=ON)
fail to compile with TheRock 7.13's clang because upstream llama.cpp's
ggml/src/ggml-cpu/arch/x86/quants.c calls _mm_prefetch with a
const block_q4_0 * / const block_q8_0 * pointer instead of const char *.
Clang treats this as a hard error by default:

    quants.c:782:22: error: incompatible pointer types passing
        'const block_q4_0 *' to parameter of type 'const char *'
        [-Wincompatible-pointer-types]

The cast is harmless at runtime - _mm_prefetch just consumes the address -
so demote it back to a warning via -Wno-error=incompatible-pointer-types
in CMAKE_C_FLAGS. This unblocks the CPU SSE42 / haswell / etc. variants.
2026-05-15 20:47:59 -04:00
Jeremy Fowers d6d8dbb67c windows-rocm: flip GGML_CPU=ON so per-microarch variants compile
The prior commit added -DGGML_CPU_ALL_VARIANTS=ON but kept -DGGML_CPU=OFF,
which fails configure with:

    CMake Error at ggml/src/CMakeLists.txt:349 (ggml_add_cpu_backend_variant_impl):
      Unknown CMake command "ggml_add_cpu_backend_variant_impl".

The function lives in ggml/src/ggml-cpu/CMakeLists.txt. That subdirectory is
only added by ggml_add_backend(CPU), which is gated on GGML_CPU truthy. With
GGML_CPU=OFF the subdir is never loaded so the function is undefined when
GGML_CPU_ALL_VARIANTS tries to call it.

Flip to GGML_CPU=ON; the GGML_CPU_ALL_VARIANTS branch takes precedence over
the single-variant elseif (GGML_CPU) at ggml/src/CMakeLists.txt:377, so we
still get the per-microarch ggml-cpu-*.dll plugins (matching the historical
artifact layout) rather than a single ggml-cpu.dll.
2026-05-15 20:20:35 -04:00
Jeremy Fowers b65b264491 windows-rocm: add -DGGML_CPU_ALL_VARIANTS=ON so the CPU backend ships
The previous fix added -DGGML_HIP=ON and produced a working ggml-hip.dll,
but at runtime llama.cpp failed model load with:

    llama_model_load: error loading model: make_cpu_buft_list: no CPU backend found
    srv main: exiting due to model loading error

GGML needs a CPU backend even when the model runs on GPU - for non-GPU
buffer types like host scratch buffers. The Windows job sets -DGGML_CPU=OFF
and previously emitted per-microarch CPU plugin DLLs (ggml-cpu-zen4.dll etc.)
via GGML_CPU_ALL_VARIANTS, but that variable defaults to OFF and was never
explicitly set. The prior CPU-only labeled "rocm" zip happened to ship those
plugins under different cmake conditions; once GGML_HIP=ON was added and the
HIP build path actually configured, the CPU plugin path stopped being taken.

Add -DGGML_CPU_ALL_VARIANTS=ON to bring the per-microarch CPU plugins back,
matching what the older "rocm-stable" zip contained and what llama.cpp needs
at load time.
2026-05-15 17:36:27 -04:00
Jeremy Fowers 9f0b227106 windows-rocm: enable GGML_HIP and verify ggml-hip.dll was built
The windows-rocm CI job was passing CMAKE_HIP_COMPILER, HIP_PATH, and
GPU_TARGETS but never setting -DGGML_HIP=ON, so ggml's CMakeLists never
added the ggml-hip subdirectory. CMake silently warned:

    Manually-specified variables were not used by the project:
      CMAKE_HIP_COMPILER
      GPU_TARGETS
      HIP_PATH

The build completed, produced a zip labeled rocm, but contained zero
HIP backend DLLs - runtime callers fell back to CPU.

Fix:
- Add -DGGML_HIP=ON so the ggml-hip target actually configures.
- Also pass -DAMDGPU_TARGETS in addition to -DGPU_TARGETS (the former
  is the canonical name on Windows clang/hipcc; both are accepted).
- Drop the duplicate -DCMAKE_BUILD_TYPE=Release.
- Add a post-build "Verify HIP backend was built" step that lists
  build/bin and fails the job if ggml-hip*.dll is absent, so the
  silent CPU-only fallback can never reach release artifacts again.
2026-05-15 15:39:41 -04:00
Mario Limonciello (AMD) 76a3e8d538 Fix 7.13 links b9160 2026-05-15 01:28:11 -05:00
Mario Limonciello 28d8537fd0 Merge pull request #2 from lemonade-sdk/7.13
Update to ROCm 7.13
b9159
2026-05-14 23:13:39 -05:00
Mario Limonciello (AMD) 2ef153b37b Update to ROCm 7.13 2026-05-14 23:11:38 -05:00
Mario Limonciello 74cb8594ae Build Linux using OpenMP b9146 b9131 b9115 b9102 b9093 b9088 b9071 b9052 b9039 b9029 b9016 b9010 b9002 b8994 b8984 b8968 b8955 b8943 b8935 b8925 b8914 b8901 b8895 2026-04-22 21:07:21 -05:00
Mario Limonciello 9d6d58afa1 Use correct tag job b8882 b8864 b8860 2026-04-20 12:33:27 -05:00
Mario Limonciello ef4803ba3b correct releasing repo 2026-04-20 12:04:53 -05:00
Mario Limonciello (AMD) a7e932e795 Fix tag creation skipper
Forgot to add conditionals.

Fixes: f834e99a1 ("Skip release creation if tag already exists")
b8706
2026-04-15 07:34:56 -05:00
Mario Limonciello cfa099bfd4 Drop DLL files from Windows ROCm release b8705 2026-04-10 10:47:15 -05:00
Mario Limonciello (AMD) f834e99a16 Skip release creation if tag already exists b8704 2026-04-09 06:01:12 -05:00
Mario Limonciello (AMD) 4bcad9099e Adjust for Lemonade CI jobs b8703 2026-04-08 08:22:20 -05:00
Mario Limonciello (AMD) 8aa8b03342 Drop all files 2026-04-07 20:31:03 -05:00
66c4f9ded0 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 <[email protected]>

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

Co-authored-by: Johannes Gäßler <[email protected]>

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

Co-authored-by: Johannes Gäßler <[email protected]>

* Renoved trailing white line 500

* Update mmq.cuh removed other whitelines

* Remove trailing whitespaces

---------

Co-authored-by: iacopPBK <[email protected]>
Co-authored-by: Johannes Gäßler <[email protected]>
Co-authored-by: iacopPBK <[email protected]>
2026-04-07 21:47:42 +02:00
Daniel Bevenius 93bdc61563 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.
2026-04-07 21:24:25 +02:00
Georgi Gerganov 4eb19514dd kv-cache : support attention rotation for heterogeneous iSWA (#21513)
* kv-cache : support attention rotation for heterogeneous iSWA

* cont : remove assert
2026-04-07 20:31:28 +03:00
Reese Levine 957d717ce5 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
2026-04-07 20:30:01 +03:00
Aman Gupta de1aa6fa73 CUDA: check for buffer overlap before fusing (#21566)
* CUDA: check for buffer overlap before fusing

* use ggml_cuda_check_fusion_memory_ranges
2026-04-08 00:57:04 +08:00
Aaron Teo 69c28f1547 llama-server: fix model params not propagated (#21509)
Signed-off-by: Aaron Teo <[email protected]>
2026-04-07 21:39:41 +08:00
Son H. NguyenandAldehir Rojas 0d049d6a92 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 <[email protected]>
2026-04-07 16:13:38 +03:00
Johannes Gäßler a8ec0df461 llama: remove per-arch tensor name lists (#21531) 2026-04-07 15:02:03 +02:00
Georgi Gerganov e8f5082697 server : fix restore for checkpoints with pos_min == 0 (#21510) 2026-04-07 15:29:17 +03:00
Georgi Gerganov 22fc79134e ggml : deprecate GGML_OP_ADD1 (#21363)
* ggml : deprecate GGML_OP_ADD1

* cont : remove tests

* cont : re-enable vulkan check
2026-04-07 15:28:27 +03:00
Tom Overlund 2a619f6fbc ggml: Vulkan build, Linux -- output error string for errno on fork failure (#20868) (#20904) 2026-04-07 13:54:55 +02:00
mkoker edd4d9bca5 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.
2026-04-07 13:41:29 +02:00
Aldehir Rojas 482192f12d webui : store reasoning_content so it is sent back in subsequent requests (#21249) 2026-04-07 13:32:44 +02:00
Antoine Viallon 71a81f6fcc 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.
2026-04-07 12:18:55 +02:00
Aleksander Grygier ecce0087da fix: Detect streaming state in reasoning content blocks (#21549) 2026-04-07 12:04:41 +02:00
Kabir08 d1f82e382d 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
2026-04-07 11:37:20 +02:00
PMZFX 0988accf82 [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
2026-04-07 16:12:49 +08:00
Dmytro Romanov 0033f53a07 docs: fix typo in build.md (emdawbwebgpu -> emdawnwebgpu) (#21518) 2026-04-07 12:37:26 +08:00
Masashi YoshimuraandReese Levine d0a6dfeb28 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 <[email protected]>
2026-04-06 13:08:46 -07:00
Pasha KhosraviandSigbjørn Skjæret 2e1f0a889e 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 <[email protected]>

* fix /r/n spacing + arch-fallback

---------

Co-authored-by: Sigbjørn Skjæret <[email protected]>
2026-04-06 20:55:21 +02:00
Bipin YadavandSigbjørn Skjæret 506200cf8b 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 <[email protected]>

* Fix EditorConfig linter error

---------

Co-authored-by: Sigbjørn Skjæret <[email protected]>
2026-04-06 20:54:06 +02:00
Gaurav Garg 15f786e658 [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
2026-04-06 20:34:29 +02:00
Aman Gupta 94ca829b60 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
2026-04-06 22:26:02 +08:00
Aldehir Rojas 4aa962e2b0 vocab : add byte token handling to BPE detokenizer for Gemma4 (#21488) 2026-04-06 09:08:37 -05:00
Sigbjørn Skjæret 941146b3f1 convert : fix block_ff_dim retrieval for lfm2 (#21508) 2026-04-06 14:05:18 +02:00
lainon1 482d862bcb 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.
2026-04-06 14:03:02 +02:00
Xuan-Son Nguyen 3979f2bb08 docs: add hunyuan-ocr gguf, also add test [no ci] (#21490) 2026-04-06 14:02:37 +02:00
Georgi Gerganov 400ac8e194 convert : set "add bos" == True for Gemma 4 (#21500)
* convert : set "add bos" == True for Gemma 4

* cont : handle old GGUFs
2026-04-06 13:52:07 +03:00
Neo Zhang f51fd36d79 sycl : handle other FA case (#21377) 2026-04-06 13:28:00 +03:00
Yarden Tal 25eec6f327 hexagon: slight optimization for argosrt output init (#21463) 2026-04-05 18:30:25 -07:00
anchortense 58190cc84d llama : correct platform-independent loading of BOOL metadata (#21428)
* model-loader : fix GGUF bool array conversion

* model-loader : fix remaining GGUF bool pointer uses
2026-04-06 01:40:38 +02:00