Skip to content

Upstream sync 2026-04-30 + pin GGML_HIP_GRAPHS=OFF#11

Merged
kmbandy merged 103 commits into
masterfrom
feature-upstream-sync-20260430
Apr 30, 2026
Merged

Upstream sync 2026-04-30 + pin GGML_HIP_GRAPHS=OFF#11
kmbandy merged 103 commits into
masterfrom
feature-upstream-sync-20260430

Conversation

@kmbandy

@kmbandy kmbandy commented Apr 30, 2026

Copy link
Copy Markdown
Owner

Summary

Syncs fork with upstream ggml-org/llama.cpp master as of 2026-04-30, plus one fork-specific guard commit.

What's in the upstream sync

  • GGML version bump to 0.10.1
  • CUDA op fusions (SSM_CONV+ADD+SiLU, RELU+SQR) and MMQ kernel rewrite
  • Flash-attention tile/dispatch updates
  • ggml-backend-meta: partial tensor write support for split buffers (was hard-assert offset==0)
  • ggml-backend-reg: deduplication guards for backend/device registry
  • common/common.h: cpu_paramscommon_cpu_params, common_params_speculative split into sub-structs
  • GGML_HIP_GRAPHS default flipped to ON upstream

Fork-specific change (96cf31b)

Pins GGML_HIP_GRAPHS=OFF via FORCE in top-level CMakeLists.txt before the add_subdirectory(ggml) call. Upstream's new default conflicts with GGML_HIP_NO_VMM=ON and our dynamic tiered KV cache + weight pager work.

Pre-merge review findings

  • ✅ No conflicts with custom files (llama-kv-cache-tiered, llama-weight-pager, server-tiered-cache, llama-io-uring, llama-eviction-policy)
  • common.h renames don't affect any of our custom TUs (confirmed by grep)
  • ⚠️ MAD-16: HIP Graphs — pinned OFF, needs proper validation before enabling
  • ⚠️ MAD-17: ggml-backend-meta partial write semantics — precautionary runtime check pending
  • ℹ️ MAD-18: common.h rename tracking for future custom code

IMbackK and others added 30 commits April 23, 2026 02:34
In ggml-org#11362 hip graph was disabled by default as, at the time, its performance impact was negative. Due to improvements in rocm and our usage and construction of graphs this is no longer true, so lets change the default.
* shader(im2col): implement the im2col shader

* shader(im2col): clean the formatting issues

* shader(im2col): clean the editorconfig checker warning

* fix(shader): address the workgroup issues of im2col and conv2d
* sycl : fused MoE mul_mat_vec_q for TG

Create an MMVQ kernel so ggml_sycl_mul_mat_id can consolidate
n_experts_used matmuls in a single kernel launch. The kernel
also reads expert IDs directly, removing a per-call host sync.

This is similar to the CUDA backend's ggml_cuda_mul_mat_vec_q*
paths.

All types supported in the current MMVQ are supported here as well:
Q2_K, Q3_K, Q4_K, Q5_K, Q6_K, Q4_0, Q4_1, Q5_0, Q5_1, Q8_0

It will fall back to the existing per-expert path when src0 has been rewritten
by opt_for_reorder(), and for any shape the fused path doesn't handle.

test-backend-ops passes for supported type/shape combos.

Benchmark: Qwen3-Next-35B-A3B Q4_K_M on Intel Arc B70 (SYCL0),
baseline 707c0b7, 16k context, -fa 0.

  build/bin/llama-bench -hf unsloth/Qwen3.5-35B-A3B-GGUF:Q4_K_M \
    -p 1024 -n 128 -d 16384 -ngl 99 -fa 0 -ub 2048 -r 2 -dev SYCL0

Before (3 runs on 707c0b7):

  | test            |            run 1 |            run 2 |            run 3 |
  | --------------- | ----------------:| ----------------:| ----------------:|
  | pp1024 @ d16384 |   533.26 ±  4.87 |   535.20 ±  2.78 |   524.27 ±  3.10 |
  | tg128  @ d16384 |    33.47 ±  0.02 |    33.31 ±  0.02 |    33.17 ±  0.05 |

After (3 runs on 707c0b7 + this patch):

  | test            |            run 1 |            run 2 |            run 3 |
  | --------------- | ----------------:| ----------------:| ----------------:|
  | pp1024 @ d16384 |   534.06 ±  0.97 |   531.95 ±  0.02 |   520.94 ± 20.10 |
  | tg128  @ d16384 |    45.85 ±  0.21 |    45.95 ±  0.45 |    46.22 ±  0.12 |

