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.
59 lines
3.3 KiB
C++
59 lines
3.3 KiB
C++
/* carve.h -- the streamed groups' part of KVManager::carve() (docs/KV-STREAMING.md §4.1, §4.2):
|
|
* the resident windows and dense-read floors leave the budget before the other groups split the
|
|
* rest; after the split each paged group's n_slots (and a streamed group's context and depth) is
|
|
* written, refusing a streamed group with nothing to back its other blocks; and the pool report
|
|
* gains a line naming both tiers. Arithmetic on the plans only.
|
|
*/
|
|
#pragma once
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace rad {
|
|
|
|
struct KVGroupPlan;
|
|
class KVStreamStore;
|
|
|
|
/* Bytes the streamed groups' maps take from the KV pool (KVStreamStore::cost). They are reserved
|
|
* before carve(), so the budget probe, which cannot reserve them, charges them in paged_split()
|
|
* and the carve adds them back to its budget: both then see the same bytes. */
|
|
int64_t kvstream_maps_charged(const std::vector<KVGroupPlan>& plans, const KVStreamStore& st,
|
|
int64_t max_ctx, int64_t max_seqs);
|
|
|
|
/* Whether `p` is a dense-read group (rad_kv_group_dense_read: an indexer's block keys, read over
|
|
* the whole history every step) while a sibling streams. Its pool must then hold every sequence's
|
|
* context, since the sibling's mirror is sized for max_seqs. False when nothing streams: the cache
|
|
* is then sized for one full-length sequence. */
|
|
bool kvstream_dense(const KVGroupPlan& p, const std::vector<KVGroupPlan>& plans,
|
|
const KVStreamStore& st);
|
|
|
|
/* The dense-read groups' full contexts in bytes, rounded as reserve() rounds them. */
|
|
int64_t kvstream_dense_charged(const std::vector<KVGroupPlan>& plans, const KVStreamStore& st,
|
|
int64_t max_ctx, int64_t max_seqs);
|
|
|
|
/* Take the streamed groups' windows, their maps and the dense-read groups' full contexts out of
|
|
* the split before the other groups share the rest: `remaining` loses their bytes and
|
|
* `out[group]` becomes the window's depth (or the dense-read context) in blocks. A streamed
|
|
* group's context lives in host memory, so it does not compete for the pool. */
|
|
void kvstream_split_windows(const std::vector<KVGroupPlan>& plans, const KVStreamStore& st,
|
|
int64_t max_ctx, int64_t max_seqs, int64_t* remaining,
|
|
std::vector<int64_t>* out);
|
|
|
|
/* Refuse windows and dense-read floors that do not fit `budget`, before anything is split.
|
|
* Otherwise the other groups would be left zero blocks and refused for a small pool, pointing the
|
|
* operator at the wrong flag. The fixed costs were checked by the caller. A window group cannot
|
|
* stream: its ids are its window's, not its context's. */
|
|
int kvstream_window_fit(const std::vector<KVGroupPlan>& plans, const KVStreamStore& st,
|
|
int64_t fixed, int64_t budget, int64_t max_ctx, int64_t max_seqs);
|
|
|
|
/* After the split: write every paged group's n_slots (its carve unless it streams) and, for a
|
|
* streamed group, its context as n_blocks and its depth. Refuses a streamed group whose host
|
|
* mirror or residency map is missing. */
|
|
int kvstream_apply(std::vector<KVGroupPlan>& plans, const KVStreamStore& st,
|
|
int64_t max_ctx, int64_t max_seqs);
|
|
|
|
/* The pool report's extra line for a streamed group, whose pool is smaller than its context. */
|
|
std::string kvstream_report_line(const KVGroupPlan& p);
|
|
|
|
} /* namespace rad */
|