Archived
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.
67 lines
2.5 KiB
C++
67 lines
2.5 KiB
C++
/* kvbind.cpp -- see kvbind.h. */
|
|
#include "kvbind.h"
|
|
|
|
#include "kvstream/bind.h"
|
|
#include "mem/kv.h"
|
|
|
|
namespace rad {
|
|
|
|
void bind_kv_pools(const Program& p, const std::function<const KVGroupPlan*(int32_t)>& plan_of,
|
|
std::vector<KVPoolBinding>* out) {
|
|
out->assign(p.kv_groups.size(), KVPoolBinding{});
|
|
for (size_t g = 0; g < p.kv_groups.size(); ++g) {
|
|
const KVGroupPlan* gp = plan_of((int32_t)g);
|
|
if (!gp) continue;
|
|
KVPoolBinding& b = (*out)[g];
|
|
/* A paged group's are then set from its active view by kv_bind_views. */
|
|
b.base = gp->base;
|
|
b.layer_stride = gp->layer_stride();
|
|
b.bytes = gp->pool_bytes;
|
|
b.dtype = p.kv_groups[g].decl.dtype;
|
|
|
|
/* The position of every bound layer, indexed by its absolute number. */
|
|
const std::vector<int32_t>& ls = p.kv_groups[g].layers;
|
|
int32_t hi = -1;
|
|
for (int32_t l : ls) if (l > hi) hi = l;
|
|
b.layer_slot.assign((size_t)(hi + 1), -1);
|
|
for (size_t i = 0; i < ls.size(); ++i) b.layer_slot[(size_t)ls[i]] = (int32_t)i;
|
|
|
|
/* One layer's cache shape, in the layout libref/ref_ops.h defines. Built here because only
|
|
* this point has both the plugin's declaration (heads, head_dim, state_dim, conv_width)
|
|
* and the block manager's decisions (block_size, n_blocks, n_states, conv_slots); a
|
|
* kernel cannot derive the conv depth or slot count from op parameters. */
|
|
const RadKVGroupDecl& d = p.kv_groups[g].decl;
|
|
switch (gp->kind) {
|
|
case RAD_KV_FULL:
|
|
case RAD_KV_WINDOW:
|
|
case RAD_KV_RING:
|
|
b.rank = 4;
|
|
/* Set again per view by kv_bind_views. */
|
|
b.shape[0] = gp->pool_blocks();
|
|
b.shape[1] = d.n_head_kv;
|
|
b.shape[2] = gp->block_size;
|
|
b.shape[3] = 2 * d.head_dim;
|
|
kv_bind_views(*gp, &b);
|
|
break;
|
|
case RAD_KV_LINEAR:
|
|
b.rank = 4;
|
|
b.shape[0] = gp->n_states;
|
|
b.shape[1] = d.n_head_kv;
|
|
b.shape[2] = d.state_dim[0];
|
|
b.shape[3] = d.state_dim[1];
|
|
break;
|
|
case RAD_KV_CONV:
|
|
b.rank = 3;
|
|
b.shape[0] = gp->n_states;
|
|
b.shape[1] = d.n_head_kv * d.head_dim;
|
|
b.shape[2] = gp->conv_slots;
|
|
break;
|
|
default:
|
|
b.rank = 0; /* the null sentinel at handle 0; nothing issues against it */
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
} /* namespace rad */
|