Commit Graph
485 Commits
Author SHA1 Message Date
C_Tamas 06172e98de Merge branch 'pr1-device' into pr2-engine 2026-10-25 17:19:16 +07:00
C_Tamas 59870fc32e Merge remote-tracking branch 'origin/main' into pr1-device 2026-10-25 17:19:12 +07:00
mici81andClaude Opus 5.5 6efffe2a59 libr4d: the split-KV decode attention (head 256, gqa 6) stages V4 without bank conflicts or serial rounds
The V4 tile's store (storeV4) wrote dim octets 8 rows = 96 dwords apart, so the octets a wave stores at once
shared banks (4-way on 32 banks), and on k6_v4 each tile's V fetch ran as three exec-masked rounds, each issued
after the previous one returned, the scale pair packed right after its loads. Now:

- the V tile is skewed: octet o's rows start 16 (o & 3) + 8 ((o >> 2) & 1) + 128 (o >> 2) halfwords later, so a
  store's octets land on distinct banks; the PV read adds the same offset, a compile-time constant a fragment
  (V4 at tile 16, contiguous layout, two or more waves; one wave keeps the plain tile, which its LDS budget
  needs);
- k6_v4: __builtin_assume(tid < NTHR) and a wave-uniform test for the partial round, so a tile's V loads issue
  as one batch, and the scale pair packed at the store, as the prefill kernel does since its own fix. fp8_v4
  keeps the tested rounds (batched there, its 4-row steps ran 6 % slower) and its pack.

Bit for bit: the same values in the same LDS cells, read in the same order.

r4d_selftest --perfdecattn on 2x R9700 (265 W), Qwen3.8-27B TP2 rank, k6_v4, sequences x rows x context,
3 interleaved rounds, medians: 1x8x100k 277.0 -> 260.1 us (-6.1 %), 1x8x200k 404.8 -> 377.7 (-6.7 %),
4x8x100k 799.4 -> 753.0 (-5.8 %), 4x8x200k 1733.3 -> 1655.3 (-4.5 %), 8x4x100k 1257.8 -> 1179.8 (-6.2 %),
16x4x41k 996.3 -> 973.4 (-2.3 %). fp8_v4 with the skew alone: -3.6 % (16x4x41k) .. -0.1 %.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 10:34:04 +01:00
Dustin Ewan 32bb5592d0 engine: a stall watch across the step loop -- a frozen step reports the blocked thread, its syscall and its stack instead of hanging silently 2026-10-25 10:31:06 +01:00
Dustin Ewan cc0a862afa ple: two gather regimes -- decode gathers on demand (lookup or direct read, no queue, no claims); prefill chunks use the producer queue 2026-10-25 10:31:06 +01:00
Dustin Ewan baf503e021 ple: the gather self-produces unclaimed rows on decode -- the queue prefetches prefill futures only; a decode step never waits behind it 2026-10-25 10:31:06 +01:00
Dustin Ewan 2918a2eef2 sched: re-record the pinned step-batch fingerprints -- the read-ahead queue stages 9T tokens, not 2 2026-10-25 10:31:06 +01:00
Dustin Ewan 2078b28fcb tune: --max-seqs, --kv-cache-dtype, --tp-wire, --tp-wire-min-kb -- declare at the served configuration, or the tune rows key to bands no served step selects 2026-10-25 10:31:06 +01:00
Dustin Ewan d2d9b9687e ple: the gather defers all disk I/O to the producer -- the step thread classifies, waits per row on the producer's word, and never touches the ring 2026-10-25 10:31:06 +01:00
Dustin Ewan 1fb35740df ple: an 8-chunk read-ahead queue with a sliced producer and a tunable row cache -- the table's rows prefetch off the step path 2026-10-25 10:31:06 +01:00
Dustin Ewan e9555d2bc1 tune: measure collectives as the exchange -- per-rank operands and instances, device.p2p measured before declare, tune requests carrying their instance 2026-10-25 10:30:52 +01:00
dustin d0c44cf5a3 tools: a w2a8 recipe in the fallback shape table -- rad-tune can now size the draft head it serves
rad-tune skips a (kernel, shape) pair it cannot size: a schema names operands, not extents, and
a tool has to allocate the bytes the kernel will read. For gemm_nt_q the reference describes the
fp8 and the symmetric integer grids and declines every grid with a zero point, because
ref_planes.h joins scale and zero into one operand a RadOpdDesc cannot state. w2a8 is such a
grid, and it is the one the DFlash2 draft head serves, so both of its bands were skipped at
every tune and the served card ran the axis defaults for them.

