Skip to content

Merge ggml-org master 5193ef1d4 - #111

Merged
rafasmour merged 26 commits into
masterfrom
merge/ggml-org-5193ef1d4
Nov 13, 2026
Merged

rafasmour merged 26 commits into
masterfrom
merge/ggml-org-5193ef1d4

Conversation

@rafasmour

Copy link
Copy Markdown
Owner

Merge of ggml-org master 5193ef1 into the fork: 25 upstream commits since the last merge base 8ca5a80, among them the version bump to 1.0.0 (tag v1.0.0, b1b770d).

Conflicts

  • ggml/src/ggml-cuda/norm.cu: upstream reworked the RMS_NORM kernels for BF16 (template on the data type, typed launch helper). Taken as is, with the q8_1 copy of the fork on top: the do_quantize flag of the kernel and of the dispatch (F32 and vector kernel only), the lane group reduction, the padded row stride, and the cache handling in ggml_cuda_op_rms_norm_fused / _fused_add.
  • ggml/src/ggml-cuda/pad_reflect_1d.cu: upstream fixed the HIP grid limit by splitting the grid (upstream PR 32179). The fork had its own fix for the same failure (block size limited to the row length, 4964b36); upstream's version replaces it.

What comes in

Grammar matching with left factoring (upstream PR 29557), BF16 for RMS_NORM (PR 32135), moe-cache code moved out of llama-graph (PR 32157), a warning for --spec-draft-p-min with probabilistic draft sampling (PR 31294), removal of old examples, CI and test fixes. Nothing in it targets RDNA3.

Checks

RX 7900 XT (gfx1100), ROCm 10.1.

llama-bench -p 480 -n 0 -b 1 -ub 1, time per token in ms, two rounds, before the merge -> after it:

