Skip to content

Sync gfx11 with master (2026-12-04) - #266

Draft
liangliangchang wants to merge 404 commits into
gfx11from
lichang.gfx11-sync-master-1204
Draft

liangliangchang wants to merge 404 commits into
gfx11from
lichang.gfx11-sync-master-1204

Conversation

@liangliangchang

@liangliangchang liangliangchang commented Dec 4, 2026 •

Copy link
Copy Markdown

Sync gfx11 at 75b90072d74ae2d1191b890395e4b687b03519fc with master at e3e42250b38b55339f848273620dfe433ba4aa17, including the upstream update merged in #265 (upstream c3e91d61a262592ee475a3f8fd4c48253a0e4432). This brings 401 master commits into gfx11.

Upstream did its own RDNA and GDN work in this range, so the merge needed more than conflict picking. GGML_HIP_UNSAFE_MATH still defaults to OFF.

Conflict resolutions (commit 9bf9905fa)

  • GDN kernel (gated_delta_net.cu): keep the fork's ordered reduction (GGML_CUDA_GDN_ORDERED) and chunked prefill path together with upstream's replay mode (GDN: use replay instead of rollback ggml-org/llama.cpp#31669) and gate registers. The chunked path only takes batches without pending replay tokens. The replay loop uses the same partial sums as the main loop, so a replayed state still matches with the ordered option on; with the default (off) the arithmetic is upstream's.
  • Flash attention (fattn.cu, fattn-mma-f16.cuh): keep the D72 padding path on top of upstream's K/V type templates; take upstream's wider RDNA guard for single-column MMA tiles (CUDA/HIP: Use the MMA FA kernel for maskless attention on RDNA ggml-org/llama.cpp#32930), which includes the fork's vision exception.
  • Fusion code: upstream moved it from ggml-cuda.cu to fusion.cu (CUDA: move the fusion code out of ggml-cuda.cu ggml-org/llama.cpp#33087). The fork's changes inside the moved code are ported: the ROCmFP4 exclusion from the fused mat-vec dispatch, the device argument of ggml_cuda_mmq_needs_fallback, and the RDNA3.5 FLASH_ATTN_EXT + RESHAPE + SET fusion. The concurrent-join guard and the channels-major SSM_CONV support check stay in ggml-cuda.cu, combined with upstream's new conditions.
  • mmvq.cu: keep the DQ mat-vec dispatch. test-backend-ops.cpp: the SSM_CONV test carries both channels_major and upstream's non_cont. server-common.cpp: upstream's tool_choice type; the stream + tools + logprobs throw stays removed.
  • scripts/hip: upstream replaced gcn-cdna-vgpr-check.py with gcn-cdna-metrics.py; the fork's allowlist entries are carried into IGNORED_VGPR.

Conflicts without markers, found by the GPU tests (same commit)

  • D72 attention gave wrong results for F32 K/V and for non-square shapes. Upstream's new mask-less rule routes more D72 cases to the MMA kernels, where the fork's padding path was applied unconditionally. The padding is now applied only under the fork's own selection rule, through one shared predicate.
  • Qwen3.5 contexts with replay aborted (GGML_ASSERT(sx->ne[0] == d_inner)), which broke MTP and the context-state test. Upstream's replay conv-state builder returned a time-major tensor to the fork's channels-major convolution. It now returns its channels-first columns for channels-major callers, which also skips a transpose.

Separate fix for an existing gfx11 bug (commit bf76a7d50)

  • zonos3 called the time-major convolution on the channels-major conv state and aborted when its graph was built. This is on gfx11 since Sync gfx11 with master (2026-11-20) #236 and is not caused by this sync. With the fix the synthetic zonos3 model passes on GPU and CPU; on unmodified gfx11 it aborts.

Fix for the new rpc-cpu check (commit 28b9b4876)

  • The rpc-cpu job is new with this sync (models-check.yml). It aborted for qwen3next on the Meta (multi-device) backend, and unmodified gfx11 aborts the same way. The fork keeps the conv history channels-major; for Qwen 3 Next that row has two segment sizes per conv column, which the Meta backend cannot carry through a reshape. Upstream keeps this arch time-major for that reason.
  • Qwen 3 Next now uses the time-major layout only with -sm tensor, the only mode that uses the Meta backend. Every other mode keeps the channels-major convolution, which on Qwen3-Next-80B-A3B makes a 3968-token prefill 3.1% faster at ubatch 512 and 29.5% faster at ubatch 4096 (Halo40, both orders).
  • Verified with the job's own procedure on CPU (604/604 tests, and 120/120 with --kv-shift) and on gfx1151 (qwen3next, qwen35, qwen35moe, zonos3 pass on GPU, CPU and Meta; clover_moe on GPU and CPU; 370/370 recurrent/convolution checks).
  • A Qwen 3 Next session state saved with -sm tensor is not interchangeable with one saved in another split mode.

Known, not changed here

  • test-llama-context multi-sequence replay on Qwen3.5-2B (tolerance NMSE 0.0001). It fails on every build even on CPU, and upstream master fails it on this GPU, so it does not gate this merge. The only change is that GGML_CUDA_DQ_MMV=0 no longer makes it pass. The other three cases (rollback, rollback bounds, shared state) pass everywhere.

    Build GPU default GPU DQ_MMV=0 CPU
    gfx11 75b90072d fail (0.000214) pass fail (0.001095)
    master e3e42250b fail (0.000182) n/a fail (0.000700)
    this PR fail (0.000246) fail (0.000229) fail (0.001095)
  • HIP quality check: upstream's own master fails it since 5b1ba66b5 (one FP8 flash-attention kernel at 257 VGPRs), and the reworked workflow compares kernel metrics against the base branch, so a sync of this size is expected to report blocking differences. Some carried-over allowlist names may also need refreshing from its output.

Validation

On xconucstrhalo41 / gfx1151, Release HIP build of bf76a7d50 (the third commit was validated separately, see above) with HIP graphs ON and unsafe math OFF (TheRock 10.1.0a20260731, clang 23), zero compiler warnings, all GPU jobs under the shared board lock:

  • 8/8 unit tests passed: Unicode, sampling, grammar parser, llama grammar, batch allocation, quantization functions, GGUF, and server components.
  • 5009 GPU numerical checks passed, 0 failed, against the CPU reference: 370 recurrent/convolution, 46 matrix multiplication, 338 MoE, 103 fused matrix operations, 42 row-storage, 4092 flash-attention cases (head sizes 40 to 128, including the fork's vision and D72 dispatch), and 18 FLASH_ATTN_EXT_SET. Unsupported backend configurations were skipped separately.
  • Synthetic-model architecture test on GPU and CPU: qwen3next, qwen35, qwen35moe, zonos3 pass on both; clover_moe passes on GPU.
  • Server smoke tests with --ctx-checkpoints 32 --checkpoint-min-step 8192: dense Qwen2.5-0.5B, GDN Qwen3.5-2B, Qwen3.5-2B MTP, and Qwen3-30B-A3B each completed exact 128- and 3968-token prompts with 32 generated tokens; MTP accepted 20/31 and 20/32 drafted tokens. Gemma-3-4B vision completed a 1024x800 image request.

The full regression model matrix (111 configurations, paired against gfx11 75b90072d) is running; results will follow.

Validation artifacts: /proj/gdba/lichang/reviews/llamacpp-gfx11-sync-master-20261204/.

AI assistance: Claude Code prepared the merge, resolved the conflicts, ported the relocated code, diagnosed and fixed the test failures, ran the validation, and created this draft PR.

🤖 Generated with Claude Code

maxipesfix and others added 30 commits November 25, 2026 15:43
…ames (otherwise web interface gets Error 500) (ggml-org#33037)

* ready for PR

* addressing review comments
…3038)

* vocab : implement Metaspace prepend_scheme always for BPE

* Drop test-tokenizer-mmbert
* llama.cpp : bump version to 1.1.0

* authors : update
…33002)

* ggml-openvino: write back consumed in-place nodes of op-test graphs

On the naive path every node of an op-test graph is a model output,
except an in-place node that another node reads: it got no output, so
its destination buffer was never written. GATED_DELTA_NET_CACHE_FUSION
copies the final state into the cache and then reads the copy, so the
cache kept its old contents.

Write such a node back through its view_src, as is already done when
nothing reads it. Model graphs are unchanged.

* ggml-openvino: keep the rest of the buffer in a partial in-place FILL

An in-place FILL on a view into part of a larger buffer produced only
the filled values. Its output stands for the whole in-place source, so
the write-back put those values at the start of the buffer and not at
the view's offset.

For a contiguous view with a static shape, build the whole buffer: the
elements before the view, the filled values, then the elements after
it. Add NodeContext::get_inplace_op_src() to detect the in-place case.

* ggml-openvino: fix softplus precision for large negative inputs

softplus was computed as relu(x) + log(1 + exp(-|x|)). When exp(-|x|)
is below the precision of 1 + exp(-|x|), the log returns 0 or one ulp,
so for x below about -16 in f32 the result was 0 or far off. The
SOFTPLUS test case with inputs in [-16.6, -16] fails on CPU and GPU.

Compute log1p(y) for y = exp(-|x|) with the series
y - y^2/2 + y^3/3 - y^4/4 when y < 0.01, where its relative error is
below 2e-9, and keep log(1 + y) above that.

* ggml-openvino: finer GPU KV rounding for decode batches

Rounding the GPU KV length up to a power of two makes a batch attend up
to twice the rows that hold data right after each power of two. Decode
reads every attended row, so long contexts lose decode speed.

The GPU plugin keeps memory for each attended length: several large
buffers for a prompt batch, about one copy of K and V for a decode
batch. Keep the power of two for prompt batches (more than 16 tokens
per sequence), and round decode batches up to a multiple of 2^k / 4 and
of 256. That is four lengths per power of two, with at most 25% masked
rows.

* ggml-openvino : keep the head axis of the 4-D KV cache static

* ggml-openvino: split two one-line lambdas per clang-format

The backend's .clang-format keeps a lambda on one line only when it is a
function argument (AllowShortLambdasOnASingleLine: Inline). The constant
helpers in the softplus and FILL translators are assigned to variables,
so clang-format splits them. Formatting only.

---------

Co-authored-by: Mustafa Cavus <mustafa.cavus@intel.com>
* model : add hy_v4_flash on the DSA iSWA cache

Tencent Hy4 flash is a hy_v4 trunk (iHC, gated MLA, sinks) with
sparse and sliding-window MLA layers, sandwich norms, latent routed
experts and deepseek41 Engram tables.

The sparse layers select their context with a pooled indexer: the
keys of 4 consecutive tokens are pooled by a per-channel softmax of a
gate plus a position bias, normed, and rotated at the position of the
first token. A token attends to the best scored pools of its sequence
plus its own pool.

The model runs on llama_kv_cache_dsa_iswa as dots3note does. The
indexer cache holds the projected value and gate of each token, and
the pools are rebuilt from the cells for every ubatch by
llama_kv_cache::set_input_kpool(), so there is no pooled state to
keep in sync with sequence edits, checkpoints or state save/restore.
The selection goes through ggml_top_k_mask with the pool members as
blocks and the token's own pool as extra cells.

Not covered yet: the MTP block (its tensors are skipped), the vision
tower, multiple KV streams, and backends without GGML_OP_TOP_K_MASK.

* convert : add hy_v4_flash

The converter of the hy_v4_flash model, without the vision parts.

The four Engram tables are written as one per_layer_token_embd
tensor of about 127 GB in BF16. Concatenating them with torch.cat
materializes the whole tensor at write time, so they are streamed one
table at a time in row chunks through the _StreamedBytes path of
deepseek41, which keeps the conversion within 100 GB of RAM.

* tests : add hy_v4_flash to test-llama-archs

A 4 layer fixture that alternates sparse and sliding-window layers,
with hyper-connections, one Engram module, an indexer on the sparse
layers and a latent width distinct from the expert width, so that a
transposed routed_down or routed_up is caught.

* kv-cache : do not shift the pooled indexer cache

The pooled indexer of hy_v4_flash caches the value and the gate of
each token, without a position: the pooled key is rotated in the
graph. A K-shift rotated these rows as if they were roped keys, which
broke the pooled keys after a context shift.

* tests : add the hy_v4_flash Metal fusion baseline

* model, mtmd : add hy_v4_flash vision

The vision tower of hy_v4_flash, with its projector in mtmd and its
converter.

The published files carry M-RoPE sections, so the text model runs the
interleaved M-RoPE path: the rope rows keep their reference order and
are reordered to NeoX halves in the graph. The tokens of an image share
their position, so the indexer pools now group consecutive tokens in
sequence order instead of consecutive positions, and a pooled key is
rotated at the four positions of its first member.

Without a backend that runs GGML_OP_TOP_K_MASK, the picked pools are
expanded to their cells and go through build_top_k_mask.

* CUDA: lightning indexer for 16 heads

hy_v4_flash scores its pools with 16 indexer heads, which the CUDA
backend did not support, so the scheduler ran the 12 sparse layers'
indexers on the CPU at every step. Both kernels already handle 16
heads: the mma kernel needs a multiple of 16 and the vector kernel
splits the heads in 4 passes.

* model : move the Hy4 flash Engram gathers before the token embeddings

With the gathers after build_inp_embd, the mixed embedding DUP and SET_ROWS
sat between two host nodes and stayed on the CPU. Those ops use every thread,
so all the CPU workers woke up on each decoded token for a 12K copy.
Gathering first lets the scheduler put them on the GPU, as in qwen4exp, and
leaves only small single threaded lookups on the host.

* llama : speed up the Hy4 flash pool inputs on long contexts

set_input_kpool deduplicated the pools through a map keyed by vectors even
with a single sequence, sorted cells that are already in order and scanned
every pool owner for each token. Dedup only when the ubatch has several
sequences, skip the sort when the cells are ordered and mark the earlier
pools of the token's sequence directly. At 129k cells the host cost of a
decode step drops from 4.0 ms to 0.5 ms, the logits are unchanged.

* llama : use a unified KV cache for Hy4 flash

The pools gather their members from a single KV stream, so a split cache
with several sequences hit an assert in the graph. Switch to the unified
cache with a warning, the sequences then share n_ctx.

* rm redundant code in mtmd

* clean up comments

---------

Co-authored-by: Xuan Son Nguyen <son@huggingface.co>
* CUDA: refactor & deduplicate FA data loading

* fix float2 indexing

* fix hip quality check
* use the indexed bias in the Inkling 2 graph
* Remove RPC check
* vocab : add RAON pre-tokenizer and NFC normalization
* model : add RAON hybrid attention and mHC graph
* convert : add MXFP8 weight dequantization
* convert : add RAON HF to GGUF conversion and schema
* chat : add the RAON chat template
* tests : add RAON vocab regression files for test-tokenizer-0
* llama-quant : add RAON quantization rules for attention projections
* vocab : move RAON to the standard tokenizer list and remove its dedicated tokenizer test
* convert : move MTP layer check to filter_tensors and correct comment on _KEEP_UNQUANTIZED
* convert : add orphan-scale gurad for MXFP8 scales
* model : remove redundant graph expansion, use require() for RDA head size validation, and add comment for MLA latent normalization
* llama : share KDA conv1d between Raon and Kimi K3
* convert : remove redundant MXFP8 dequantization
* model : align RAON MoE call formatting with other models
* tests : remove RAON quantization test
* model : match RAON MoE weight normalization to the HF reference
* set expert_weights_norm_eps to 1e-20, which introduced in commit 5c008e0
* tests : add Metal fusion test for Raon

Assisted-by: Codex
Assisted-by: Claude Opus 5.5

---------

Co-authored-by: Dong Won Kim <63934649+ddwkim@users.noreply.github.com>
Co-authored-by: Hyeonghwan Kim (김형환) <kim2h7903@krafton.com>
Co-authored-by: Seohyun Choi <seohyun.choi@krafton.com>
Co-authored-by: Piotr Wilkin <piotr.wilkin@syndatis.com>
Assisted-by: Claude (Opus 5.5 Medium)
`darwin.apple_sdk` is deprecated and has been removed. It's not needed
anymore to build on darwin.
PEFT names the wrapped projections (self_attn.k_proj.linear.weight) and the attention output gate (self_attn.o_proj.gate_proj.weight); neither is in the Inkling-2 tensor map, so convert_lora_to_gguf.py stops with 'Can not map tensor'. Strip the .linear. segment and map the gate to ATTN_GATE.

Co-authored-by: Sergio Sanchez <sergiosv96@users.noreply.github.com>
* metal : spread the short mat-vec lanes over src1 rows

The short mat-vec kernel (K < 32) mapped its 32 lanes to 32 src0 rows
and handled one src1 row per threadgroup, so with few src0 rows most
lanes were idle. It now covers min(ne01, 32) src0 rows of 32/that src1
rows.

This is the weighted sum over the depth states of Inkling 2 since
ggml-org#32855 (1-3 src0 rows, K = number of states, 2304 src1 rows).
Inkling-2-Mini UD-Q4_K_XL, M5 Max, master -> this PR:
  pp512 888 -> 1052 t/s, pp2048 771 -> 894 t/s, tg128 unchanged.
PPL and greedy output bit-identical, the graph is unchanged.

Tested: test-backend-ops -b MTL0 -o MUL_MAT (new small-K cases).

* cont : clean-up comment

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
…s, and manage MCP from settings (ggml-org#33036)

* ui: add inset lists, rounder bottom sheets and a native select to the design system

Inset lists (grouped rows with inset dividers, titles and captions) are surface utilities in llama-ui, documented in DESIGN.md and the Surfaces story. Bottom drawers get the sheet radius and rounder inset groups, switches a finger-sized variant, and SearchInput an inputClass prop.

NativeSelect is a trigger styled like the app's select that opens the OS's own picker, and useSheetPages a page stack with slide transitions for sheets.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: open settings and the add menu on phones as sheets of inset pages, and manage MCP from settings

On a phone, Settings is a full-height sheet over the sidebar: theme tiles, then a row per section that pushes the section's page, with Tools, tool groups and MCP servers as further pages. Changes apply as they are made. Selects open the OS picker, number fields are 16px so iOS does not zoom, and switches are finger-sized.

The + menu is a sheet of the same inset pages, which stays open while the file picker is up. Settings and a primary New chat button sit at the bottom of the phone sidebar, and Show less sticks to the bottom of the chat list.

Show MCP becomes Enable MCP: while it is off, no MCP server is connected and chats get no MCP tools. The servers are managed from Settings, in a dialog on the desktop and a page in the phone sheet; the sidebar entry and /mcp-servers are removed. Someone who already added a server gets Enable MCP on.

A setting can name the devices it applies to, and is listed only there. Switching sections scrolls back to the top, the system message has a placeholder, inputs offer no browser autofill, the desktop settings sidebar sits on the dialog's background, and the sidebar footer groups its rows only when it shows more than one.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: pick models on a phone from a short sheet, and list the desktop selector's models without a Local models section

On a phone, the model picker opens on a short view: the chat's model, the dictation model, loaded models, favorites and recent ones, marked In chat and Dictation. A tap switches the model; holding a row opens its menu, with More details and Unload for a loaded model. All models is a page of its own, in the same grouped rows. The reasoning effort keeps its list of levels, above the search, which is a SearchInput at the foot of the sheet in the chat form's surface.

On the desktop, the server's models are listed in their family groups without a Local models section around them. They sit in an Other models section only when favorites or loaded models are listed above them, and the section headings have no icons.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: let demos touch, hold and seed chats, and import traces through either settings section

demo.tap and demo.hold drive touch input on a phone viewport, a chats option seeds the sidebar with conversations, and trace imports find Data or Import/Export in the settings.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: release llama-ui 0.7.0 and llama-chat 0.3.0

Llama UI gains the sheet components (SheetHeader, SheetPages, InsetList and its rows) and NativeSelect; Llama Chat gains the phone sheets and Enable MCP.

Assisted-by: Claude (Opus 5.5 Medium)
Build the gradient dy * (1 - y^2) from the forward output with existing
ops, no new op is needed. Add TANH to the gradient-checked unary ops.

Signed-off-by: gianni-cor <gianfranco.cordella@tether.io>
…, and generic dma pipelines (ggml-org#32582)

* hexagon : add DMA pipeline, htp_tensor_read, and cache/mdev cleanup

- Add dma-proxy thread/ring for main-thread DMA offload (clamp n_hvx <= hw_nth - 2)
- Add syncht in hmx-queue after HMX VTCM stores

* hexagon : add F16/collapse graph lowering and fusion updates

* hexagon : update host kparams solver for W8A8 HMX, F16, and DMA

* hexagon : add INT-HMX W8A8 matmul, F16 support, and DMA writeback

- Use 64-col dual-acc (weight.b:deep + mxswapacc) across all arches and :cm activation layout
- Pre-issue chunk-0 weight DMA via dma_proxy, balance 4-row quad output threads, and defer output DMA pop

* hexagon : add HMX W8A8 Q8_0 KV flash attention and DMA writeback

hex-fa: cleanup dma_queue usage and mask buffers
hex-fa: fix new op tests and corner cases
hex-fa: cleanup kernel selection and solver
hex-fa: improve decode performance (split-kv)

* hexagon : add F16, DMA, and micro-kernel optimizations for unary/norm ops

* hexagon : add mixed F16/F32 and HVX optimizations for binary ops

* hexagon : add F16, DMA, and state fusion for gated-delta-net

Alsp pipeline GDN HMX/HVX with batched dispatch and spill-free inversion

* hexagon : add F16, token-major fusion, and DMA updates for SSM ops

* hexagon : add F16 and HVX optimizations for rope, softmax, and glu

rope: optimize init and add common fast-path

* hexagon : add F16, DMA, and spill fixes for argsort and top-k

* hexagon : add F16 lowering and optimizations for lightning-indexer and dsv4

* hexagon : add F16 and DMA updates for row and concat ops

* hexagon : convert simple ops to dma-pipeline, F16, and warning/mdev cleanup

* hexagon: add support for fusing MUL_MAT_NX with GLU ops (GEGLU,SWIGLU,...)

- Double-buffer vtcm_up/vtcm_wt_scales_up, add 0-spill direct loop0 FP16 GLU strip kernels, trim sub-ULP FP16 sigmoid terms
- Balance 4-row quad GLU threads, defer output DMA pop, and pre-issue chunk-0 weight DMA via dma_proxy

* tests : add F16/mixed-type and Hexagon op test cases

For now do not include ssm_conv tests that break ggml-metal

* hexagon : update trace and run scripts

* hexagon : update Snapdragon backend README and developer docs

Includes updated tensor tiling description (it is 32x4 now)

--
Co-authored-by: Ehsan Bateni <ebateni@qti.qualcomm.com>
Co-authored-by: Todor Boinovski <todorb@qti.qualcomm.com>
Co-authored-by: Trivikram Reddy <tamarnat@qti.qualcomm.com>
Co-authored-by: Yanzhao Wang <yanzhaow@qti.qualcomm.com>

Assisted-by: Antigravity
…l-org#31208)

Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
* ggml : bump version to 1.1.1

* authors : update
…g#33095)

Without --server, the CLI's config.json now points the app at
llama-server's default port on the host the page was opened from,
instead of the CLI's own address, which has no API and answered 404.
Bump @ggml-org/llama-chat and llama-chat to 0.3.1.

Assisted-by: Claude (Opus 5.5 Medium)
…GQA ratio not divisible by 4 (ggml-org#33045)

* CUDA: flash attention tile kernel for DKQ 576 with a GQA ratio of 2

The tile kernel for 576/512 only had variants for GQA ratios that are
multiples of 4, while the kernel selection accepts any ratio from 2,
so an MLA attention with a ratio of 2 aborted on GPUs that use the
tile kernel, such as RDNA. Add the 2 column configuration, copied from
the 512/512 one of each table, and dispatch even ratios to it. Odd
ratios have no tile variant: the selection now reports them as
unsupported instead of picking the tile kernel. Cover the ratios 2
and 3 in test-backend-ops.

* CUDA: pass the K/V types to the tile kernel for 576 with a GQA ratio of 2

ggml-org#32901 added the K and V types as template parameters of the tile kernel,
the ratio 2 dispatch for DKQ 576 still used the old parameter list.

* CUDA: report DKQ 576 with a GQA ratio not divisible by 4 as unsupported by the tile kernel

Use the selection instead of a new tile specialization, as suggested in
review: drop the 2 column variant and only pick the tile kernel for
576/512 when the GQA ratio is a multiple of 4, the ncols2 = 4 and 16
variants it has. The ncols2 = 4 variant cannot serve a ratio of 2, a
block reads a single K/V head.
The non-contiguous concat kernel mapped dst ne[2] and ne[3] directly to
gridDim.y and gridDim.z, which are limited to 65535. Larger tensors made
the launch fail with "invalid configuration argument". Cap the grid and
loop over the remaining rows in the kernel.

Fixes ggml-org#32956

Assisted-by: Claude Opus 5.5
…#33080)

Prism Bonsai models (prism.hadamard) aborted in the meta backend with
GGML_ASSERT(split_state.ne[j] % div == 0) when loaded with -sm tensor:
the ssm_out input permutation from tiled to grouped GDN head order
reshapes the head-split activation to [hd, n_k, n_rep] and the split
lands on n_rep (3 for 2 devices). Past that, the explicit sign vectors
are mirrored while their inputs are split, and the 1024-wide rotation
blocks would straddle the device slices of ffn_down (17408 = 17 blocks).

Fail at load with a clear message instead.

Assisted-by: Claude Opus 5.5
allozaur and others added 30 commits December 3, 2026 19:37
…gml-org#33622)

* ui: open the slideshow at the trace image that was clicked

The thread is walked from its leaf to its root and then sorted by
timestamp. Messages saved in the same millisecond, as the results of
parallel tool calls can be, kept the walk's leaf-first order through the
stable sort, so the slideshow listed a trace's images backwards and opened
each at its mirror. The path is put root first before the sort.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: one slideshow for every image of the conversation, in its order

The attachment lists and the slideshow showed their items newest first,
while the image clicked was found in the thread's own order: each click
opened its mirror. Nothing is reversed now: attachment lists keep the
order the files were added in and the slideshow the thread's order, so
the image clicked is the one that opens.

The images a tool call shows once opened (read media, a tool's output, a
shell command's) and an attachment's image in Markdown open the same
slideshow at themselves.

Assisted-by: Claude (Opus 5.5 Medium)
…gml-org#33611)

The RPC client's alloc-size cache key for
ggml_backend_rpc_buffer_type_get_alloc_size() omits the src tensors.
For ops in ggml_op_alloc_size_may_expand() the server-side allocation
size can depend on a src, e.g. TOP_K on Metal with nelements(src0) or
FLASH_ATTN_EXT on CUDA/Metal with the KV length. A size cached for a
small src could be reused for a larger one, overrunning the
server-side compute buffer.

Key the cache on the full layout of the tensor and its srcs, reusing
the supports_op key (renamed to op_layout_key), and move the cache and
its mutex from function-level statics into
ggml_backend_rpc_buffer_type_context.

ref: ggml-org#30794

Testing done (on Apple M4 Max):
    TEST_RPC_DEVICE=MTL0 bash tests/test-rpc-multi-server.sh \
        build/bin/ggml-rpc-server build/bin/test-rpc-multi-server


Assisted-by: Claude Opus 5.5

Co-authored-by: Brian Woods <me@brian.biz>
* vulkan: add subgroup shader for pool1d

Assisted-by: Google AI Search
* hexagon: move conv2d-dw kernels to conv2d-dw-ops.c

* hexagon: split conv2d-dw headers as well

* hexagon: add support for f16/f32 mixed types in conv2d

---------

Co-authored-by: Max Krasnyansky <maxk@qti.qualcomm.com>
…#32989)

* hexagon: CONV_2D/3D Cin chunking and cost-based tile solver

- stage input channels in chunks
- stage per (channel, kd) channel stride > 24-bit 2D DMA stride limit
- split weight packing into work items
- replace first-fit tile selection with a solver
- use fastdiv for the dilation division in the per-channel stage path

* hexagon: conv-2d/3d rebase and fixes (guards for corner cases, etc)

* hexagon: add mixed f16/f32 inputs, improve spad allocation and cleanup kparams

* hexagon: conv-2d remove replace all divs and further cleanup kparams

---------

Co-authored-by: Max Krasnyansky <maxk@qti.qualcomm.com>
* ggml : bump version to 1.2.0

* authors : update
[no ci]
* llama.cpp : bump version to 1.1.1

* authors : update
Assisted-by: OpenAI Codex
Assisted-by: Claude Opus 5.5
* cuda : batch contiguous concat slices in one launch

* add concat test case
…org#33608)

* metal : accumulate the bf16 flash attention O in bfloat

The bf16 prefill kernel kept the O accumulator in half while Q/K/V are
bfloat, which mixed the accumulator type with the operands. Accumulate
in bfloat and rescale the O matrix in float, since Metal does not allow
bfloat4 *= float.

Assisted-by: dsh:llama.cpp/ggml-org/DeepSeek-V4.1-Flash-1017-GGUF (Mac Studio, M5 Ultra, 256GB)

* metal : fix flash attention kv_rows with partial K/V chunks

The kv_rows path assumed the row lists are padded to the kernel chunk
(256/64/32) and asserted it, so a partial last chunk was mishandled:

- the pad kernel copied cache columns instead of the gathered rows, and
  the pad buffer was sized/indexed per cache stream (ne13) instead of
  per q slice (ne03), so slices >= 1 read the wrong region
- the vec path did not gather the partial chunk through the row list and
  read V at the wrong pad offset, dropping the last chunk
- direct row reads applied the cache stream stride to a shared cache

Gather the partial chunk through the row list, size the pad per slice,
and zero the stream stride for direct row reads. Also allow BF16 K/V with
kv_rows: the non-vec gather converts to F16 and the tensor path uses the
f16 kernel over the gathered rows.

Assisted-by: dsh:llama.cpp/ggml-org/DeepSeek-V4.1-Flash-1017-GGUF (Mac Studio, M5 Ultra, 256GB)

* metal : use bfloat shared memory for the bf16 vec FA kernels

The bf16 vec instantiations used the half shared-memory type set, so
K/V were converted bfloat->half on load. Add FA_TYPES_BF with bfloat
Q/K/V in shared memory so the vec kernels read bfloat directly through
the direct K/V path, and convert Q from f32 to bfloat as the prefill
bf16 kernel does.

Add the tuned _q%d_ne%d bf16 variants to match the f16/quantized sets,
since the fa_vec tuning selects them, and use a float4 broadcast for the
zero-fill casts that bfloat4 does not accept. Add bf16 to the FA vec
slice test types to cover the new path.

Assisted-by: dsh:llama.cpp/ggml-org/DeepSeek-V4.1-Flash-1017-GGUF (Mac Studio, M5 Ultra, 256GB)

* metal : gather the kv_rows K/V in their own type

The non-vec kv_rows path always gathered the referenced rows into an F16
buffer, so a BF16 cache was converted to F16 and the attention ran the
f16 kernels. Replace the use_kv_f16 flag with the type of the buffer that
the attention reads: quantized K/V is still dequantized to F16, but the
cache type is otherwise kept, so BF16 stays BF16 through the gather and
the partial-chunk pad.

The gather kernel is now same-type (template on T, no cast), the gather
and pad sizes/strides use ggml_type_size(kv_type), and the tensor,
half8x8 and vec pipeline selectors take kv_type instead of the boolean.
Add BF16 gather tests for the half8x8 path with and without the pad.

Assisted-by: dsh:llama.cpp/ggml-org/DeepSeek-V4.1-Flash-1017-GGUF (Mac Studio, M5 Ultra, 256GB)

* metal : use clearer names for the FA kernel paths

Replace the historical half8x8/half4x4 labels with the 8x8 simdgroup
kernel and the vec kernel, matching the actual kernel families. Comment
only, no functional change.

Assisted-by: dsh:llama.cpp/ggml-org/DeepSeek-V4.1-Flash-1017-GGUF (Mac Studio, M5 Ultra, 256GB)

* metal : trim redundant flash attention comments

Update the kv_rows support check that still claimed a contiguous F16 copy
with BF16 converted to F16, drop the duplicated kv_type, pad-per-slice,
dense-op and column-order explanations, and keep only the comments that
explain non-obvious behavior. Comment only, no functional change.

Assisted-by: dsh:llama.cpp/ggml-org/DeepSeek-V4.1-Flash-1017-GGUF (Mac Studio, M5 Ultra, 256GB)

* metal : simplify the flash attention K/V type helpers

Make kv_type the single source of truth for the type the flash attention
kernels read, and derive dequant_kv from it (quantized cache and kv_type
F16). Remove use_kv_f16 - its heuristic moves into kv_type - and use
kv_type in the tensor path check and the is_q flag. This also enables the
tensor path for a quantized rows gather whose shape fills the GPU.

Remove the stale commented-out use_kv_f16/use_vec lines as well.

Assisted-by: dsh:llama.cpp/ggml-org/DeepSeek-V4.1-Flash-1017-GGUF (Mac Studio, M5 Ultra, 256GB)
…tch or n_ubatch (ggml-org#30523)

* llama : return an error instead of aborting when a batch exceeds n_batch or n_ubatch

llama_decode documents -1 for an invalid batch, but a
batch larger than n_batch (or n_ubatch for non-causal) hit a
GGML_ASSERT and aborted the process. A causal context caps n_batch at n_ctx, so
a caller that asks for n_batch > n_ctx and submits a full batch crashes. This
was found in an application that embeds llama.cpp, where a small context made
an audio/image prompt abort the app instead of failing the call.

Return -1 with an error message instead, before any state is touched, and add
the batch_big case to test-llama-context: it submits n_max + 1 tokens, expects
an error and an empty memory, then decodes n_max tokens.

* llama : drop the batch_big test and shorten the n_batch error message (review)
…ggml-org#33328)

* ui: file a conversation away with Archive, from its menus and in bulk

The "more actions" dropdown and the right-click menu of a conversation gain
Archive, next to Pin. A filed-away chat leaves the sidebar's sections -
Pinned, the groups and Ungrouped - and rests out of them; the search dialog
is where it is found, behind a "Show N archived" toggle under the chats a
query matched, its own Archived group among the results. The bulk selection
bar gains the same action for a whole selection: Archive over any selection
with a chat left in it, Restore once every selected chat rests in the
archive.

Archiving keeps a chat's pin and group, so restoring puts it back where it
was, and a move that gives it a home elsewhere - a pin, a group, a drop on
Pinned or on Recent - brings it back too, so such an action on a filed-away
chat never reads as doing nothing.

Assisted-by: Claude

* ui: fix archive selection, restore path and fork families

Select all, the selection count and shift or marquee ranges only take
the chats the sidebar shows, and archiving drops what left the sidebar
from the selection, so a bulk delete never reaches a hidden chat.

Writing in an archived chat brings it back, which gives it a way back
when conversation tabs are off, the default and the only option on a
phone. The bulk Restore path, which no selection could reach, is gone.

Archiving and restoring take the whole fork family, like moving into a
group, and an archived chat no longer shows twice in search.

* ui: count the whole fork family in the archive toast

The bulk write takes the family, so the toast reports the family's size
rather than the clicked selection, which a single chat with forks would
otherwise report as one conversation while several leave the sidebar.

Assisted-by: Claude

---------

Co-authored-by: Pascal <admin@serveurperso.com>
…#33686)

Repos shipping a bare Q4_K quant next to Q8_0 fell through to Q8_0
by default, since only Q4_K_M and Q8_0 were in the preference list.
Try Q4_K between the two; the tag still matches as a full token, so
Q4_K never picks a Q4_K_M file and vice versa.

Assisted-by: dsh:llama.cpp/ggml-org/Qwen3.8-Flash-Next-GGUF (RTX 5090 32GB, DDR5 128GB)
Signed-off-by: Aaron Teo <aaron.teo1@ibm.com>
…gml-org#33677)

* convert: fix GPT-2 and StableLM conversion after generator migration

* convert : drop the regression test

* tests : drop the removed conversion test
…3652)

* ggml-openvino : add Q2_0 and Bonsai 2 support

* openvino: enable text inference for Nemotron Lightning and LFM3

Assisted-by: Codex

* openvino: enable NPU host gather by default

* docs : host gather is on by default

* openvino: compute ELU with an accurate expm1

* ggml-openvino: compute NPU RoPE cos/sin on the host for long contexts

Assisted-by: Claude Opus 5.5

* openvino: review fixes for the NPU RoPE table

* openvino: replace the RoPE flags with GGML_OPENVINO_ROPE_SINCOS

* docs : reorganize OpenVINO docs and add a cookbook

* openvino: preserve token dimensions in Gemma 3n reductions

Assisted-by: Codex

* openvino: keep the compiled-model cache revision at 14

Assisted-by: Codex

* openvino: reject sequence-major SSM_SCAN inputs

* ggml-openvino : drop code that the ggml core does not need

* openvino: add GGML_OPENVINO_SPILL_RESIDENT to cap the spilled weights kept in RAM

Assisted-by: Claude Opus 5.5

* openvino: review fixes for GGML_OPENVINO_SPILL_RESIDENT

* openvino: take GGML_OPENVINO_SPILL_RESIDENT as a fraction

* openvino: add GGML_OPENVINO_SPILL and simplify the spill limiter

* openvino: add GGML_OPENVINO_COMPILE_MEM_SPILL

* openvino: clang-format fixes

* openvino: unwrap comments and docs per AGENTS.md

Assisted-by: Claude Code

---------

Co-authored-by: Mustafa Cavus <mustafa.cavus@intel.com>
Co-authored-by: Yu, Zijun <zijun.yu@intel.com>
Co-authored-by: Xuejun <Xuejun.Zhai@intel.com>
Co-authored-by: ravi9 <ravi.panchumarthy@intel.com>
Co-authored-by: Anisha Kulkarni <anisha.dattatraya.kulkarni@intel.com>
Upstream: c3e91d6
Preserve the fork README and GGML_HIP_UNSAFE_MATH default OFF.

Assisted-by: Claude Fable 5.2
…am-1204

Sync master with upstream (2026-12-04)
Master: e3e4225 (includes upstream sync #265).

Conflicts:
- GDN kernel: keep the fork's ordered reduction and chunked prefill path
  together with upstream's replay mode (ggml-org#31669). The chunked path only
  takes batches without pending replay tokens, and the replay loop uses
  the same partial sums as the main loop.
- Flash attention: keep the D72 padding path on top of upstream's K/V
  type templates; take upstream's wider RDNA guard for single-column MMA
  tiles (ggml-org#32930).
- Fusion code moved to fusion.cu upstream (ggml-org#33087): port the ROCmFP4
  exclusion, the device argument of ggml_cuda_mmq_needs_fallback and the
  FLASH_ATTN_EXT + RESHAPE + SET fusion; keep the concurrent-join guard
  and the channels-major SSM_CONV check in ggml-cuda.cu.
- Keep the fork's DQ mat-vec dispatch, both SSM_CONV test flags, and
  the removed stream + tools + logprobs throw.
- The VGPR allowlist moves into upstream's gcn-cdna-metrics.py.

Fixes for conflicts without markers, found by the GPU tests:
- The D72 padding is applied only under the fork's own selection rule;
  upstream's mask-less rule now routes other D72 cases to the MMA
  kernels as well.
- The replay conv-state builder returns the channels-first columns for
  channels-major callers instead of the transposed copy.

Assisted-by: Claude Fable 5.2
build_conv_state() returns the conv input as [channels, time, n_seqs] on
gfx11, but zonos3 still called the time-major ggml_ssm_conv and aborted
on GGML_ASSERT(sx->ne[1] == d_inner) when the graph was built. This is
the same mismatch that was fixed for Clover; it predates this sync.

Assisted-by: Claude Fable 5.2
build_conv_state() keeps the conv history channels-major on gfx11. For
Qwen 3 Next that row then has two segment sizes per conv column (q/k and
v heads), which the meta backend cannot carry through a reshape, so
tensor split mode aborted in ggml-backend-meta.cpp. Upstream keeps this
arch on the time-major layout for the same reason.

Use the time-major layout only when the model runs with
LLAMA_SPLIT_MODE_TENSOR. Every other mode keeps the channels-major
convolution: on Qwen3-Next-80B-A3B a 3968-token prefill is 3.1% faster
with it at ubatch 512 and 29.5% faster at ubatch 4096.

A session state saved with -sm tensor uses the other conv history layout
and is not interchangeable with one saved in another split mode.

Assisted-by: Claude Fable 5.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.