The extents are not a guess. r4d_rad_layout_w2a8 owns them: codes to fragment order, N*K/4 bytes
(r4d.w2a8.frag.g128), and one dword per row and 128 of K joining that group's f16 scale and
integer zero, tile-major, N*K/128 of them (r4d.w2a8.sz.g128). The activation triple is
quant_act_i8's own output -- int8 codes, one f32 scale a row, and the group-major code sums with
rows padded to 16 -- and the grid is asymmetric, so the kernel refuses the case without the
sums. b_ref stays absent; the reference exponent is mxfp4's.

relayout_parity_test is where both sides exist, so the claim goes there: the table's byte total
for b and b_scale against the same hooks' RadLayout.bytes, over libquant's planes, for w2a8 and
for mxfp4a8, whose sizes the table has carried untested since it was written. Writing the
table's K/4 as K/2 fails it with "the table sizes 32768 byte(s), the kernel stores 16384". The
kernel's own guards -- K a whole number of 128-column blocks, N a whole number of 16-row tiles,
the group the stored form has -- are pinned as refusals, and the shape a two-rank draft head
tunes at (M 8, N 124160, K 2560, group 128) is pinned as accepted.
2026-10-25 10:30:52 +01:00
mici81andClaude Opus 5.5 2af1079415 libr4d: the head-256 split-KV decode attention aims at 256 workgroups at one or two waves
At one or two waves a workgroup (q_len * gqa <= 32: a plain decode step, or the DFlash2 short block's
4-row verify) the 128-workgroup target leaves too few KV bytes in flight for the card's DRAM; twice as
many workgroups reach it. At three waves (an 8-row verify) more workgroups only add contention, so
those keep 128.

Qwen3.8-27B MXFP4 at TP2 on 2x R9700, k6_v4 KV:
- r4d_selftest --perfdecattn: 4 sequences x 1 row over 100k 582 -> 464 us, 1 x 1 over 100k
  264 -> 175, 16 x 4 rows over 41k 985 -> 801; 4 x 8 rows over 100k +9 % (kept at 128).
- The server's decode step at speculation 7 (the median gap between steps carrying every sequence,
  three rounds): 8 x 41k 34.01 -> 32.48 ms (-4.5 %), 16 x 25k 44.65 -> 43.19 ms (-3.3 %).

The split count already moves with the batch (8 sequences at 256 split as 4 do at 128), so the merge
sees no new partition; not bit-identical to the 128 target at the same batch.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 10:12:58 +01:00
mici81andClaude Opus 5.5 bc272f897d arch_test: the pins of the families this branch changes, on the new base
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 10:11:47 +01:00
mici81andClaude Opus 5.5 8998349eec qwen35_fp8, gemma3: the weight reads beside the all-reduces are switched off by RADIANCE_PREFETCH_BESIDE=0
1.12.0 dropped RADIANCE_PREFETCH; the reads are now issued, or not, by prefetch_beside's own switch.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 10:11:47 +01:00
mici81andClaude Opus 5.5 de53cd18c1 runtime: an op that names no buffer is not held to the second lane's window
The window keeps lane 1's concurrent buffers live only across it. A weight read into the cache
(prefetch_beside) names no buffer, so it touches nothing the window protects: it may run on lane 1
outside the window (a DFlash2 drafter's reads come after the trunk's window), and it leaves no window
work for lane 0 to join. runtime_test covers it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 10:11:47 +01:00
mici81andClaude Opus 5.5 c9f79c32d8 gemma3: weight reads beside the decode all-reduces, trunk and DFlash2 drafter
As qwen35_fp8 has them (prefetch_beside, rad_arch.h): behind the o GEMM, beside the attention
block's all-reduce, gate|up's leading 24 MB are read into the on-die cache; behind the down GEMM,
beside the feed-forward's, the next layer's q; the drafter's all-reduces take the same
(Dflash2::Config::prefetch). Decode steps of up to 32 rows, none on a step with a prompt's rows,
only at more than one rank; RADIANCE_PREFETCH=0 declares none.

