stew675/llama-cpp-rdna-boosts
About
A set of performant RDNA/HIP patches against llama.cpp focusing on high speed inferencing with numerics assurance
Other ProjectsMeasured star growth
- in 24h
- +14
- in 7 days
- +127
- in 15 days
- +289
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Originalllama-cpp-rdna-boosts
Summary Overview
- What It Is: Upstream llama.cpp at the pinned commit in
release.jsonplus 20 RDNA-targeted patches (18 official blocks + the temporary0300and0301). Not a divergent fork: the series is re-cut onto each new upstream base. Resyncs to upstream happen weekly. - Hardware:
gfx1100(RDNA3),gfx1150/gfx1151(RDNA3.5) andgfx1200/gfx1201(RDNA4) are supported,gfx1030(RDNA2) is best effort. See Supported architectures. - What it buys you: RDNA-tuned versions of what upstream already has (flash attention, quantized prefill GEMM, k-quant decode, chunked GDN prefill, the MoE host tier, the compute buffer, CUDA graph replay, MTP draft depth, server prompt admission, the qwen4exp implementation), plus a few capabilities it does not (ternary weights on the GPU, the streamed KV, the APU expert store, the host-expert pool).
- What it costs you: you are on a pinned base rather than upstream
master, so you re-apply at each new base or follow the branch. - Get it:
- apply the patch block series to a clean checkout with
scripts/apply-all.sh. See Consumer workflow; or - clone
https://github.com/stew675/llama.cpp, check out therdna-boostsbranch, build as usual; or - run a prebuilt ROCm image (10.2,
ghcr.io/stew675/llama-cpp-rdna-boosts):CONTAINERS.md.
- apply the patch block series to a clean checkout with
- What to read next:
patches/README.md(per block, its knobs),ENVIRONMENT.mdandDIAGNOSTIC.md(every variable),COMMUNITY-CONFIG.md(measured configuration tables), the top ofWORKLOG.md(what changed recently).
Detailed Overview
A patch collection that brings AMD RDNA-specific performance work to llama.cpp: MTP decode, chunked gated-delta-net prefill, BF16 KV and WMMA flash-attention, fused MoE and k-quant decode paths, a hybrid all-reduce, qwen4exp (Qwen3.8-Flash-Next) support, and an attention-memory campaign that frees several GiB of VRAM.
Everything this delivery adds is default-on — you should not need to set any environment variable.
ENVIRONMENT.md documents every end-user variable the set adds or repoints — the opt-ins,
the tuning values and the options, with their defaults — and DIAGNOSTIC.md holds the
kill-switches, A/B arms and diagnostics, which you only reach for when something is wrong or you are bisecting.
It ships as 19 default patches for a clean llama.cpp checkout at the fork point 81a22ceb7
(upstream master, the 2026-12-01 re-base; release v18-81a22ceb7-r400).
r400 is the break release. Two things changed at once and no earlier number describes them: the block set was restructured into layers at r383 (a block now names the highest feature it carries and may hand hunks from one file to several blocks, so per-block notes are layer notes), and r400 re-bases the whole set onto upstream's
81a22ceb7— 190 commits, taking the delivery fromd35dc4d9eto a snapshot five weeks newer. Files, block numbering (18 official + the temporary0300) and the optional artifacts are unchanged, and every-n 20coherence anchor still reproduces exactly; the release record is the top ofWORKLOG.md, the MTP gate isbenchmarks/2026-12-01-r400-mtp-4axis.md, and the two obligations the cut carries areTODO#414/#415 (upstream'stest-quant-type-selectionsnapshot and the recurrent-state-depth Phase C arm) plus #411 (the FA instance-set prune, deferred to r401).
- 18 official supported blocks
0000-0017 - 2 optional blocks that are NOT in the default set and are applied only with
--include-optional(seeoptional/README.md)0100(two-lane prefill):optional/two-lane-prefill/0101(mixed K/V cache types):optional/mixed-kv/
- temporary block
0300, applied last -- a local-sm relaxed-tensorrelaxation for the MoE amax architectures, kept separate so it can be dropped; see block 0300 - temporary block
0301-- the Qwen4 model family (upstream PR #33626), in the default apply only because this fork point predates the upstream merge, and deleted at the next re-base; see block 0301
Each block is one git am commit, and the series is linear (a block assumes its predecessors), so the set
is applied whole.
git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp
git checkout 81a22ceb7
bash <path-to-this-repo>/scripts/apply-all.sh . # creates branch rdna-boosts (19 commits)
# OPT-IN, not part of the delivery: optional artifacts on top (NOT the release tree)
bash <path-to-this-repo>/scripts/apply-all.sh --include-optional . # asks [y/N] per artifact
bash <path-to-this-repo>/scripts/apply-all.sh --include-optional-all . # every artifact, no prompt
# OPT-IN, not part of the delivery: a beta candidate on top (NOT the release tree -- beta testing only)
bash <path-to-this-repo>/scripts/apply-all.sh --include-beta . # 19 default blocks + beta/*/*.patch
- One-line summary of each block: The patch blocks
- What each block contains, its knobs and its purity notes:
patches/README.md - The folded
mmb/QSA campaign: block 06 - Every environment variable, with its default and class:
ENVIRONMENT.md(the knobs) andDIAGNOSTIC.md(the switches, A/B arms and diagnostics) - Running a model bigger than your VRAM on one card (
-ncmoe+ the MoE expert cache, with the measured config tables and the measurement method):COMMUNITY-CONFIG.md - What changed recently:
WORKLOG.md(today's entries at the top, the index of earlier days at the end) - Current status and validation:
release.json(source of truth) andMANIFESTS.md
Releases
Frozen deliveries are published as GitHub Releases and tagged in this repo
(the tag is the release identity: v<blocks>-<fork-point>-r<N>, e.g. v18-919794500-r377; the block
count in the tag is the official 00xx count, so v15-* tags are the 15-block releases up to r177,
v16-* the 16-official-block releases from r178 on, and v18-* the current 18. The temporary 0300 and
the optional 01xx blocks are never counted (AGENTS.md). r1 is the
re-base of the set onto that fork point and every later rN is a dated change recorded in
WORKLOG.md, newest first, with the earlier days in archive/worklog/).
Supported architectures
The set targets the RDNA3 / RDNA3.5 / RDNA4 GPU families, with RDNA2 and Instinct (CDNA) compiled in:
| family | arches | example parts | status |
|---|---|---|---|
| RDNA 4 | gfx1200/gfx1201 |
RX 9060 XT, RX 9070 / 9070 XT, Radeon AI Pro R9700 | supported (primary validation arch) |
| RDNA 3.5 | gfx1150-gfx1153 |
Strix Point / Strix Halo APUs, Krackan | gfx1150/gfx1151 supported; gfx1152/gfx1153 compiled, unvalidated |
| RDNA 3 | gfx1100-gfx1103 |
RX 7900 XTX/XT, RX 7800/7700 XT, RX 7600, Ryzen Z1 / 780M APUs | gfx1100 supported; gfx1101-gfx1103 compiled, unvalidated |
| RDNA 2 | gfx1030 |
RX 6800/6800 XT/6900 XT, Radeon Pro V620 | best-effort; externally validated (V620), not run in our fleet |
| Instinct (CDNA) | gfx908, gfx90a, gfx942, gfx950 |
MI100, MI210/MI250, MI300X, MI350 | compiled only -- the RDNA-only paths fall back, and none is validated here |
"Compiled" is the point of the matrix, not a performance claim: a code object for the family means the
first kernel launch cannot fail with ROCm error: invalid kernel file on that device (issue #404 added the
APU rows after a Phoenix gfx1102 iGPU aborted a multimodal projection; issue #158 was the RDNA2 equivalent).
Everything compiled but not validated runs the runtime-dispatched fallbacks, and a report from it is
informational -- never a delivery gate. The published container images carry all of these
(.devops/rdna-rocm.Dockerfile), so a mixed pair such as a discrete RDNA4 card plus an APU iGPU works out
of the box; a source build sets its own -DAMDGPU_TARGETS.
RDNA4 (gfx120x) sees the most benefit — the WMMA flash-attn path, the chunked-GDN kernel, the k-quant VDR boosts and block 12's internal all-reduce were all first built and validated there. As much of that work as possible is back-ported to the RDNA3/3.5 families instead of being gated off.
Strix Point (
gfx1150) is in the target set as of 2026-10-05. Container images published before then carry nogfx1150code object and fail on the first kernel launch (ROCm error: device kernel image is invalid); build from source withgfx1150in the target list, or setHSA_OVERRIDE_GFX_VERSION=11.5.1to take thegfx1151code objects. See Strix Point (gfx1150).RDNA2 (
gfx1030) is best-effort: not a supported target, but no longer unvalidated. It is compiled into the image so RDNA2 owners pick up the runtime-dispatched boosts instead of a first-kernelROCm error: invalid kernel file, the RDNA3/4-only paths fall back to the upstream non-WMMA kernels, and there is still no RDNA2 device in the maintainer's fleet -- so an RDNA2 result is informational, never a delivery gate. Validation and both paths: RDNA2 (gfx1030).
Repository Layout
├── README.md # this file: overview + consumer workflow
├── AGENTS.md # the policy layer: what is mandatory, scope, how a release is cut
├── INVARIANTS.md # the engineering facts: measured invariants / "do not re-derive" (pre-ship reading)
├── MANIFESTS.md # apply order + the verification contract (release gates per block)
├── BASELINE.md # fork point, what the patches are, how they are cut, drift policy
├── TODO.md # forward-looking tracker: open items, limitations, parked ideas only
├── GREEDY-PURITY.md # purity rulebook: invariants + one summary entry per finding (read before shipping)
│ # narratives/evidence: archive/worklog/ + benchmarks/ (and pre-r100: archive/docs/GREEDY-PURITY-FINDINGS.md)
├── WORKLOG.md # the dated record: today's entries, then an index of the earlier days
├── archive/worklog/ # the record's earlier days, one file per day (newest first; the only release history)
├── ENVIRONMENT.md # the end-user env vars (opt-in/tuning/options), with default and class
├── DIAGNOSTIC.md # the kill-switches, A/B arms, test hooks and diagnostics
├── CONTAINERS.md # the ROCm container images + the off-host build watcher
├── COMMUNITY-CONFIG.md # running a model bigger than VRAM (`-ncmoe` + the expert cache)
├── CONTRIBUTORS.md # the credit register: who owns what (co-authored-by / reported-by per block)
├── NOTICE # licence scope of the applied tree (block 03's Apache-2.0 kernels)
├── rdna-boosts-all.patch # convenience: the entire 20-patch default net as ONE patch
├── patches/ # the delivery set: official 0000-0017 + temporary 0300/0301 (one `git am` block each)
│ ├── README.md # the per-block reference: what each block is, its knobs, its purity notes
│ └── FILE-SET-RETIREMENTS.tsv # re-base decision rows: a deliberate retirement a block may lose (gate 38)
├── scripts/ # apply / regenerate / validate / publish tooling; index: scripts/README.md
│ ├── apply-all.sh # the verified apply flow (git am; automatic -3 fallback on drift; --include-beta)
│ ├── gate-prefill-logits.sh # prefill-logit KLD release gate (issue #113)
│ ├── gate-per-block-build.sh # bisect only (r332): which block broke a build
│ ├── check-rung-file-sets.py # re-base file-set reconciliation (TODO #358): no block may lose a file,
│ │ # define, env var or option the patch it replaces carried
│ └── make-patches.sh # regenerates the set from the fork (~/llama.cpp)
├── benchmarks/ # dated bench records + the release-gate methodologies (MTP four axes, prefill-logit KLD)
├── prompts/ # versioned, hash-stable test prompts (sha256-recorded; never edited in place)
├── wiki/ # source for the GitHub wiki (Home, MTP & Adaptive MTP, Quick Reference); see wiki/README.md
├── wip/ # ACTIVE exploration only, never applied; index: wip/CAMPAIGNS.md
├── beta/ # promotion-candidate patches pending a beta test (NOT part of the delivery;
│ # apply with `apply-all.sh --include-beta`; currently: the two-arm server
│ # (v2, replacing the withdrawn block 17) as three patch files -- KNOWN OPEN
│ # DEFECT, it corrupts under heavy concurrent load (TODO #378); see beta/README.md
├── optional/ # opt-in blocks 0100/0101 (NOT part of the default delivery; apply with
│ # `apply-all.sh --include-optional` and a [y/N] per artifact, numeric order)
├── upstream/ # upstream-PR candidates: one sub-directory each (README.md + patch) + index
├── third_party/radiance/ # Apache-2.0 attribution for block 03's libr4d-derived GDN kernels (LICENSE + NOTICE)
├── utilities/ # measurement/reporting tools, never applied (e.g. storage-oracle/); see utilities/README.md
└── archive/ # the rest: archive/work/ (closed experiments + the archived wip/ trees) + archive/docs/ (history)
The patch blocks: official 0000-0017 + temporary 0300/0301 + optional 0100/0101
One git am commit per row, applied in filename order: 0000-0017 then 0300, 0301. The optional
0100/0101 are not in this table and never in the default apply -- see
optional/README.md. Since r383 a block is a LAYER: the label names the
highest-level feature the layer carries, its content is that layer plus whatever foundational
infrastructure the feature needs, and one TU may receive hunks from several blocks. Each row links the
block's section in patches/README.md, which lists what that block adds (its
translation units, knobs, invariants and gate); the long-form per-feature notes and the amendment history,
under the r382 numbering, are in
archive/docs/patch-notes-history.md.
| patch | layer | what the layer carries |
|---|---|---|
0000 |
F0 | the foundational iface: op/subtype slots, the split-axis vocabulary, the shared #defines, graph_optimize's parameters, the Meta split-state, the allocator's dependency surface (a GLU may take its gate's memory) and the cross-backend consistency rules. |
0001 |
F1 | the CUDA backend's scaffolding: context/pool/slab/arena/VMM, the KV-pool surface, graph capture+replay, the staging transport, the q8_1 cache, common.cuh helpers, the dispatcher (ggml-cuda.cu) and the CPU-side wins. |
0002 |
F1 | the hybrid HIP all-reduce and its RDNA4 gate, with the per-model large-tensor arm (copy engine or RCCL). |
0003 |
F2 | the quantize/dispatch API: type_src1/n_chunks, the GLU quantizers, the mmq/mmvq/mmvf signatures, mmf32, the BF16 src1 cache, the vec-dot family (VDR, Q6_K) and mmvq-rdna. |
0004 |
F3 | the flash-attention family: tile/MMA/band, the native quantized K/V pair, the derived kq mask, the padded GQA-6 fold, the BF16 destination arm and every instantiation. |
0005 |
F3 | the gated-delta-net family: chunked prefill (bf16/gfx11), conv, conv-store, the gather deferral and the ssm/epi/prescan arms. |
0006 |
F3 | the MoE family: the MMB quantized prefill GEMM (dense and routed), top-k routing, the weighted reduction and its fold, the routed decode family. |
0007 |
F3 | the small kernels: norm, norm-gated, unary, ple-conv, set-rows, getrows, rope, convert, argsort, top-k, ssm-scan, concat, pool and the remaining instance lists. |
0008 |
F3 | the expert-cache engine: slab residency, the hook implementations and the UMA store's CUDA side. |
0009 |
F3 | TQ1_0/TQ2_0 (ternary) weights on the GPU -- MUL_MAT, GET_ROWS, the dequantise rows -- bit-identical to the CPU backend's x86 AVX2 path, plus the TQ fusor. Default-on; whole-cloth contributor PR #358, so the commit's author is the contributor. |
0010 |
F3 | the qwen4exp family: the hyper-connection kernels, the lightning indexer, the QSA pack and its per-ratio input sets. |
0011 |
F4 | the fusion extension: the ordering TU, the dispatcher matchers, the upstream anchors and the reader-count rules. |
0012 |
F5 | the model/loader/graph/context seams: the BF16 KV cache type, the cparams, the graph builder, the loader hook, llama-ext, the state pipeline and the mask forwards. |
0013 |
F5/F6 | the MTP draft family: adaptive draft depth, the draft vocabulary subset (--spec-draft-mtp-vocab N), the draft reserve, the drafter's cache alignment and the MTP target h-rows path. |
0014 |
F6 | the streamed KV: the growable region, the fixed-VRAM resident window (--kv-window), the attendance pool (--kv-attendance-pool) and the MTP draft ring (--spec-draft-kv-window) -- all three opt-in, default OFF. |
0015 |
F6 | the UMA GTT expert store and the -lme host-expert budget, which sizes an APU's store and a discrete GPU's pinned per-expert pool. |
0016 |
F6 | the server: the prompt admission policy (max-min fair share, -ib, the skew, the duty cycle), the KV admission and full stop, and idle-slot parking. |
0017 |
F6/F7 | the CLI/args surface (one add_opt() line per option, the -of tag table), the two catalogues (ENVIRONMENT.md, DIAGNOSTIC.md) and the three generated docs. |
0300 |
F0/F1 | TEMPORARY: -sm relaxed-tensor, a tensor split that also admits a replicated tensor whose values differ per device (flint/mellum/mistral4). In the default apply but not an official block; deleting the patch returns the tree to -sm tensor. |
0301 |
F0/F1 | TEMPORARY: the Qwen4 model family (upstream PR #33626) -- the tokenizer.ggml.pre = "qwen4" pre-tokenizer, the arch's 40-layer 35B.A3B type and dense FFN path, the chat template and the compact <think>...</think> parser. In the default apply but not an official block; deleted at the next re-base, where upstream carries all of it. |
Patch Organization Layers (What does F0 - F7 mean)
F stands for Foundation Layer. A patch foundation layer is a dependency rank. It is a referential hierarchy around which to organize patch dependencies.
That is to say, layer F(k) may reference only F(0..k-1) — no block may use a symbol, header, field, #define, option or variable a
LATER block introduces (checked mechanically by scripts/check-block-closure.py, 0 rows at r383).
This oragnizational property is what makes each block independently applicable and independently testable.
| layer | what it owns | blocks |
|---|---|---|
| F0 | ggml core plumbing: the iface slots upstream lacks, the split-axis vocabulary, the shared #defines, the allocator's dependency surface, cross-backend consistency |
0000 |
| F1 | CUDA backend scaffolding: the context additions, common.cuh helpers, the pool/slab/arena (called down into by everything), graph capture/replay, the staging transport, the dispatcher extension point |
0001, 0002 |
| F2 | the quantize and dispatch API: type_src1/n_chunks, the GLU quantizers, the mmq/mmvq/mmvf signatures (signatures here, kernels in F3) |
0003 |
| F3 | the kernel families — where most of the code lives, because kernels are the product | 0004-0010 |
| F4 | the fusion extension: the ordering TU, the matchers, the kill switches, the upstream anchors — arms only, no kernels | 0011 |
| F5 | the model/loader/graph/context seams: one registration line plus one handler call per site | 0012, 0013 (F5/F6) |
| F6 | the runtime features: streamed KV, the UMA GTT expert store / -lme, the server, the speculator, the CLI/args surface |
0013-0017 |
| F7 | docs and the env catalogues, incl. the three generated tool docs | 0017 (F6/F7) |
Consumer workflow
# 1. fresh clone of llama.cpp, at the fork point recorded in release.json
BASE=$(jq -r .base release.json) # from this repo
FORK=https://github.com/ggml-org/llama.cpp
git clone $FORK && cd llama.cpp
git checkout "$BASE"
# 2. apply the set (automated; strict 20/20 git am on the recorded base)
bash <path-to-this-repo>/scripts/apply-all.sh .
# = git am patches/0000…0017 then patches/0300, 0301 (one commit per block on a fresh `rdna-boosts` branch)
# 3. build + verify (trim -DGPU_TARGETS to your GPU arch for a faster build)
cmake -B build -DGGML_HIP=ON -DGGML_HIP_RCCL=1 -DGPU_TARGETS="gfx1100;gfx1151;gfx1201" -DCMAKE_BUILD_TYPE=Release
cmake --build build -j
# coherence gate (same-seed output must match a known-good build).
# PIN the devices on any multi-device run: without it the iGPU is enumerated and the load aborts
# with `ROCm error: invalid kernel file`.
HIP_VISIBLE_DEVICES=0,1,2 ./build/bin/llama-cli -m <model> -ngl 99 -sm tensor -mg 0 \
-p "The capital of France is" -n 20 --seed 42 --temp 0 --no-display-prompt --single-turn
Or skip steps 1-3. The release's prebuilt ROCm 10.2 image already carries the applied tree (
ghcr.io/stew675/llama-cpp-rdna-boosts:full-rocm-<ver>/rocm-<ver>/latest, plus the immutable-<fork-point>and-<release>tags, e.g.full-rocm-10.2-v18-81a22ceb7-r401). Tags, provenance labels, the RDNA2/gfx1150caveats and the off-host build:CONTAINERS.md.KV-cache quantisation: a source build compiles native flash-attention K/V pairs for
f16,bf16,q8_0,q5_1,q5_0,q4_1,q4_0,iq4_nlandf8_e4m3, so any-ctk/-ctvyou pick is read natively. The images ship five of them (f16,bf16,q8_0,q5_1,f8_e4m3) for their own size budget: aq4_0/q4_1/q5_0/iq4_nlcache in an image still works but stages through f16 -- correctness unaffected, decode slower at depth (measured -22 % with a q4_0 27B cache at d98304) -- so in an image use-ctk q8_0 -ctv q8_0(orq5_1) for a long context: the pair sets.Put
ccacheon PATH and pass the launchers (-DCMAKE_HIP_COMPILER_LAUNCHER=ccache, theCandCXXequivalents): the FA template instances are the build's critical path, so an unchanged rebuild drops from minutes to seconds (282 s -> 4.2 s measured on gfx1201). It replays the compiler's own objects, so the code is identical; any header change (e.g.fattn-mma-f16.cuh) invalidates the whole FA group.Do not use
git applyon the concatenated series — it silently drops hunks (30 files / 2483 lines vs the correct 35 / 6094, verified 2026-08-29).git am(orscripts/apply-all.sh) is the required flow.Every HIP configuration builds, including the stock one.
GGML_HIP_NO_VMMdefaults to ON upstream, so a plain-DGGML_HIP=ONbuild is the no-VMM configuration, not the one this repo develops on.On Windows, the HIP runtime must be the ROCm/TheRock one, not the display driver's.
amdhip64_7.dllnormally resolves fromC:\Windows\System32, i.e. the copy the Adrenalin driver ships, and the two are not interchangeable for the host-expert path: on the driver copy the pinned tier stops at ~9.3 GiB of adapter shared memory and latches off (one reported box then spun in the runtime's own wait loop after the post-prefill re-arm
When upstream master moves
The patches are static against the fork point in release.json.base. When upstream
drifts and hunks no longer apply, re-base the block commits (the fork checkout carries
them), regenerate the whole set with scripts/make-patches.sh, then refresh
release.json (scripts/make-release.sh --base … --tip … --tree …) and update the
current-state headers. The old baseline/<sha>-branch-per-upstream-range workflow
was retired when the delivery moved to the flat patch set on main.
A re-base also owes scripts/check-rung-file-sets.py (the one check no build can replace): a rung that
lands fewer files than the patch it replaces still compiles, because the missing hunks live inside other files
Run it per rung while porting (--rung NNNN --new-chain ~/llama.cpp --new-base <base>) and on the whole
set before the tag; a deliberate disappearance is a decision row in patches/FILE-SET-RETIREMENTS.tsv with a
reason. scripts/validate-set.sh runs it too, so a re-cut that shrinks a block fails the delivery check.
Upstreaming to mainline llama.cpp
Some blocks are candidates for upstream contribution to
ggml-org/llama.cpp; others are
expected to stay fork-local. The internal all-reduce (block 0001) is gated to
RDNA4 pending community verification on RDNA3 pairs. See MANIFESTS.md
for the verification contract and BASELINE.md for provenance.
Community Acknowledgements
This work is becoming a community effort and I'd like to offer special thanks to the following users for the assistance in finding issues and offering solutions!
- https://github.com/1337hero
- https://github.com/bakon11
- https://github.com/burnoutIA (PR #317: the 2..8-column speculative-verify matvec family in WMMA
iu8— Q4_K/Q5_K/Q6_K/IQ4_XS read in their GGUF layout on the existing q8_1 activations, each weight dequantized once for all the verified columns, plus the design notes and the min-term pitfall (d.SUM(xq), notds.y). Folded into block 07 in r290 as an opt-in (--wmma-verify N|auto,GGML_CUDA_WMMA_MMVQkept as the A/B alias) with the Q8_0 case and the per-format stride unit added here; the band and end-to-end numbers are inWORKLOG.md261115.002 andENVIRONMENT.md§7.6. r312 madeautoa per-type floor from a DRAM-cold sweep (5 for Q4_K/Q5_K, 8 for Q6_K/IQ4_XS/Q8_0) and refuted the "narrow low-band arm" follow-up: at 2..4 columns the K-split kernel is at 92-98 % of the memory roof —WORKLOG.md261118.005) - https://github.com/briansp2020 (block-13 moe_weighted_reduction float4 remainder fix + block-14 MUL_MAT_ID pair-fusion layout gate, issues #19 and #18; PR #213: the split-state cache hit returns instead of copying the state, folded into block 09 in r132); PR #326: the Q8_0 hyper-connection mixer path for UD quants (persistent
down_dotscounters, planar output, a Q8_1 epilogue, the combine+norm+Q8_1 kernel, a weight-preloading up band, an up+collapse launch and the F32 inject rows on the down grid) -- folded into block 11 in r313, output byte-identical onUD-Q4_K_XLacross all ten hc-fusion arms, +7.1 % decode, with the redundant_Q8sub-switches folded into the switches that already covered the class (WORKLOG.md261118.007); PR #315: sequence parallelism for the qwen4exp hyper-connection work -- the residual streams stay token-split through a 2+-device-sm tensorprefill, a newGGML_OP_TOKEN_SCATTERand a copy-engine reduce-scatter / token all-gather pair on the all-reduce's own scratch, default ON (LLAMA_SEQPAR=0off), +7 % copy-engine and +2.2 % default-chain prefill at 31.5k; reviewed, reproduced to the digit and extended to 3 cards here) - https://github.com/eoprede
- https://github.com/jstamagal (PR #338: three RDNA2-
gfx1030improvements, folded into the delivery as RDNA2-gated code in r334 — a one-warpRMS_NORMlaunch forncols <= 128with adst16-free kernel specialization, aGATED_DELTA_NETchunked-prefill gate keyed onH * n_seqs(gfx1030 has no BF16 WMMA, so the FP32 chunked kernel only wins on a low-head long prefill), the removal of block 05's stale RDNA2cols_per_block/ncols2caps (the RDNA2 occupancy is computed bylaunch_fattnitself now), and amul_mat_vec_q_moeK-block walk with the rows side by side — bit-identical, 1.26-1.32x on quantizedMUL_MAT_IDatn = 1..8; every piece is compile-gated to the RDNA2 device pass and armed at run time from the device'scc, so gfx1201/gfx1151/gfx1100 keep their numerics,ENVIRONMENT.md§7.4) - https://github.com/mjohanning99 (PR #312: the mixed K/V cache types — a q8_0 K with a q4_0 / q5_0 / q5_1 V read natively through a second tile type parameter, head 256 only, with the QSA refusal and the one-V-type-function contract; promoted as block 17 in r287, moved to optional block
0101in the r288 block-number re-org,scripts/gate-mixed-kv.sh) - https://github.com/overdoingism (PR #360: the server's tool-text protection — a tool result's, a tool call's arguments' and an assistant text's special-token strings kept as TEXT so data from a tool cannot forge a turn; folded into block 12 as the r357 amendment, default-on with a kill switch and a census,
scripts/gate-tool-text.sh, with three integration fixes named inarchive/work/tool-text/README.md— the space fallback keyed on the request's media rather than the server's mmproj capability, the mark strip armed with the feature so the kill switch restores stock, and a detokenize-and-compare check on the piecewise re-tokenization. Issue #45: the RDNA4 head-256 GQA-6 decode/verify flash-attention band, reported with the diagnosis, op-level data, the round-robin KV split idea and a working opt-in patch; the r4 block-15 band is built on that submission. PR #223: the fully-masked KV-group skip extended to the band itself, so a resident idle conversation no longer taxes the active one's decode — folded into block 05 in r133. Issue #224: the r126 row change left widths 5..8 on a different per-column KV split, so greedy decode with a draft diverged from plain decode; the band's own 64-column instantiation is back in r134, with a build-time guard and a width probe that reaches it) - https://github.com/pwilkin (the
strix-halofork at https://github.com/pwilkin/llama.cpp/commits/strix-halo/, heavily adapted for the MMB bf16-WMMA dequant-weight GEMM work, now folded into the delivery — formerlyarchive/work/mmb-general/) - https://github.com/slavap (the gfx1030 / Radeon Pro V620 bring-up: the block 00-04 add-on set (PR #165) and the FA follow-ups (PR #181, #198); PR #218: MMB's per-arch dispatch keyed to the running device (a mixed-arch box ran RDNA3 kernels on the RDNA2 card and zeroed its output projection) and the Q8_1 cache's view-offset identity + source-range guard — folded into blocks 06/08/10 in r132)
- https://github.com/RikshaDriver (issue #221 / PR #222: the three kq-mask fill sites that lacked their sibling's buffer guard — a hard startup abort at
-np 1onbailingmoe3, root-caused and validated on gfx1102; folded into block 05 in r131) - https://github.com/tungel
- https://github.com/DanoPTT (block-08 mul_mat+add through-view shape guard, PR #15; and issue #45 follow-up: the f16 verify-width diagnosis / the f16 + bf16 band coverage folded into block 15 in r5/r6, measured on their R9700)
I, and everyone else who benefits from this work, really appreciate you!
Inspirational Works
While most of the work in this repository are original works of my own, there are some significant portions, most notably around the prefill tuning, inspired by the excellent work performed by the community of: https://github.com/halo-box/strix-llama.cpp
Thank you to all the maintainers of the Strix Halo Llama.cpp project
Of course none of this would be possible without the baseline that all of this rests on, and that is the huge community over at https://github.com/ggml-org/llama.cpp
Many thanks to the llama.cpp team
License
Same as llama.cpp (MIT), with one documented exception: block 03's chunked Gated DeltaNet kernels
(gated_delta_net_chunked_bf16.cu, gated_delta_net_chunked_bf16_gfx11.cu) are ports of libr4d kernels,
and libr4d ships inside radiance under Apache-2.0. Those
parts stay Apache-2.0; radiance's LICENSE and NOTICE are reproduced unchanged in
third_party/radiance/. See NOTICE for the exact scope — it matters
if you redistribute the applied tree.
Explore related projects
Loading…