model before after
Ornith 1.5 9B Q4_K_M 9.77 (fork master b73a933) 9.77 / 9.76
LFM3 1.7B Q8_0 4.55 / 4.54 4.55 / 4.55
Qwen3.6 35B-A3B UD-IQ4_XS 7.94 / 7.93 7.93 / 7.93
Qwen3.8 27B Q4_0 26.13 / 26.14 26.21 / 26.20
Gemma 4 31B UD-IQ3_XXS 26.31 / 26.35 (with PR #108) 26.11 / 26.17 (with PR #110 and the merge)

The "before" builds are fork master b73a933 and b73a933 + PR #108; the "after" build is this branch (PR #106, #108, #110 and the merge). Qwen3.8 is 0.3% slower: a kernel trace shows the 225 rms_norm launches per token at 4.74 us instead of 4.67 us after upstream's rework of norm.cu, and small differences in other short kernels.

Prompt speed (2048 tokens, batch 512), fork master b73a933 -> this branch with the layer-scale PR on top: Qwen3.6 3590 -> 3606 t/s, Gemma 773 -> 777 t/s, LFM3 12839 -> 12864 t/s.

Tests on ROCm, run on this branch with the layer-scale PR on top: the complete test-backend-ops run, one group at a time, passes (167 groups, 21367 cases, 0 failures).

Greedy text (two prompts, 200 tokens each) is the same as before the merge on Gemma 4 31B (F16 and q8_0 KV), Qwen3.8 27B, Ornith 9B (with and without the DFlash drafter), LFM3, Qwen3.6 35B-A3B and Mellum 2.1.

AI disclosure: merge and conflict resolution done with Claude Code, tested on the hardware above.

🤖 Generated with Claude Code

SaidSultani and others added 26 commits November 12, 2026 13:52
…ml-org#32011)

* fix(hexagon): make host build work with clang-cl on Windows ARM64

Two CMake fixes for building ggml-hexagon natively on Windows-on-ARM64
with x64-hosted clang-cl (validated on Snapdragon X Elite, discussion in
qualcomm/GenieX#1390):

- Some clang drivers (e.g. x64-hosted toolchains used on ARM64) don't
  predefine the arch macro, which makes winnt.h fail with "No Target
  Architecture". Define _M_ARM64/_ARM64_ explicitly for the host TUs.
- The Hexagon SDK's incs/stddef include (AEEStdDef.h and friends) poisons
  the MSVC header chain when it leaks onto dependent TUs' include paths
  via htp_iface's PUBLIC includes. Keep it PRIVATE to the interface stub
  and system-level for the backend's own TUs (which include <AEEStdErr.h>
  directly).

Originally validated 2026-08-26 as reported in the issue; applies
cleanly to 15759e0.

* hex-cmake: trim down excessive comments

---------

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

The same-origin tests over the LAN address block forever on the Metal
runners: the request to the host's own LAN address never returns and
has no timeout, so the job runs until the 6h limit.

get_lan_ip() now probes /health on that address with a short timeout
and returns None when the host cannot reach it, which skips the test.
The test requests themselves use the default request timeout so a
hang fails the test instead of stalling the job.
…g#32167)

The vision tests download their images from huggingface.co, which
resolves to a private address on the runners inside the HF network.
The media URL check refuses it with "host is not a public address"
and the server-cuda job fails.

The vision fixture enables media_allow_private_urls. The private
address check keeps its own coverage in
test_vision_image_url_private_address.
… release] (ggml-org#32168)

* server: read a small temp file in the read_file tool test

test_tools_builtin_read_file read its own file, which grows with every
added test. On Windows the CRLF checkout puts it at 16664 bytes, over
the 16384 byte read limit, and the tool refuses it.

The test now writes a small file of its own and checks the exact
content read back.

* server: use a temp cwd in the x-tool-cwd tool test

test_tools_builtin_cwd_header read test_tools_builtin.py through the
x-tool-cwd header, which hits the same 16384 byte read limit on the
Windows CRLF checkout, and wrote its shell marker into the source tree.

The test now uses a temp directory as cwd, reads a small file from it
and checks the shell marker lands there.
…ml-org#32183)

The D=256 vec flash attention kernel with F8_E4M3 K and V uses 257
VGPRs (255 + 2 spilled) on gfx908, one over the limit of the check.
The spill is a perf issue only, like the Q4_0 D=256 vec kernel
already in the ignore list.

Both variants of the kernel join the ignore list.

[no ci]
* examples : clean-up old/obsolete stuff

* examples : update references to removed files

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

[no ci]
* ggml : bump version to 1.0.0

* examples : bump test-cmake (ggml/0)
[no ci]
* llama.cpp : bump version to 1.0.0

* readme : bump major version in link

[no ci]

* examples : bump test-cmake version

[no ci]
This commit removes the llama version test-cmake and instead uses the
version that is supplied by CMAKE_PREFIX_PATH.

The motivation for this is to avoid issues when bumping major versions.
…ggml-org#32179)

The kernel launches one block per row and 256-wide tile, so the
{2, 16777217} test case asks for 16777217 blocks of 256 threads. HIP
refuses a grid dimension above 2^32 threads and the ROCm jobs fail
with "invalid configuration argument".

The host now launches the grid in chunks of at most UINT32_MAX / 256
blocks and passes the chunk offset to the kernel. Real sizes fit in a
single chunk and keep their timings.
* grammar : limit the number of alternatives

* grammar : introduce an AST for grammar parsing

* grammar : revert AST refactor and alternatives limit

This reverts commits:
- 84f3b57
- 393a707

* grammar: optimize big grammar matching by using left-factorization

* grammar : preserve character class boundaries during left factoring

* grammar : prevent infinite expansion during left factoring

* grammar : use ASCII characters in comments

* grammar : test empty suffixes after left factoring

* grammar : deduplicate left factoring logic

* grammar : add comments

* grammar : use number parameters and clarify RSS output

* grammar : clarify character class test names

* grammar : remove performance benchmark

* grammar : share immutable rules

---------

Co-authored-by: Piotr Wilkin <piotr.wilkin@syndatis.com>
* ggml-vulkan: add optional device keepalive

* simplify implementation, move ownership to backend, change env var to seconds

---------

Co-authored-by: Acmmi <acmmi@Acmmis-MacBook-Air.local>
Co-authored-by: Ruben Ortlam <rortlam@redhat.com>
…sampling (ggml-org#31294)

* spec : skip p_min for sampled MTP and DFlash2 drafts

Under rejection sampling the acceptance at a position is 1 - TV(p, q),
which the draft's top probability does not tell, so the p_min cutoff
dropped draft tokens the target would have accepted. Skip it when
MTP or DFlash2 samples the draft. draft-simple keeps it: each extra
draft token costs a full draft model pass.

* spec : replace the sampled-draft p_min skip with a warning

p_min behaves as on master again for every drafter and sampling mode.
Instead, log a warning when --spec-draft-p-min > 0 is used with
--spec-draft-sampling probabilistic, suggesting p_min 0: under
rejection sampling the draft's top probability does not tell how much
of the draft the target accepts. The cut is not skipped because with
MTP at long drafts it can still pay off.

* spec : warn about p_min only for drafters that use it

The n-gram drafters ignore p_min, and DSpark uses it as the cutoff of its confidence head, so the warning is skipped when only these are configured.

---------

Co-authored-by: Pranesh Gonegandla <pgonegandla@nvidia.com>
* vulkan: add TOP_K_MASK

Assisted-by: Claude Opus 5.5

* vulkan: fix the TOP_K_MASK barrier and use the common offset helper

Assisted-by: Claude Opus 5.5

* vulkan: declare ggml_vk_top_k_mask in the common header

Assisted-by: Claude Opus 5.5
* ggml : add BF16 support to RMS_NORM (CPU, CUDA)

* cuda : use one helper for the F32/BF16 RMS_NORM launches
Signed-off-by: ynankani <ynankani@nvidia.com>
…l-org#32144)

* hex-bufs: combine queue and fence buffers

* hex-bufs: use n_threads for queue sizing

* hex-mmap: optimize buffer stacking at the host to avoid iova fragmentation

* hex-mmap: add simply retry for spurios mmap failures

* hex-mmap: use eager mode for extended mmap retries
* requirements : support Python 3.15

torch 2.11.0, numpy 2.4, matplotlib 3.10, pandas 2.3, pillow 11.3 and
cffi 1.16 have no Python 3.15 wheels, so the CI runner on 3.15 cannot
install the requirements.

Python 3.15 gets the first releases that ship 3.15 wheels through
version markers, and every version below 3.15 stays as is.
pyproject.toml now allows 3.15 and picks torch 2.15.0 there.

* requirements : apply review suggestions

numpy 2.5.4 from Python 3.14, matplotlib 3.11.2 and pandas 3.0.6 from
3.11, cffi 2.1.1 and pillow 12.3.0 for every version. cffi 1.16.0 has
no 3.14 wheel and fails to build there, so this also fixes the
tokenizer test requirements on 3.14.
…-org#32148)

* ci: reduce qdc timeouts to avoid stalling pipelines and runners

* ci: fix flake8 warnings
norm.cu: BF16 rework of upstream with the q8_1 copy of the fork on top.
pad_reflect_1d.cu: grid split of upstream instead of the block size limit of the fork.

Assisted-by: Claude Fable 5.2
@rafasmour
rafasmour merged commit fd5d763 into master Nov 13, 2026
31 of 67 checks passed
@github-actions github-actions Bot added documentation Improvements or additions to documentation Apple Metal SYCL labels Nov 13, 2026
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.