TranslateGemma-27B MXFP4 + DFlash2, TP2 on two R9700s, no speculation, two rounds, x1 / x4 / x8
tok/s against none (56.8 / 182.0 / 325.0): 8 MB 63.3 / 203.1 / 354.9; 12 MB 63.0 / 202.6 / 354.9;
16 MB 63.5 / 203.9 / 356.6; 20 MB 64.1 / 204.0 / 359.4; 24 MB 64.4 / 206.4 / 359.3 (+13.4 / +13.4 /
+10.5 %); 32 MB 63.1 / 201.4 / 351.9. With speculation 7 (three rounds, greedy, medians) x1 / x4 /
x8 / x16 158.1 / 409.0 / 592.0 / 710.8 -> 177.3 / 428.4 / 592.3 / 717.6 (+12.1 / +4.7 / 0.0 /
+1.0 %). Bit for bit: a prefetch reads weights only.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 10:11:47 +01:00
mici81andClaude Opus 5.5 be85c0ba7f qwen35_fp8: weight reads beside the decode all-reduces, trunk and DFlash2 drafter
As gemma4_bf16 does (prefetch_beside): at two or more ranks, on decode steps of up to 32 rows, gate_up's
first 12 MB is read into the on-die cache beside the mixer's all-reduce and the next layer's first
projection's beside the feed-forward's; the DFlash2 drafter's reads take the same 12 MB.

Qwen3.8-27B MXFP4 + DFlash2, tp 2, 2x R9700: no speculation x1 61.2 -> 67.9 tok/s (+11 %), x4 225.0
-> 251.2 (+12 %), x8 403.7 -> 438.6 (+9 %), x16 650.8 -> 668.1 (+3 %), x32 +0.8 %; speculation 7
x1..x16 +0..+2 % for the trunk, the drafter's reads x1 +6 % (median of eight rounds); prefill
unchanged. The size and ceiling sweep is in the comment by kPrefetchBytes. RADIANCE_PREFETCH=0
declares none: arch_test's pipe-off case now sets it and still meets the serial graph pinned before
either existed. qwen35_w8a8 builds the same source; the routed (MoE) trunk takes no reads.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 10:11:47 +01:00
mici81andClaude Opus 5.5 fa7a5e4164 r4d_selftest: every push landing after its flag (the push check's regression case)
A test-only mode of the two-rank exact all-reduce (drain 4, set by
R4D_AR_TEST_LATE_PUSH=1 in the launcher, not in any tuning table): every block
publishes its flag before its push, pushes about 20 us later and stores its check
word as a release, since no flag release follows to write the bytes back. The new
case runs the 32-round sweep of ar_oneshot_2rank_exact and its host twin under it.

Without the push check the readers sum their slots' previous contents (16.5 million
of 18.5 million elements wrong on the device row, 12.9 million on the host twin);
with it every sum is exact.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 10:11:27 +01:00
mici81andClaude Opus 5.5 0044d8d201 libr4d: check that a peer's push has landed before reducing it (2-rank family)
A two-rank all-reduce or gather pushes its bytes into the peer's slot over PCIe P2P,
drains its stores and then publishes a release flag; the peer reads the slot once it
sees the flag. On 2x R9700 the bytes do not always land before the flag. With reads
streaming beside the all-reduce (prefetch), a greedy reply differed from one server
start to the next.

