Archived
radiance 1.5.0
- Gemma 4 31B (PRs #74, #75, #81, #86; sfjes, keptn42): sliding and global attention with their own kernels, the assistant head as a drafter that reads the trunk's cache, the vision tower, a fused w4a8 decode step, bf16 and compressed-tensors int4 checkpoints, and window snapshots so a prefix hit on a sliding-window model resumes instead of prefilling again. deploy/compose/gemma4-31b-w4a8.yaml serves keptn42's container on two cards - ParoQuant (PRs #65, #66, #67; malic): Qwen3.8-27B checkpoints with learned Givens rotations, as int4, int5 and MXFP4, imported without re-quantising, the prefill's rotations on the matrix cores. deploy/compose/qwen3.8-27b-paro.yaml serves them on one card. A ParoQuant container made with the PR builds is refused: convert it again with --reuse <old container> - Gemma 4 26B-A4B with z-lab's DFlash drafter (PR #88; Perire): arch/gemma4 serves Google's bf16 checkpoint with the routed experts in block fp8 or bf16 (data/recipes/gemma4-26b-a4b-df*.recipe), and libr4d gains its windowed paged attention, the fused sandwich-norm joins, expert_scale and the sharded draft head's pair_argmax. A prefill chunk runs as two slices with its all-reduces beside the compute, bit-exact with the whole step. The 31B's global layers take the windowed attention too: an 11.5K-token prefill on two R9700s in 3.1 s instead of 4.9 - a startup that logs nothing for two minutes says where it waits (#89): the system call (a KFD request by name), the library that made it, and its stack, which addr2line resolves against the binary - the prefix cache is kept in VRAM and host memory only (#70): the disk tier wrote every block and snapshot a prompt produced, and its copies never outlived the process. --prefix-cache-host-mib is renamed --prefix-cache-mib; --prefix-cache-dir and --prefix-cache-disk-mib are removed, and startup refuses all three with what replaced them. The compose files no longer mount /data, and .env no longer needs RADIANCE_STATE - --prefix-cache-ttl S (default 3600, 0 never): a conversation no request has used for that long leaves the cache, whichever tier holds it; radiance:prefix_cache_expired_total counts them. A full host tier now drops its least recently used conversations - --vision-tower-placement vram|ram (#84): ram keeps an encoder tower in pinned host memory and gives its VRAM to the KV cache, read over the link once an image - timings carry ttft_ms and total_ms (#85): the server's own time from the request body's arrival to the first and the last token, queueing and tokenisation included - a KV-cache recall that found a moved expert with nowhere to go stopped halfway and leaked the slots it had already freed: after it every recall failed, the cache stayed short until a restart, and requests failed with HTTP 500. A recall now waits for the slots it is owed and always finishes - a tool result or tool-call arguments that are not JSON are no longer refused as nesting past 1024 levels for their unmatched brackets (#90): only text that parses as JSON is held to the bound, since nothing else is parsed into a tree - the host-pool refusal names the limit that applies to pinned memory (RAM less 1/64 and 1.5 GiB), not ttm.pages_limit - --embedding-placement auto, removed in 1.3.0, is refused with what replaced it - for out-of-tree kernel libraries: gemm_nt_q gains two operands (pb1, pb2, the part bounds), and the loader requires identical op schemas, so a library built against 1.4.0 must be rebuilt. For architecture plugins, rad_op_declared(b, op) asks whether an op is in the loaded vocabulary without declaring it
This commit is contained in:
commit
b93b531f63
127 files changed
+9609
-4796
No files matched your search
+22
-15
@@ -393,6 +393,7 @@ static void cross_check(const Plugin& pl) {
|
||||
|
||||
/* The libr4d orderings the integer priority has to preserve. */
|
||||
int p_ts = -1, p_os = -1, p_dec = -1, p_pre = -1, p_m16 = -1, p_m64 = -1, p_bt = -1;
|
||||
int p_g2dec = -1, p_g2pre = -1, p_g2win = -1;
|
||||
for (int k = 0; k < nk; ++k) {
|
||||
const RadKernelInfo* r = pl.kernel_at(k);
|
||||
if (!std::strcmp(r->name, "ar_twoshot_4rank_exact")) p_ts = r->priority;
|
||||
@@ -402,12 +403,17 @@ static void cross_check(const Plugin& pl) {
|
||||
if (!std::strcmp(r->name, "gemm_bf16_nt_m16")) p_m16 = r->priority;
|
||||
if (!std::strcmp(r->name, "gemm_bf16_nt_m64")) p_m64 = r->priority;
|
||||
if (!std::strcmp(r->name, "gemm_bf16_nt_tiled")) p_bt = r->priority;
|
||||
if (!std::strcmp(r->name, "attn_decode_h256_gqa2_fp8kv")) p_g2dec = r->priority;
|
||||
if (!std::strcmp(r->name, "attn_prefill_h256_gqa2_fp8kv")) p_g2pre = r->priority;
|
||||
if (!std::strcmp(r->name, "attn_window_h256_gqa2_fp8kv")) p_g2win = r->priority;
|
||||
}
|
||||
ok("two-shot all-reduce outranks one-shot (libr4d row order)", p_ts > p_os && p_ts > 0);
|
||||
ok("paged decode outranks paged prefill in the shared band", p_dec > p_pre && p_dec > 0);
|
||||
ok("gemm_bf16_nt_m16 outranks _m64 (libr4d row order, see the ladder)", p_m16 > p_m64);
|
||||
ok("gemm_bf16_nt_tiled outranks _m64 and not _m16 (M > 64 is its band)",
|
||||
p_bt > p_m64 && p_bt < p_m16);
|
||||
ok("the h256/gqa2 legs outrank the windowed kernel in both their bands",
|
||||
p_g2win > 0 && p_g2dec > p_g2win && p_g2pre > p_g2win);
|
||||
std::printf("\n");
|
||||
}
|
||||
|
||||
@@ -12010,7 +12016,7 @@ static void ar_three_rank(const Plugin& pl, const std::vector<int>& devs, const
|
||||
* sums correctly. This one gives every element its own value, so a word reduced by the wrong
|
||||
* owner, gathered from the wrong slot or dropped at a short shard's end is a wrong number at a
|
||||
* known index. The sizes walk the uneven split: words % 3 of 0, 1 and 2, from a 16-word message
|
||||
* to the row's 20971520-element ceiling, in place (how every block issues it) and once out of
|
||||
* to past the old 20971520 ceiling, in place (how every block issues it) and once out of
|
||||
* place, back to back on ONE instance so the slot parity and the changing block count are
|
||||
* exercised the way a step's mixed messages exercise them. The oracle is the fold the kernel
|
||||
* claims -- fp32 in ascending rank order, rounded once -- so it is bit for bit, and so it is also
|
||||
@@ -12089,8 +12095,9 @@ static void ar_three_rank_pattern(const Plugin& pl, const std::vector<int>& devs
|
||||
struct Run { const char* dtype; std::vector<int64_t> sizes; int oop; };
|
||||
const std::vector<Run> runs = {
|
||||
/* bf16, the residual: words = numel / 8. 2048 x 2048 rows is words % 3 == 2, x 2049 is
|
||||
* 0, x 2050 is 1; 128 is 16 words (1), 24008 is 3001 (1); 20971520 the ceiling (1). */
|
||||
{ "bf16", { 4194304, 128, 4196352, 24008, 4198400, 20971520, 4194304 }, 2 },
|
||||
* 0, x 2050 is 1; 128 is 16 words (1), 24008 is 3001 (1); 20971520 the old ceiling (1);
|
||||
* 46137344, Gemma 4's feed-forward reduce at an 8192-token chunk, past it (1). */
|
||||
{ "bf16", { 4194304, 128, 4196352, 24008, 4198400, 20971520, 46137344, 4194304 }, 2 },
|
||||
/* fp32: words = numel / 4. 8196 -> 2049 (0), 4100 -> 1025 (2), 1048580 -> 262145 (2). */
|
||||
{ "fp32", { 8196, 4100, 1048580 }, 0 },
|
||||
};
|
||||
@@ -12579,19 +12586,19 @@ static void device_phase(const Plugin& pl) {
|
||||
* context and the launch is the full-attention form. */
|
||||
attn_case(pl, "attn_prefill_h256_gqa2_fp8kv", 256, 2, 32, "fp8_e4m3", 1, 1024);
|
||||
attn_case(pl, "attn_prefill_h256_gqa2_bf16kv", 256, 2, 32, "bf16", 1, 1024);
|
||||
/* Gemma 4 dense global: head_dim 512, full attention. Launch-only cases at prefill q_len 32 and
|
||||
* decode 1, mirroring the gqa6 leg's pair; the numeric check of the same rows follows. */
|
||||
attn_case(pl, "attn_prefill_h512_gqa8_fp8kv", 512, 8, 32, "fp8_e4m3", 1);
|
||||
attn_case(pl, "attn_prefill_h512_gqa8_bf16kv", 512, 8, 32, "bf16", 1);
|
||||
attn_case(pl, "attn_decode_h512_gqa8_fp8kv", 512, 8, 1, "fp8_e4m3", 0);
|
||||
attn_case(pl, "attn_decode_h512_gqa8_bf16kv", 512, 8, 1, "bf16", 0);
|
||||
/* Gemma 4 dense global: head_dim 512, full attention, on the windowed kernel -- one row for
|
||||
* every q_len, so a prefill-shaped launch (q_len 32) and a decode one (1) of the same row; the
|
||||
* numeric check of both follows. */
|
||||
attn_case(pl, "attn_window_h512_gqa8_fp8kv", 512, 8, 32, "fp8_e4m3", 1);
|
||||
attn_case(pl, "attn_window_h512_gqa8_bf16kv", 512, 8, 32, "bf16", 1);
|
||||
attn_case(pl, "attn_window_h512_gqa8_fp8kv", 512, 8, 1, "fp8_e4m3", 0);
|
||||
attn_case(pl, "attn_window_h512_gqa8_bf16kv", 512, 8, 1, "bf16", 0);
|
||||
/* The numeric attention check: the same rows, but with random data and a comparison
|
||||
* against the inline oracle, plus a negative control. h512 is prefill + decode; h256/gqa2 is
|
||||
* decode-only (the windowed sliding-window leg, window 1024). */
|
||||
attn_numeric_case(pl, "attn_prefill_h512_gqa8_fp8kv", 512, 8, 32, "fp8_e4m3", 0);
|
||||
attn_numeric_case(pl, "attn_prefill_h512_gqa8_bf16kv", 512, 8, 32, "bf16", 0);
|
||||
attn_numeric_case(pl, "attn_decode_h512_gqa8_fp8kv", 512, 8, 1, "fp8_e4m3", 0);
|
||||
attn_numeric_case(pl, "attn_decode_h512_gqa8_bf16kv", 512, 8, 1, "bf16", 0);
|
||||
* against the inline oracle, plus a negative control. */
|
||||
attn_numeric_case(pl, "attn_window_h512_gqa8_fp8kv", 512, 8, 32, "fp8_e4m3", 0);
|
||||
attn_numeric_case(pl, "attn_window_h512_gqa8_bf16kv", 512, 8, 32, "bf16", 0);
|
||||
attn_numeric_case(pl, "attn_window_h512_gqa8_fp8kv", 512, 8, 1, "fp8_e4m3", 0);
|
||||
attn_numeric_case(pl, "attn_window_h512_gqa8_bf16kv", 512, 8, 1, "bf16", 0);
|
||||
/* The h256/gqa2 PREFILL numeric check. Unlike the decode leg (ctx 64 < window, so the window
|
||||
* clamps to the context), ctx here is 2048 > window 1024, so the window actually bites: for
|
||||
* query row 0, pos = 2048-64 = 1984 and the visible keys are [961..1984], so the kernel's
|
||||
|
||||
Reference in new issue
Block a user