This repository has been archived on 2026-11-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Deadcode 6645337f69 radiance 1.13.0
New models:
- Tencent Hy-Memory (HYV3) from its BF16, FP8 and GGUF checkpoints, with its native tool calls
- M2XFP4: metadata-augmented MXFP4 weights for Qwen3.8-27B and its DFlash2 drafter (top-1 89.1% ->
  92.4% against plain MXFP4), its quantiser and recipe, and ParoQuant's M2XFP4 checkpoints
- Gemma 4 E2B/E4B audio input; NVIDIA-Nemotron-3.5-Bolt-E4B in int8 and 4-bit, on two cards by
  default; Ornith-1.5-122B compose files

Speed:
- Weight reads beside the decode all-reduces (qwen35_fp8, gemma3; --weight-prefetch, on by default):
  the 27B MXFP4 with DFlash2 61.2 -> 67.9 tok/s at c1, TranslateGemma 27B +13%
- Head-256 split-KV decode attention at 256 workgroups and without bank conflicts (27B: +3-5% a
  step at 25-41K context), and the prefill KV split for small launches (a short turn over a long
  context decodes the other sequences 27% faster in that step)
- MXFP4 decode gate_up, activation and fp8 quantiser in one launch (27B, Gemma 3 up to 64 rows:
  TranslateGemma +2-5% at 2-8 streams)
- ParoQuant int4/int5 tiled GEMMs 6-9% faster
- Speculation: a step's tokens are sent before the drafter's passes end, no step waits behind one
  that ends its requests, and the MTP head's first draft no longer collapses after short chats in
  the prefix cache

Features:
- --kv-resident N: KV streaming for a context bigger than VRAM (qwen4exp_fp8, GLM-5.3)
- MiniMax-H3: reference media and keyframe conditioning with the VAE encoders
- Krea 2 rebalance presets balanced, detail and subtle
- The dashboard's request history; a stall watch that reports a frozen step's thread and stack
- rad-tune at the served configuration, collectives measured as the exchange; Gemma 4 E2B/E4B's
  per-layer embeddings read ahead off the step path
- A GPTQ calibration tap and recipe for Gemma 4 31B's w4a8 container

Fixes:
- The two-rank all-reduce checks that a peer's push has landed before reducing it
- z-lab's DFlash drafter on Gemma 4 31B keeps drafting after a prefix-cache hit
- MiniMax-H3's modulation rows

Changes: Plugin ABI 31: out-of-tree plugins must be rebuilt. RADIANCE_PREFETCH_BESIDE is
--weight-prefetch now; RADIANCE_NO_HUGE_PAGES, RADIANCE_IDS_EARLY, RADIANCE_ATTN_BAND_SPLIT,
R4D_PREFILL_SPLITS, RAD_PLE_TIMING and RAD_PLE_CACHE_ROWS are gone.
2026-10-27 16:47:35 +01:00

50 lines
2.5 KiB
C++

/* bind.h -- the two views of a streamed group's one pool allocation.
*
* The stage view aliases every layer to offset 0 by reporting depth 1; `layer_slot` keeps each
* layer's group-local position, because that is also its row in the host mirror
* (docs/KV-STREAMING.md §3.5.1).
*
* A pass takes a view from its phase and row shape, before it is recorded or replayed. A decode
* pass of at most 1 + n_spec rows a sequence takes the ring: its selection is rewritten to ring
* slots and misses are copied in. Every other pass (prefill, mixed, and a decode-classified pass
* with more rows a sequence, such as the serial drafter's history pass) takes the stage, the
* group's context at block-id addressing, where no selection can overflow. `phase`, `n_tok`,
* `n_seq` and `n_spec` are in the pass key, so a recorded pass replays against its view.
*/
#pragma once
#include "mem/kv.h"
#include "runtime/ctx.h"
namespace rad {
enum class KVView { Ring, Stage };
/* Fill both views from the carved plan and make the ring active. A non-paged group is left
* untouched. */
void kv_bind_views(const KVGroupPlan& p, KVPoolBinding* b);
/* A layer's offset in the active view: 0 at depth 1. The `off + layer_stride <= bytes` bound in
* issue.cpp holds for both views. */
int64_t kv_binding_offset(const KVPoolBinding& b, int64_t layer);
/* The view a pass with this phase and row shape takes (see the header). */
KVView kv_pass_view(int phase, int64_t n_tok, int64_t n_seq, int n_spec);
/* Make `view` active; the stage falls back to the ring when the group has none. */
void kv_binding_enter(KVPoolBinding& b, KVView view);
/* One rank's step view of a group's ring and mirror, copied into `out`; null when the group does
* not stream. With `per_rank`, `src` is that rank's own manager's view: its maps live in that
* rank's KV pool and its mirror is that rank's pinned allocation. Without (tests), `src` is rank
* 0's and its map pointers are rebased from rank 0's pool (`kv0`) into this rank's (`kvr`). The
* addresses are fixed at bring-up. */
const RadKVStream* kvstream_step_view(RadKVStream* out, const RadKVStream* src, bool per_rank,
const void* kv0, const void* kvr);
/* A step view's identity for Ctx::pass_key: the memory a kernel reads, never the struct's address.
* The batch copies the view into one of the builder's rotating Out slots, so keying on its address
* would make every streamed decode step a new pass that never replays. */
uint64_t kvstream_view_key(const RadKVStream* v);
} /* namespace rad */