A probe in ar_rmsnorm_quant_fp8 compared, right after the handshake, a plain load of
the slot with a system-scope load and with the same word 100 us later: in about 1
launch in 1000 the reader saw the slot's previous contents, and the new bytes arrived
about 1 us later, sometimes more. Pushed bytes wait in the writer's L2 until a
system-scope release writes them back: with the flag sent before the push (a test
mode) and nothing after it, they stayed invisible for the whole kernel (49 ms). The
flag's release does write them back, but the writeback and the flag store reach the
peer by different paths, so the flag can arrive first. A stronger drain on the writer
(drain=1), PCIe relaxed ordering off on both cards and an HDP flush on the reader did
not change that; acq=1 hides it only by delaying the reads (and costs 12-33 % of
decode).

The writer now sums a per-dword hash (MurmurHash3's finalizer over value and index)
over what it pushes and stores the block's sum, salted with its handshake value, into
the peer's check word for (slot, block): two parity slots of fine-grained words after
the flags. The flag's release that follows writes the pushed bytes back. The reader
reads the check word, sums the same over the bytes it is about to read and, until the
two agree, takes an acquire fence, sleeps briefly and reads again; a push that never
lands traps after 2 s. A stale element and a stale check word both disagree, so the
order in which the two land does not matter. No value changes.

Kernels: ar_rmsnorm_quant_fp8 (exact and 6-bit wire), r4d_ar_oneshot_2rank_exact,
r4d_ar_hc_write, r4d_ar_gather_hc_write, r4d_ar_gather_2rank,
r4d_ar_oneshot_2rank_wht6, r4d_ar_hc_write_wht6, ar_rmsnorm_quant_i8,
r4d_ar_ln_had_quant_i8. Also: the link gate is released after the check, the exact
and gather launchers round their width to whole waves (the check's wave sum reads all
32 lanes), and ln_had's dynamic LDS ceiling leaves room for the check's static words.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 10:11:27 +01:00
mici81andClaude Opus 5.5 2721f7c951 MXFP4 gated fold: review fixes and docs
The parts of the series' review rounds that concern the fold, carried over when the series was
split:

- gemm_mxfp4a8_gated_gemv: operand dtypes checked, the activation scale grid read as the gemm_nt_q
  rows read it (mx_ascale_grid), row pitches checked against the widths; the arrival counters are
  zeroed before any launch reads them (the memset is on the null stream, which the engine's
  streams need not wait for).
- The layout hooks refuse an operand the gated row does not have; the GeGLU chain refuses
  out_bf16 (its bf16 plane is a temporary there).
- r4d_selftest: the reference plane through the gemv row's own hook must be the same bytes; the
  small gated cases at K 256.
- libr4d/README.md and docs/TOOLS.md: the row, and --perfmxd's fold timing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 09:59:53 +01:00
mici81andClaude Opus 5.5 cbc299417e gemm_mxfp4a8_gated_gemv: a block per gate/up tile pair, the group quantised by its last block
One block a 128-column group left the grid at n / 128 blocks (68 at Qwen per rank on 32 WGPs) and
the fold lost to the pair it replaces. Now the gemv row grid and K order, the bf16 product and
row amaxes through the op scratch, an arrival counter per group keyed on the output. Byte for
byte the old fold (selftest, twice into one output); r4d_selftest launch_row sizes scratch.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 09:59:53 +01:00
mici81andClaude Opus 5.5 a596f68782 gemm_nt_q_gated_mx at gelu_tanh: the GeGLU MLP's gate_up, gelu_mul and quant_act_fp8 in one launch
TranslateGemma's MLP over MXFP4 runs gate_up, gelu_mul into a bf16 plane and quant_act_fp8 over it
before down. The gated fold now takes act gelu_tanh: gelu_mul's tanh GELU with its constants, the
product rounded to bf16 as gelu_mul stores it, then quant_act_fp8's quantiser (the same arithmetic as
gated_quant_fp8's). Byte-identical to the three-op chain (selftest at M = 1, 4, 8 on TranslateGemma's
per-rank gate_up, the smallest shape and the per-row scale); the replaces-hook gives the chain. The
GeGLU form writes no out_bf16: the chain's bf16 plane is gelu_mul's own output, which the hook cannot
hand to an optional operand, and the shim refuses one.