disclosure: Claude wrote it, but I reviewed and understand the implementation
(albeit my C is a little rusty).

* sycl: also support nvfp4 and mxfp4 expert types

* sycl: terser comments/nested dispatch in response to review

* sycl: more comment cleanup in mmvq.cpp/hpp

---------

Co-authored-by: Debian <aaron@openllmi.net.bots.is>
…rt to GGUF (ggml-org#22247)

* Handle ModelOpt produced mixed precision model during convert to GGUF

* Apply suggestions from code review

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>

* Apply suggestions from code review

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>

---------

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>
… package. (ggml-org#22078)

* upgrade oneAPI to 2025.3.3

* update

* seperate SYCL CI and support release binary package for ubuntu 24

* add dependence

* remove wrong copy lines

* add missed line

* remove other task to test the release for SYCL

* rm more for test release

* fix file name

* correct the error in running

* support build for fp32/fp16

* rm ubuntu-24-sycl-fp16 for duplicated

* refactor build setting

* update guide for ubuntu 24 release package, restore the release.yml for other backend

* user docker replace to install oneAPI

* use download installation package to replace docker

* use wget to download and install oneapi, replace the apt cmd

* enable ccache for oneAPI installation

* fix format error

* enable cache for oneAPI installation

* update guide

* Update .github/workflows/release.yml

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>

* Update .github/workflows/release.yml

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>

* Update .github/workflows/build-sycl.yml

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>

* Update .github/workflows/release.yml

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>

---------

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>
…rg#22239)

Fixes ggml-org#22237 — the find_library(MATH_LIBRARY m) result was being
discarded and the target linked against the literal 'm' string.

This prevents users from overriding the math library (e.g. for AMD AOCL)
via CMake variables. Now the discovered MATH_LIBRARY is used directly.
* gitignore: add AGENTS.local

Assisted-by: llama.cpp:local pi
Signed-off-by: Georgi Gerganov <ggerganov@gmail.com>

* gitignore: rename AGENTS.local to AGENTS.local.md

Assisted-by: llama.cpp:local pi
Signed-off-by: Georgi Gerganov <ggerganov@gmail.com>

---------

Signed-off-by: Georgi Gerganov <ggerganov@gmail.com>
* model-conversion : fix mmproj output file name [no ci]

This commit updates the convert-model.sh script to properly handle
mmproj output files.

The motivation for this that currently the same name as the original
model is used as the mmproj file, which causes the original model to
be overwritten and no mmproj-<model_name>.gguf to be created.

* model-conversion : use MODEL_NAME [no ci]
When testing claude code against llama.cpp, I noticed that only
n_past 18577 was used even when context was 60k or more. The log
in llama-server says:
```
slot update_slots: id  3 | task 10342 | old: ... ; cch= | defa0;You are
slot update_slots: id  3 | task 10342 | new: ... ; cch= | 1c8b4;
```
I observed that the cch value changed every time. Reading about that,
the x-anthropic-billing-header system message seems to be specially
handled inside of the anthropic api. I could remove it, but there
is a meaningful string sometimes included at the end. So instead,
I just replace the changing cch checksum with fffff.

I'm treating this as an anthropic message body API detail - I think this
is the right way to do this, but by all means please correct me!

It's always 5 hexadecimal characters, but I've written the replacement
defensively in case they change the protocol.
Signed-off-by: Adrien Gallouët <angt@huggingface.co>
…869) (ggml-org#22267)

* server: clamp n_discard to non-negative at JSON parse boundary (CVE-2026-21869)

A negative n_discard from client JSON causes heap-buffer-overflow in
update_slots() context-shift loop (CWE-787, CVSS 8.8). Clamp to 0 at
ingress; n_discard=0 already triggers auto-discard (n_left/2).

Ref: GHSA-8947-pfff-2f3c

* cont : cleaner

* cont : cleanerer

* cont : cleanest

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
* Add the tests that we want to run on external CI

* remove extra files

* Fixes python issues, reove the deadlock on CI

* remove unecessary changes

* use override to ty.toml

* fix pre-commit and try tests with secret in external repo not upstream

* skip if key is unavailable

* Fix feedback

* switch hexagon to snapdragon

* cleanup

* fix secrets

* remove the copyrights at the top of the files
)

* hexagon: restore HTP_OPMASK_QUEUE

* hexagon: honor OPMASK_SKIP_COMPUTE in hmx-matmul

* hex-prof: restore op profiling

* hex-prof: enable PMU

* hexagon: simplify and improve op-queuing with full profiling support

Add separate profile descriptors.

* hexagon: remove opsync and rename opmask into opstage

opsync is no longer needed since the profiler is fully async now.
opmask name was confusing and opstage is more accurate.

* hexagon: refactor opbatch queue handling

* hexagon: add iface hooks for enabling profiler from the host

Also move all the PMU setup stuff out of the hex-utils since it's not inteded for normal use.

* hexagon: make profiler mode configurable

On older devices getting PMU counters is expensive so it's now optional.

* hexagon: add support for setting profiler pmu events from env

* hexagon: simplify profiler output (no need to print buffs, etc)

* hexagon: simplify pmu counter formating

* hexagon: add a simple profile post-proc tool

* hex-prof: add support for reading logs from stdin

* hexagon: document GGML_HEXAGON_PROFILE

* hex-prof: update default width for dims field

* hex-prof: fix linter warnings and errors

* Update ggml/src/ggml-hexagon/htp/htp-ops.h

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>

* Update scripts/snapdragon/ggml-hexagon-profile.py

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>

---------

Co-authored-by: Trivikram Reddy <tamarnat@qti.qualcomm.com>
Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>
…-org#22264)

This change implements the third requested change in issue 20429.
Because defaults.sampling contains the reasoning budget token count and
the reasoning budget message, it's not necessary to assign them to
struct variables.
* hexagon: add SOLVE_TRI op

* ggml: fix TODO description for solve_tri

* hexagon: rm unused variable/function warnings

* hexagon: chunk vs batch processingfor better thread utilization

* hexagon: vectorize partial f32 loads

* hexagon: move HVX f32 add/sub/mul wrappers to hvx-base.h

---------

Co-authored-by: Todor Boinovski <todorb@qti.qualcomm.com>
Signed-off-by: Adrien Gallouët <angt@huggingface.co>
…ggml-org#22199)

* ggml-webgpu: add tile flash attention fallback

* ggml-webgpu: add new fields and discard usage of mnk for tile version

* ggml-webgpu: modify the vec path to discard the mnk parameter

* ggml-webgpu: enable flash attention vec and tile version for broswer

* ggml-webgpu: stagging KV for flash attention tile version

* formatting

* turn on subgroup uniformity check

* remove Q_TILE as it is always 1 for vec path

* make row_max and exp_sum to local register

* make different bindings with same underlying buffer to have the same usage flags

* move path selection into the shader library and have the host consume a single flash-attn decision object.

* turn off skip_validation and address buffer overlapping when nwg==1

* formatting

* merge binding when kv overlap
angt and others added 4 commits April 30, 2026 21:32
Signed-off-by: Adrien Gallouët <angt@huggingface.co>
* Update llama-mmap to work with 32-bit wasm and >2GB models

* Update to gguf.cpp style
ggml-org#22464)

* Add mat-vec fast path of MUL_MAT_ID.

* Add shared accumulation vec logic and the other types supports.

* Add i-quant mat-mat for MUL_MAT_ID and fix some parts

* Remove n_experts from shader_lib_context.
Upstream flipped GGML_HIP_GRAPHS to ON by default. Force it OFF in the
fork's top-level CMakeLists until we validate compatibility with
GGML_HIP_NO_VMM=ON and the tiered KV cache work. See MAD-13.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added the build label Apr 30, 2026
Conflicts resolved:
- .gitignore: kept mad-lab ignores (.gitnexus, .claude/, cmake artifacts) + upstream additions
- ggml/src/ggml-cuda/fattn-tile.cuh: added upstream DKQ==320 block (Mistral Small 4),
  kept our DKQ==576||640 combined form (upstream split to DKQ==576 only, which would
  break DKQ==640 instantiation still present in template-instances/)
- tools/server/server-context.cpp: kept tiered cache init + added upstream n_swa line

CMakeLists.txt: GGML_HIP_GRAPHS pinned OFF (pending VMM validation, see MAD-13)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kmbandy
kmbandy merged commit df128ca into master Apr 30, 2026
32 of 75 checks passed
kmbandy pushed a commit that referenced this pull request May 16, 2026
* spec: support MTP

* fix batch size

* rename files

* cont : simplify (#7)

* MTP: clean-up (#9)

* MTP: clean-up

* review: use llama_context_type instead of llama_graph_type

* review: remove llama_model_has_mtp

* review: fix convert issues

* convert: fix pycheck

* review: formatting

* use `mtp-` for identifying mtp models

* convert: fix mtp conversion

* mtp -> draft-mtp

* remove unused llama_arch

* add need_embd in speculative

* llama: allow partial seq_rm for GDN models for speculative decoding

Currently speculative checkpoint needs to restart from a checkpoint
after some draft tokens are not accepted, this leads to some wastage in
running the target again. This PR adds the ability to rollback upto
`draft_max` by storing the GDN intermediates.

* fix pending state

* vulkan: add GDN partial rollback

* meta: extend check to axis 1

* metal: add GDN partial rollback

Extend the gated delta net kernel to store intermediate states for
partial rollback support on the Metal backend.

- Add K (snapshot slot count) as a function constant
- Read input state from slot 0 of the 3D state tensor
- Write intermediate states to different slots during token loop
- For K=1, maintain backward-compatible single-slot behavior

Ref: ggml-org@8c05923

Assisted-by: llama.cpp:local pi

* delta_net_base: use ggml_pad instead of new_tensor

* review: add need_rs_seq

* review: rename part_bounded to n_rs

* review: deslop comments

* review: rename, add asserts

* server : adjust checkpoint logic (#11)

* server : adjust checkpoint logic

* cont : rm asserts

* server-context: fix early exit

* spec : fix compatibility with n-gram and add TODOs (#13)

* metal : cleanup

* llama : fix faulty bitwise check in recurrent memory

* server : disable RS-based MTP in combination with other spec types

* spec : add TODOs

* cont : fix comment

* cont : update comment

* common : fix logic for ngram + mtp compat

* llama-memory: enable checkpointing with partial rollback

* cont: add test-case for loading into a dirty ctx

* llama-memory-recurrent: clear rs_idx in clear

* download: fix mtp path

* llama-arch: fix enorm op

* docs: update docs

* conversion: fix type annotations

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
kmbandy added a commit that referenced this pull request May 20, 2026
Adds paged_cache_ops<TURBO3_0> + cooperative dequant in tile + decode kernels
+ scatter kernel + dispatch case + supports_op whitelist + bench axis. Mirrors
the existing TURBO4_0 plumbing; TURBO3_0 differs only in block payload
(qs[32] 2-bit low + signs[16] 1-bit high vs turbo4's nibble-packed qs[64])
and 3-bit centroid table. RHT is skipped on the paged path with the same
JL-bypass justification as turbo4 (see mt_scatter_kv_turbo4_0_kernel step 4
comment).

Files:
- ggml-cuda.cu: TURBO3_0 in PAGED_ATTN_MT supports_op whitelist (without
  this, the scheduler routes the op to CPU which doesn't implement it
  and aborts in ggml_get_n_tasks).
- mt_pagedattn_ops.cuh: paged_cache_ops<TURBO3_0> specialization.
- mt_pagedattn.cu: mt_scatter_kv_turbo3_0_kernel (128-thread cooperative
  quant, warp-cooperative qs/signs packing via __shfl_xor_sync), launch
  branch, HEAD_SIZE validation, dispatch case.
- mt_pagedattn_tile.cu: coop_stage_turbo3_tile + K/V dispatch + tile/tile_mw
  template instantiations at HS=128 and HS=256.
- mt_pagedattn_decode.cu: decode_coop_stage_turbo3 + K/V dispatch + decode
  template instantiations at HS=128 and HS=256.

Bench (Qwen3.6-35B-A3B-UD-Q4_K_XL @ R9700/gfx1201, n_predict=128):
  paged_turbo4  8K: 1948 prefill / 32.0 decode | 64K: 952 / 30.7
  paged_turbo3  8K: 1924 prefill / 32.5 decode | 64K: 936 / 30.9
TURBO3 == TURBO4 in throughput within run-to-run noise (~1.5%); 24% less
KV memory (3.125 vs 4.125 bpv) for the same effective speed. Quality
validation (PPL+NIAH sweep) pending — added as task #11.

Smoke-tested with --kv-tiered 100,0,0 --kv-tier-paged-blocks
--cache-type-k turbo3 --cache-type-v turbo3: server boots, completes a
53-token prompt at 57.7 decode t/s with coherent output. Locked baseline
JSON committed alongside as the new perf reference at HEAD.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.