Archived
radiance 1.14.0
New models and formats: - libr3d: a kernel library for RDNA3 (gfx11) cards - nomic-embed-text-v2-moe (the nomicbert plugin) - Gemma 4 E2B with its per-layer MLP width, and Google's unmodified E2B/E4B directories in bf16 - DeepSeek-V4.1-Flash converted straight from its release: the Engram tables, the fused imatrix and rad-convert --chat-template for a release that ships no template - GGUF Q8_0, Q4_K and Q6_K tensors import as their planes; rad-convert writes them without a recipe - Qwen3.8-Flash-Next-FP8 converts and serves through qwen4exp_fp8 Speed: - hc_read's decode kernels as one grid (34.7 -> 25.2 us at 4 rows) and its tiled up-mix pipelined - gemm_fp8a8: the narrow form's scales staged through LDS (Flash-Next int8 at 32 rows 83.6 -> 68.3 us), the gated three-tile form at 8 waves (gate_up at 48 rows 272.9 -> 180.6 us) - Qwen3.8-27B: the delta net's out-projection read beside its decode recurrent update (x1 19.40 -> 19.10 ms a step), and the verify's split-KV attention sized by context depth (x3 at 180K 42.4 -> 40.3 ms a step) - Hy-Memory (HYV3) decode: fused QK norm, RoPE and KV store, residual adds folded into the norms, coalesced one-token expert GEMMs - spechub: the coupled verify walks the live candidates only (151 -> 31 us a launch) Speculation: - DFlash2: lossless coupled acceptance at T > 0 (--draft-coupling on) - A block drafter's proposals verified as a tree, on by default for the Gemma 4 31B's DFlash2, with a block-16 tree that runs its short block under load Features: - Decode-hot residency: --draft-expert-placement host, --expert-profile, --expert-pin-top, and --expert-stats FILE for the routed experts each layer selects - --ngram-placement ram=DIR: one n-gram table shared by engines on separate cards - Prefix cache: --prefix-resume exact (default) resumes a hit on the cold run's own chunk grid, so it answers bit-identically; snapshots at a head other prompts share, from 528-token prompts, and for tip-only one drafter window below the tip; hits on models whose KV groups have different block sizes; the snapshot store keeps a floor of 8 ahead of --host-headroom-mib - Typed tool-call argument tags; rad-chatparse --request renders and reads back one request as the server does - MiniMax-H3: keyframes ride a latent upscale - Gemma 3's fused all-reduce junction on the lossy wire Fixes: - A speculative step shorter than its band (an MTP step of 4 rows at gqa 8) no longer stops the engine with a scratch refusal at issue (#293) - --p2p off: prefill back to 1.12.0's rate; 1.13.0's push check read a host-memory slot over the link twice (#323) - A chat template that cannot render a conversation is refused at load, not mid-request - imatrix entries found under llama.cpp's spelling; the W4A8 prefill's tail scale read; the GDN conv kernels on an f32 weight; dense integer rows at the group they compute (a Q8_0 weight at group 32) - --expert-profile refuses a profile recorded on another model - hc_read's one-grid wait traps past its deadline instead of reading a stale value Changes: Plugin ABI 31, unchanged. RADIANCE_DRAFT_TREE, DFLASH2_TREE_NODES, DFLASH2_TREE_TEMP and DFLASH_Q_TEMP are gone (trees run where the probe says they pay; temperatures 1.25 / 0.6).
This commit is contained in:
1 parent
481fcd5df0
commit
4a61d7296b
160 files changed
+8790
-6819
No files matched your search
+30
-12
@@ -99,6 +99,8 @@ int rv_barrier(int world) {
|
||||
struct ArInst {
|
||||
int rank = 0, world = 0;
|
||||
long my_scratch = 0, my_flags = 0, my_seq = 0, locpack = 0;
|
||||
/* A 2-rank host-mailbox instance's VRAM mirror of its slots, 0 otherwise (r4d_ar_seq.h). */
|
||||
long my_stage = 0;
|
||||
long peer_scratch[R4D_MAX_PEERS] = { 0 };
|
||||
long peer_flags [R4D_MAX_PEERS] = { 0 };
|
||||
long slot_bytes = 0; /* per-slot capacity, 16-byte aligned */
|
||||
@@ -350,6 +352,17 @@ int build(ArInst* in, int rank, int world, long long max_numel, int dtype_code,
|
||||
}
|
||||
sq = r4d_ar_ipc_alloc(kSeqWords(maxb) * 4, 0, handle, &hlen));
|
||||
|
||||
/* A host mailbox is read over the link past every cache, so the 2-rank kernels' push check
|
||||
* copies what it reads into this VRAM mirror for the reduce, crossing the link once
|
||||
* (r4d_ar_seq.h). Coarse-grained: only this rank's kernels touch it, each block its own words.
|
||||
* The wide family has no push check and reads its slots once. Host-memory slots free the same
|
||||
* VRAM over P2P, so the mirror keeps the footprint where the P2P instance has it. */
|
||||
long stg = 0;
|
||||
if (host && world == 2) {
|
||||
R4D_TRY("ar_ipc_alloc(stage)",
|
||||
stg = r4d_ar_ipc_alloc((long)nslots * in->slot_bytes, 0, handle, &hlen));
|
||||
}
|
||||
|
||||
/* This rank's own packed copy, for the rotated 6-bit wire only: the reduce must fold exactly
|
||||
* the bytes it sent. The 6-bit payload is 3/8 of the bf16 message and the f32 scales 1/32 of
|
||||
* it, laid out from half the slot; a row padded to whole 512-element chunks
|
||||
@@ -365,6 +378,7 @@ int build(ArInst* in, int rank, int world, long long max_numel, int dtype_code,
|
||||
in->my_flags = fl;
|
||||
in->my_seq = sq;
|
||||
in->locpack = lp;
|
||||
in->my_stage = stg;
|
||||
in->gate_ctr = sq + 2L * maxb * 4; /* the word after the sequence counters (r4d_ar_seq.h) */
|
||||
|
||||
{
|
||||
@@ -475,6 +489,7 @@ void release(ArInst* in) {
|
||||
}
|
||||
r4d_ar_ipc_free(in->my_seq);
|
||||
r4d_ar_ipc_free(in->locpack);
|
||||
r4d_ar_ipc_free(in->my_stage);
|
||||
delete in;
|
||||
}
|
||||
|
||||
@@ -799,7 +814,7 @@ extern "C" int r4d_rad_ar_gather_2rank(const RadArgs* a, RadStream s) {
|
||||
r4d_ar_gather_2rank(in->peer_scratch[0], in->my_scratch, in->peer_flags[0], in->my_flags,
|
||||
in->my_seq, in->slot16, c.inp, c.out, c.numel, in->dtype, in->rank,
|
||||
(long)row, (long)(uintptr_t)s, c.nblocks, c.nthreads, c.drain,
|
||||
c.acq, (long)dpitch, (long)spitch));
|
||||
c.acq, (long)dpitch, (long)spitch, in->my_stage));
|
||||
return RAD_OK;
|
||||
}
|
||||
|
||||
@@ -869,7 +884,8 @@ extern "C" int r4d_rad_ar_oneshot_2rank_exact(const RadArgs* a, RadStream s) {
|
||||
r4d_ar_oneshot_2rank_exact(c.in->peer_scratch[0], c.in->my_scratch,
|
||||
c.in->peer_flags[0], c.in->my_flags, c.in->my_seq,
|
||||
c.in->slot16, c.inp, c.out, c.numel, c.in->dtype,
|
||||
(long)(uintptr_t)s, c.nblocks, c.nthreads, c.drain, c.acq));
|
||||
(long)(uintptr_t)s, c.nblocks, c.nthreads, c.drain, c.acq,
|
||||
c.in->my_stage));
|
||||
return RAD_OK;
|
||||
}
|
||||
|
||||
@@ -911,7 +927,8 @@ extern "C" int r4d_rad_ar_oneshot_2rank_wht6(const RadArgs* a, RadStream s) {
|
||||
r4d_ar_oneshot_2rank_exact(c.in->peer_scratch[0], c.in->my_scratch,
|
||||
c.in->peer_flags[0], c.in->my_flags, c.in->my_seq,
|
||||
c.in->slot16, c.inp, c.out, c.numel, c.in->dtype,
|
||||
(long)(uintptr_t)s, c.nblocks, c.nthreads, c.drain, c.acq));
|
||||
(long)(uintptr_t)s, c.nblocks, c.nthreads, c.drain, c.acq,
|
||||
c.in->my_stage));
|
||||
return RAD_OK;
|
||||
}
|
||||
|
||||
@@ -928,7 +945,8 @@ extern "C" int r4d_rad_ar_oneshot_2rank_wht6(const RadArgs* a, RadStream s) {
|
||||
c.in->peer_flags[0], c.in->my_flags, c.in->my_seq,
|
||||
c.in->locpack, c.in->slot_bytes, c.in->slot_bytes / 2,
|
||||
c.inp, c.out, c.numel, c.in->dtype,
|
||||
(long)(uintptr_t)s, c.nblocks, c.nthreads, c.drain, c.acq));
|
||||
(long)(uintptr_t)s, c.nblocks, c.nthreads, c.drain, c.acq,
|
||||
c.in->my_stage));
|
||||
return RAD_OK;
|
||||
}
|
||||
|
||||
@@ -1283,7 +1301,7 @@ extern "C" int r4d_rad_ar_ln_had_quant_i8(const RadArgs* a, RadStream s) {
|
||||
r4d_addr(q), r4d_addr(sc),
|
||||
(int)M, (int)K, (int)had, eps, wadd,
|
||||
(long)(uintptr_t)s, nblocks, nthreads, cfgv.drain, cfgv.acq,
|
||||
wire));
|
||||
wire, in->my_stage));
|
||||
return RAD_OK;
|
||||
}
|
||||
|
||||
@@ -1404,7 +1422,7 @@ static int rad_ar_rmsnorm_quant(const RadArgs* a, RadStream s, bool hi8) {
|
||||
r4d_addr(sc), (int)M, (int)K, eps, wadd, w_f32,
|
||||
(int)rp, (int)yp, (int)qp, (int)sp,
|
||||
(long)(uintptr_t)s, nblocks, nthreads, cfgv.drain, cfgv.acq, wire,
|
||||
in->locpack, in->slot_bytes / 2)
|
||||
in->locpack, in->slot_bytes / 2, in->my_stage)
|
||||
: r4d_ar_rmsnorm_quant_fp8(
|
||||
in->peer_scratch[0], in->my_scratch,
|
||||
in->peer_flags[0], in->my_flags, in->my_seq,
|
||||
@@ -1412,7 +1430,7 @@ static int rad_ar_rmsnorm_quant(const RadArgs* a, RadStream s, bool hi8) {
|
||||
r4d_addr(sc), (int)M, (int)K, eps, wadd, w_f32,
|
||||
(int)rp, (int)yp, (int)qp, (int)sp,
|
||||
(long)(uintptr_t)s, nblocks, nthreads, cfgv.drain, cfgv.acq, wire,
|
||||
in->locpack, in->slot_bytes / 2, wpo ? r4d_addr(wpo) : 0);
|
||||
in->locpack, in->slot_bytes / 2, wpo ? r4d_addr(wpo) : 0, in->my_stage);
|
||||
return e == 0 ? RAD_OK : RAD_E_SHAPE;
|
||||
}
|
||||
|
||||
@@ -1491,7 +1509,7 @@ extern "C" int r4d_rad_ar_rmsnorm_quant_i8(const RadArgs* a, RadStream s) {
|
||||
v.sl ? (v.sl->dtype == RAD_F32) : 0, r4d_addr(v.ob), r4d_addr(v.q), r4d_addr(v.sc), (int)M,
|
||||
(int)K, (float)r4d_getf(a, "eps", 1e-6), (float)r4d_getf(a, "wadd", 0.0),
|
||||
v.w->dtype == RAD_F32, (int)v.rp, (int)v.yp, (long)(uintptr_t)s, nblocks, cfgv.drain,
|
||||
cfgv.acq);
|
||||
cfgv.acq, in->my_stage);
|
||||
return e == 0 ? RAD_OK : RAD_E_SHAPE;
|
||||
}
|
||||
|
||||
@@ -1672,7 +1690,7 @@ extern "C" int r4d_rad_ar_gather_hc_write(const RadArgs* a, RadStream s) {
|
||||
r4d_addr(ew), r4d_addr(so), sh ? r4d_addr(sh) : 0L, sh ? r4d_addr(sg) : 0L,
|
||||
(long)ye_ld, (long)ew_ld, (long)sh_ld, (long)sg_ld, (long)top_k, (long)sig,
|
||||
(long)(uintptr_t)s, nblocks, R4D_AR_WHT6_FUSED_THREADS, cfgv.drain, cfgv.acq,
|
||||
early, early ? in->gate_ctr : 0L);
|
||||
early, early ? in->gate_ctr : 0L, in->my_stage);
|
||||
if (rc != 0) return RAD_E_SHAPE;
|
||||
return early ? RAD_LINK_ENDED : RAD_OK;
|
||||
}
|
||||
@@ -1687,7 +1705,7 @@ extern "C" int r4d_rad_ar_gather_hc_write(const RadArgs* a, RadStream s) {
|
||||
sh ? r4d_addr(sh) : 0L, sh ? r4d_addr(sg) : 0L, (long)ye_ld, (long)ew_ld, (long)sh_ld,
|
||||
(long)sg_ld, (long)top_k, (long)sig, (long)(uintptr_t)s, nblocks, cfgv.nthreads,
|
||||
cfgv.drain, cfgv.acq, has_inv ? (long)(uintptr_t)a->scratch : 0L, early,
|
||||
early ? in->gate_ctr : 0L);
|
||||
early ? in->gate_ctr : 0L, in->my_stage);
|
||||
if (rc != 0) return RAD_E_SHAPE;
|
||||
return early ? RAD_LINK_ENDED : RAD_OK;
|
||||
}
|
||||
@@ -1803,7 +1821,7 @@ extern "C" int r4d_rad_ar_hc_write(const RadArgs* a, RadStream s) {
|
||||
in->locpack, in->slot_bytes, in->slot_bytes / 2, r4d_addr(y), r4d_addr(inj),
|
||||
r4d_addr(h), (long)M, (long)n, (long)hc, (long)irow, (long)hrow, 0L, 0L, 0L, 0L, 0L,
|
||||
0L, 0L, 0L, 0L, 0L, 0L, (long)(uintptr_t)s, nblocks, R4D_AR_WHT6_FUSED_THREADS,
|
||||
cfgv.drain, cfgv.acq, early, early ? in->gate_ctr : 0L);
|
||||
cfgv.drain, cfgv.acq, early, early ? in->gate_ctr : 0L, in->my_stage);
|
||||
if (rc != 0) return RAD_E_SHAPE;
|
||||
return early ? RAD_LINK_ENDED : RAD_OK;
|
||||
}
|
||||
@@ -1816,7 +1834,7 @@ extern "C" int r4d_rad_ar_hc_write(const RadArgs* a, RadStream s) {
|
||||
in->my_seq, in->slot16, r4d_addr(y), r4d_addr(inj), r4d_addr(h),
|
||||
(long)M, (long)n, (long)hc, (long)irow, (long)hrow, (long)(uintptr_t)s,
|
||||
nblocks, cfgv.nthreads, cfgv.drain, cfgv.acq, early,
|
||||
early ? in->gate_ctr : 0L));
|
||||
early ? in->gate_ctr : 0L, in->my_stage));
|
||||
return early ? RAD_LINK_ENDED : RAD_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user