The gemma3 plugin declares the fold at up to 8 rows when both MLP linears are MXFP4 and no
calibration tap reads the bf16 plane.

TranslateGemma alone, speculation 7, two rounds each: one stream 144.5 / 144.9 -> 151.5 / 150.5 t/s,
four streams (32 rows a step, past the band) unchanged; greedy translations identical.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 09:59:53 +01:00
mici81andClaude Opus 5.5 f16854499c decode launches: gate_up + gated_quant_fp8 folded for MXFP4 (gemm_nt_q_gated_mx)
A decode step on Qwen3.8-27B at TP2 issues 631 kernels a card, and a dependent kernel costs the card
3.5-6.4 us in a replayed graph on gfx1201 however little it does, so launches are about 13 % of a
step.

- gemm_nt_q_gated_mx: gemm_nt_q_gated over an OCP-MXFP4 weight (b_ref after b_scale; a new op, not
  an optional operand on the old one). Row gemm_mxfp4a8_gated_gemv: M <= 8, a block per 128-column
  group of the gated output, a wave per gate or up tile running all of the gemv WMMA form's partials
  in its order, then gated_quant_fp8's epilogue -- byte-identical to gemv + gated_quant_fp8
  (selftest, M = 1..8, Qwen's and TranslateGemma's gate_up). The MLP block declares it for a plain
  MXFP4 gate_up when a loaded library declares the op (libref does not), so a CPU-only engine takes
  the pair. Layout hooks map its b_ref (operand 4) to gemm_nt_q's index, so the weight is stored once.
  The fold: 82.5 us against 81 + 4.6 for the pair at Qwen's gate_up, 98.8 against 104 + 4.7 at
  TranslateGemma's.
- --perfmxd times gated_quant_fp8 and the fold beside the gemv row at a gate_up shape.

Greedy texts of four prompts, speculation 0 and 3, identical to the production build.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 09:59:53 +01:00
C_Tamas 486c933161 device and plugin boundary: kv_resolve, the streamed store rows, ABI 30 2026-10-25 09:58:04 +01:00
mici81andClaude Opus 5.5 32881da9fd docs/GUIDE: two engines on one R9700 pair -- the driver's queue split (amdgpu.num_kcq) and the start order
The four compute queue slots the GUIDE names are what amdgpu leaves to user queues while it keeps four of the
card's eight for its own kernel queues. With num_kcq=0 MES maps all eight (compute_hqd_mask 0xf), two engines'
queues fit, and the weight reads beside the all-reduces can stay on. The order the engines create their
second-lane queues decides where MES places them, so the first engine should serve one request before the
second starts. Measured with Qwen3.8-27B and TranslateGemma 27B on two R9700s.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 09:33:05 +01:00
keptn42 6d6541af42 docker: libopenblas-dev in the build stage, so libquant's GPTQ uses LAPACK 2026-10-25 09:32:42 +01:00
C_Tamas 8af24965cc kvstream: the raise names the floor that bound it
With only the union raise, "raised to N tokens" always meant "one decode
step's selection". Now that the shipped floor can bind instead, both startup
lines said the wrong thing: --kv-resident 1 reported "a decode step can name
1026 blocks" while carving 8192. KVStreamRing::by_union carries which bound
won, and KVStreamSetup::raised_by_union hands it to the report.

