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.
79 lines
4.2 KiB
C++
79 lines
4.2 KiB
C++
/* bringup.h -- the engine side of a streamed group's bring-up (docs/KV-STREAMING.md §4.1).
|
|
*
|
|
* `--kv-resident N` is the only switch: absent or 0 nothing streams, and a ring that covers the
|
|
* group's context streams nothing either, so the group keeps the resident path at no cost. This
|
|
* module chooses the group, refuses what cannot stream, applies the ring's floors, gates the host
|
|
* mirrors against host RAM, fills the maps and reports, so core/engine_bringup.cpp makes one call
|
|
* at each seam.
|
|
*/
|
|
#pragma once
|
|
#include "mem/kv.h"
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace rad {
|
|
|
|
struct Config;
|
|
|
|
/* What --kv-resident resolved to. `group` is -1 when nothing streams; the other fields then say
|
|
* what was asked and why, for the report. */
|
|
struct KVStreamSetup {
|
|
int32_t group = -1; /* the group that streams; -1 when none does */
|
|
std::string group_name; /* the group that would have */
|
|
int64_t asked_tokens = 0; /* --kv-resident as given */
|
|
int64_t raised_tokens = 0; /* the ring a floor raised it to; 0 when not raised */
|
|
bool raised_by_union = false; /* raised to the decode-step bound, not the floor */
|
|
int64_t context_tokens = 0; /* --max-model-len x --max-num-seqs */
|
|
int64_t ring_tokens = 0; /* the carved ring, in tokens */
|
|
int64_t ring_blocks = 0; /* the carved ring, in blocks */
|
|
int64_t block_size = 0; /* the group's page, in tokens */
|
|
int64_t ctx_blocks = 0; /* the group's id space, in blocks */
|
|
int64_t stage_blocks = 0; /* the stage view's depth in blocks; 0 when none */
|
|
};
|
|
|
|
/* The host mirrors summed over the ranks; `max_rank_bytes` is the largest one rank pins (an uneven
|
|
* tensor-parallel split gives ranks different shards). */
|
|
struct KVStreamHostUse {
|
|
KVStreamCost sum;
|
|
int64_t max_rank_bytes = 0;
|
|
};
|
|
|
|
/* Whether `op` must not be declared: the streamed-only ops (kv_store_streamed, its folded form,
|
|
* kv_resolve) exist only for a carved ring, so a run that carves none must not have them in its
|
|
* graph. False when the architecture streams (RadBuildCtx::kv_stream_ok) and --kv-resident asks
|
|
* for a ring. Every architecture's rad_op_declared check then falls through to its resident path. */
|
|
bool kvstream_op_gated(const RadBuildCtx& ctx, const char* op);
|
|
|
|
/* Read --kv-resident against rank 0's declarations and fill `out`; RAD_OK with group -1 when
|
|
* nothing streams.
|
|
*
|
|
* - The group is kv_stream_group's. A ring that covers its context streams nothing.
|
|
* - An architecture with no streamed path for the group (kvstream_ops: no kv_resolve, or no
|
|
* streamed store, as for a packed fp8_v4 / k6_v4 cache) ignores the flag with one warning
|
|
* naming the missing op or the layout; `out` is then exactly the no-flag configuration.
|
|
* - A core dtype other than E4M3 or bf16 is refused: the streamed store has rows for those only.
|
|
* - A ring below the decode-step bound or kStreamFloorTokens is raised, with one warning.
|
|
* --kv-resident itself is left as given; `out` holds both numbers for the report. */
|
|
int kvstream_configure(const Config& cfg, int64_t ctx, const std::vector<KVGroupInfo>& groups,
|
|
const Program& prog, KVStreamSetup* out);
|
|
|
|
/* Add one rank's stream_cost() to `use`. */
|
|
void kvstream_host_add(KVStreamHostUse* use, const KVManager& kv);
|
|
|
|
/* The host-RAM gate for the mirrors, checked once before any rank pins one. A mirror is one full
|
|
* context of the group per sequence per rank, the largest host allocation after the experts'
|
|
* pool, so it is checked against everything still to be pinned after it (`still`). A refusal
|
|
* names --max-model-len and --max-num-seqs, which size it; --host-pool-mib sizes the experts' pool
|
|
* and cannot make room here. */
|
|
int kvstream_host_gate(const KVStreamHostUse& use, int n_ranks, int64_t still, int64_t headroom);
|
|
|
|
/* After the carve: fill the maps on a bring-up stream and drain it. */
|
|
int kvstream_fill(KVManager& kv);
|
|
|
|
/* The startup lines: the raised ring, which group streams and what it took on both tiers, the
|
|
* stage, or which context a ring given by the flag covers. */
|
|
void kvstream_report(const KVStreamSetup& s, const KVStreamHostUse& host, int n_ranks);
|
|
|
|
} /* namespace rad */
|