Verified on 2x16 GB: --kv-resident 1 now prints "a ring under 32768 tokens
(8192 blocks of 4) misses more than it saves, so the shipped floor is what the
carve takes", the report line says the same, kv_resident_blocks reads 8192 and
the engine serves.
2026-10-25 09:58:22 +07:00
C_Tamas 613bbaacfd kvstream: the ring is never carved below the shipped floor of 32 768 tokens
The raise enforced only the validation union -- the largest block union one
decode launch selects, max_seqs x (1 + n_spec) x sel_pitch -- which on the
reference model is 1026 blocks = 4104 tokens. That is the depth below which a
step cannot be served at all, not the depth below which streaming pays: the
measured curve puts the cost point at 24 576 and the shipped value at 32 768
(docs/KV-STREAMING.md 3.9). --kv-resident 1 therefore carved a 4 104-token
ring, and one 7 800-token request took 7 213 misses over 8 decoded tokens.

kStreamFloorTokens (32 768) is now a floor the carve enforces:

  * kvstream_ring_shape raises any ring under it, then kvstream_ring raises
    that to the union when the union is larger; both are clamped to the
    group's context, so a context under 32 768 tokens streams nothing (the
    ring covers it and the group keeps the base engine's path);
  * RadBuildCtx::kv_resident_blocks carries the raised number into the
    declare, because kv_resolve sizes its residency table from it -- a carve
    deeper than the declared table is refused by the kernel;
  * the startup warning says which bound applied, and KVStreamRing::floor_blocks
    keeps the two distinct.

The flag is still the operator's: --kv-resident 65536 stays 65536, and a
context that fits is untouched apart from the 32 768 floor.
2026-10-25 09:29:17 +07:00
keptn42 49a02c79df deploy/compose, README: NVIDIA-Nemotron-3.5-Bolt-E4B 4-bit container
The feed-forward at four bits (GPTQ), attention and layers 19-23 at i8a8, on one card; the recipe is
gemma4-e4b-bf16-a4-df.recipe with GPTQ for the int4 linears. Needs main from 248ecf5 (a4, #214).
2026-10-25 01:55:35 +00:00
C_Tamas 2bf1096131 prefix cache: the host tier cannot hold a streamed entry, so it is off
The prefix cache's host tier and --kv-resident are exclusive, and the engine
used to find that out at the first restore. An entry covers every cached
group; a streamed group's rows are addressed by the block id its sequence
used, in that group's own pinned mirror, so a slot cannot stand in for them
and their ids cannot be given up in exchange for one.

Three defects came from ignoring that:

  * the write-back gathered the resident sibling with the streamed group's
    block id, so the host slot held another group's row (TierExec indexes
    its block vector by gi_, the entry's ids are in groups_ order);
  * demotion released the streamed group's ids too (PrefixCache::
    release_blocks walks every group), handing the mirror rows the entry
    lives in back to the allocator;
  * a restore reserved one group's ids against an entry that has two, so
    rebind returned RAD_E_SHAPE and the record was dropped -- and
    engine.cpp's failure path then released those ids against the wrong
    pools.

Measured on 2x16GB tp2, three 44220-token conversations and a replay of the
first after the third displaced it, streaming on: 20247 entries demoted,
8588 restored, replay 0 cached tokens / 16.5s against streaming off's
44160 cached / 0.4s. The copies were pure waste.

Two rules now:

  * PrefixCache::demotable() is false when any cached group streams: the
    tiers are never told about such an entry (insert), and trim_sparing no
    longer skips it as though its copy were in flight, so it is evicted
    whole with every group's ids.
  * kvstream_prefix_host_off() turns --prefix-cache-mib off at bring-up,
    before anything is sized from it, when cfg.kv_streams is set -- the
    flag asked, the architecture streams and the ring is under the context.
    A flag with no streaming behind it (0, a ring that covers the context,
    a model with no kv_resolve) keeps the tier exactly as configured.

On the cards: --kv-resident 32768 reports "no host cache ... so it is off"
and 0 (off); --kv-resident 131072 keeps 2.00 GiB / 38836 entries. The tests
live in the mem test file's own commit; the docs in the docs commit.
2026-10-25 07:03:03 +07:00
keptn42 c3567d3f03 deploy/compose, README: Ornith-1.5-122B containers
Four containers on Hugging Face (keptn): FP8 and w4a8, each with MTP or DFlash2, on four cards.
A compose file and a row in the models table for each; docs/DOCKER.md lists them and the two
NVIDIA-Nemotron-3.5-Bolt-E4B files.
2026-10-24 23:47:26 +00:00
d 8a765db488 flags: drop the refusals for --kv-streaming and --kv-stream-threshold 2026-10-24 20:57:59 +07:00
C_Tamas fc034b526e Merge branch 'pr1-device' into pr2-engine 2026-10-24 14:40:11 +02:00
d be47bf19af Merge remote-tracking branch 'origin/main' into pr1-device 2026-10-24 19:31:54 +07:00
C_Tamas a9e627b7ca engine: the KV plan split, the host mirror, and --kv-resident bring-up 2026-10-24 19:19:19 +07:00
C_Tamas cce687bf2c device and plugin boundary: kv_resolve, the streamed store rows, ABI 30 2026-10-24 19:19:19 +07:00
keptn42 248ecf5858 recipes: gemma4-e4b-bf16-a4-df (int4 feed-forward, int8 attention and layers 19-23, DFlash, vision) 2026-10-24 13:43:30 +02:00
keptn42 60f6eab298 gemma3: a4 at decode heights through w4a16_asym
The same split as gemma4_bf16 and LinearFP8's w4: up to 64 rows an f16 copy of the input and
w4a16_asym, above that quant_act_i8g and w4a8i8_asym.
2026-10-24 13:43:30 +02:00
keptn42 7e42d394a5 gemma4_bf16: a4 at decode heights through w4a16_asym
w4a8i8_asym has only a prefill kernel. Up to 64 rows the input is cast to f16 for w4a16_asym's
skinny kernel, as LinearFP8's w4 does.
2026-10-24 13:43:30 +02:00
keptn42 7054e505d9 gemma4_bf16: asymmetric int4 linears (w4a8i8_asym over a scale per 128)
As gemma3's G3Linear: u4 codes, a u8 zero point and an f16 scale per [1 x 128], read against the
same per-(row, 128) int8 activation as i8a8.
2026-10-24 13:43:30 +02:00
keptn42 6a6c50e718 arch: RADIANCE_PREFETCH_BESIDE=0 turns prefetch_beside off
Beside another server on the same card the lane-1 read costs more than it gains: the card has
fewer hardware queue slots than the two servers have queues, and the join puts a queue switch
into every decode step.
2026-10-24 13:40:05 +02:00
keptn42 8f6f12e288 README, compose: NVIDIA-Nemotron-3.5-Bolt-E4B int8 (i8a8) with DFlash and vision, one card 2026-10-24 13:39:41 +02:00
keptn42 e1ddb61087 recipes: gemma4-e4b-bf16-i8g-df (int8 trunk at i8a8, DFlash drafter on block FP8, bf16 vision tower) 2026-10-24 13:39:41 +02:00
keptn42 c4e372e699 gemma4_bf16: i8a8 linears (int8 weight and activation, a scale per 128)
From arch/gemma3's G3Linear: int8 codes with a bf16 scale per [1 x 128], gemm_nt_q at i8a8
over quant_act_i8g (an activation scale per row and 128 columns). Gemma 4 E4B's activations
carry channels 40-200 times the row median; one int8 scale a row costs most of w8a8's KL
(wikitext-2: w8a8 0.076, i8a8 0.010). q|k|v stay one GEMM; the fused junctions stay off.
2026-10-24 13:39:41 +02:00
Deadcode 5a9ce4912b radiance 1.12.0
New models:
- Fish Audio drama-3: speech with speaker tags and inline direction, voices cloned from reference
  clips (the `references` field of /v1/audio/speech and the streaming session), two cards
- Gemma 4 E2B/E4B (KV-shared layers, per-layer embeddings, clipped vision linears), with
  NVIDIA-Nemotron-3.5-Bolt-E4B in bf16 with DFlash and vision on one card, and E4B recipes

Speed:
- MXFP4 GEMMs for one to 64 rows and a tiled prefill GEMM at TN=4 from 1024 rows: the 27B MXFP4
  with DFlash2 decodes about 1% faster at c1, 5% at c4 and 14% at c16
- The fp8 and int8 LM heads read their weight once for 65 to 128 rows
- A prefill step of one sequence runs in two pieces on a second lane at two ranks (qwen35_fp8,
  gemma3): a 45K-token prompt on the 27B fp8 in 15.1 s instead of 16.2 s
- Gemma 3's fused all-reduce junctions also under a lossy wire
- --draft-short-from N: a block drafter runs its shorter block from N decoding sequences on
  (off by default; with 8 on the 27B MXFP4: c8 +12%, c16 +18%, c64 +32%, c1 unchanged)
- --tp-attn-split rows: GLM-5.3-Flash's MLA attention split by rows over the ranks, 18 to 21%
  faster prefill; lossy, `heads` stays the default
- --draft-coupling on: Qwen3.8-Flash-Next's MTP drafter samples its proposals from its reranked
  top-8 and the target's draw is coupled to it; pays at high temperatures (c1 at T 1.0: 155 ->
  178 tok/s), costs at low ones; off by default

Features:
- Edited prompts on windowed models (Gemma 4) reuse their prefix: periodic window snapshots, and
  snapshot-backed prefix KV kept across recomputes (an edited tail on Gemma 4 31B: 96 s -> 2.6 s)
- DELETE /sessions/<label> and DELETE /sessions?id=<id> forget one stored conversation
- --state-cache-dtype f16: the delta-net state cache at half the memory (qwen35 plugins; lossy)

Fixes:
- A browser's CORS preflight allows DELETE

Changes: Plugin ABI 27: out-of-tree plugins must be rebuilt. The environment switches the PRs
added are flags now (--tp-attn-split, --draft-coupling, --state-cache-dtype).
2026-10-24 13:12:28 +02:00
keptn42 4bca30369b README, compose: NVIDIA-Nemotron-3.5-Bolt-E4B bf16 with DFlash and vision, one card 2026-10-24 11:13:16 +02:00
keptn42 eeeeea3c88 recipes: Gemma 4 E4B (bf16 with DFlash, w8a8 with DFlash, w4a8 with and without)
Wikitext-2 KL against the HF bf16 reference: bf16 0.0015, w8a8 0.076, w4a8 0.242 (attention and
layers 19-23 int8, feed-forward int4; all int4 is 0.612).
2026-10-24 11:13:16 +02:00
keptn42 f41f998e60 gemma4 DFlash: read dflash_config.causal for the sliding layers
NVIDIA's Nemotron-3.5-Bolt-E4B drafter states causal false with all five layers sliding; z-lab's
configs state nothing and keep the causal default.
2026-10-24 11:13:16 +02:00
keptn42 cf10b28663 gemma4_bf16: per-layer inputs of image positions use pad_token_id
As the reference (Gemma4Model.forward) the token-identity lookup of a multimodal placeholder is the
pad token's row; the context projection reads the scattered image rows.
2026-10-24 11:13:16 +02:00