Archived
radiance 1.15.0
New models and formats: - IQR for Qwen3.8-27B: weights on the int8 grid under GPTQ, a trellis down each GPTQ column (IQR-V2), and IQR-V3, a computed trellis code under one scale a row, kept at its codes' width in VRAM and decoded in the GEMM; 15 IQR-V3 recipes from ~2 to ~7 bits a weight (data/recipes/q38-27b-*-v3.recipe, docs/IQR.md) - libhalo: a kernel library for Strix Halo (gfx1151), preferred there over libr3d - Nemotron 3.5 Embed 1B and 8B (nemotron35_embed): text and image embeddings through a Pixtral tower, on the card and on the CPU - Nemotron 3.5 Rerank 8B - /v1/systemone: Cloudflare's clef and clef-flash, Convai Innovations' Laya and Mica beside LiquidAI d1; scored steps read the candidates' logits from the head table with no lm_head pass - LFM2's 8-bit trunk: block-fp8 or int8 linears with the fused producers, and the d1-3B recipe - DeepSeek-V4.1's reply format with DSML tool calls and typed argument tags Weights on the drive: - The file tier reads only the experts the pass routes rows to; the draft head's weights stay in the host pool - A hot VRAM cache for routed experts read off the drive, reads deposited straight into free host pool slots, and copyless evictions; the file tier's counters are now ssd_* - GLM-5 Next shards its routed experts by expert, not by width, so they can live on the drive - The stall watch counts drive reads as progress, and the DMA lane's room check reads the lane's own completion fence Quantisation tooling: - --calib-corpus, --calib-dir and --calib-layers record each linear's input Hessian; beside --kld-record the reference's own run records them - --kld-top N records a sparse KL reference (the N most likely tokens and the tail's mass) - GPTQ in a third of the time with the same codes, trellis GPTQ on the card, vector codebooks with coordinate descent, and rad-convert --reuse repeated, each container supplying what the earlier ones lack Speculation: - Prompt lookup alone (--spec-ngram K, --spec-ngram-min/-max): each sequence keeps an index of its n-grams, and a proposal is verified only when its measured step cost says it pays; --draft-window adaptive follows it Speed: - IQR decode: the narrow tile splits K for four times the int8 tile's waves and folds each 128-K block once; at 8 tokens down and the output projections run in 0.61-0.82x and 0.70-0.92x FP8's time (2-6 bits); IQ6R-S-V3 with its DFlash2 drafter steps in 26.3 ms at TP2, against 29.4 ms before and FP8's 27.3 - Qwen MXFP4 feed-forward: the gated fold up to 16 rows, not 8 - libr4d: the gated prefill fold, the short-prompt split row, and the rows forms of rmsnorm and rope; KLATE again for the head-256 gqa6 paged prefill; gram_accum on the matrix cores Features: - /health, /v1/health and /ping answer 503 with "status": "stuck" once the device has advanced nothing for a minute or a queue has faulted, so a supervisor can restart a wedged server (#356) - --image-gen-max-pixels and --image-gen-max-refs size an image generator's buffers (#344) - The startup report lists only the options not at their default, with a count; -v lists all (#250) - --preempt-wait-ms bounds how long a preempted prefill waits for its whole-recompute room - --placement layer_offload spills dense layers so one --max-model-len sequence fits - Startup refuses amdgpu with CWSR off and says how to fix it; --proceed-with-incompatible-configuration starts anyway under an UNSUPPORTED banner Fixes: - The n-gram read-ahead hands each row to the reader once and reads only as far ahead as the row cache holds, and pauses while decode reads: about one drive read a row instead of two (#355) - A file-tier window reads each of its runs once, not once a run per run - The decode split law's verify floor is bounded by the batch's workgroups: max_seqs 256 no longer declares 64x the scratch (#342) - A prefetch DMA list's mark stays out of the signal pool until the engine has read it, and a prefill stage copies only the blocks its own tables name (#343) - The split-KV row sum is read with fetch-inactive (#328) - LFM2 on the host backend: libref and libavx serve the row-form ops it declares (#348) - The preempted-prefill gate skips a KV group that holds no blocks (#352) - Every request entry point bounded, gated and sanitised (JSON depth, invalid UTF-8, control bytes in the log, the dashboard's CSP, cross-origin browsers on the loopback-only routes); a prompt id outside the vocabulary refused at admission; --api-key "" refused at startup - The telemetry the HTTP thread reads is atomic - An RMS norm row no longer depends on how many rows its launch carries; prefill attention's rescale is decided by live rows only - A --kld-record prefill chunk that finishes no sequence gets its logits on a tied-head model - A kernel's lazily made counter block is zeroed outside the lock other ranks take (a TP2 first-step hang) Changes: Plugin ABI 32. Every plugin exports a layout fingerprint of the ABI structs and the loader refuses a plugin without it or with another (#302), so out-of-tree plugins must be rebuilt. Appended: RadBuildCtx calib_* and gen_max_*, RadArchProbe gen_max_*, RadBatch score_only and plugin_words, RadDeviceProps::unified, RadChatFormat arg_json_value_prefix.
This commit is contained in:
commit
9ed3ef7a7b
452 files changed
+167762
-1346
No files matched your search
@@ -77,6 +77,17 @@ __device__ __forceinline__ float block_sum(float v, float* lds) {
|
||||
return s;
|
||||
}
|
||||
|
||||
// A row's sum of squares in the standalone norm's partition (kR4dSumLanes, r4d_common.h): lane
|
||||
// v < 256 adds columns v, v + 256, ... of `row` in order and the lanes past it add nothing, so a
|
||||
// row's bits do not depend on the block's width. When the block's threads stored `row`, the
|
||||
// caller issues the barrier first, as add_rmsnorm does.
|
||||
__device__ __forceinline__ float lanes_sumsq(const uint16_t* row, uint32_t n) {
|
||||
float ss = 0.0f;
|
||||
if (threadIdx.x < kR4dSumLanes)
|
||||
for (uint32_t i = threadIdx.x; i < n; i += kR4dSumLanes) { const float v = bf2f(row[i]); ss += v * v; }
|
||||
return ss;
|
||||
}
|
||||
|
||||
// Quantise one 128-column group from the four bf16-rounded values a lane owns. The clamp in
|
||||
// q8_pack4 is required (see r4d_q8.h): v_cvt_pk_fp8_f32 returns NaN out of range, and
|
||||
// `amax * (1/scale)` can land an ulp above 448.
|
||||
@@ -155,8 +166,9 @@ __global__ __launch_bounds__(THR) void rmsnorm_quant_fp8_kernel(
|
||||
const uint16_t* __restrict__ nr = RES ? rr : xr;
|
||||
|
||||
// Four strides are loaded before any is used, avoiding one round trip per stride. A stride past
|
||||
// the row reloads this thread's first column and is skipped below. The summation order is still
|
||||
// that of `i = tid; i += THR`, shared by every kernel using r4d_act_threads' partition.
|
||||
// the row reloads this thread's first column and is skipped below. At 256 threads the sum is
|
||||
// folded in that loop, whose order is kR4dSumLanes' partition; a wider block folds the stored
|
||||
// row in lanes_sumsq behind a barrier.
|
||||
constexpr uint32_t kU = 4;
|
||||
float ss = 0.0f;
|
||||
for (uint32_t i0 = threadIdx.x; i0 < n; i0 += kU * THR) {
|
||||
@@ -179,10 +191,15 @@ __global__ __launch_bounds__(THR) void rmsnorm_quant_fp8_kernel(
|
||||
} else {
|
||||
v = bf2f(xa[u]);
|
||||
}
|
||||
ss += v * v;
|
||||
if constexpr (THR == kR4dSumLanes) ss += v * v;
|
||||
else (void)v;
|
||||
}
|
||||
}
|
||||
}
|
||||
if constexpr (THR != kR4dSumLanes) {
|
||||
if (RES) __syncthreads(); // the residual row, stored across the block's threads
|
||||
ss = lanes_sumsq(nr, n);
|
||||
}
|
||||
const float rs = rsqrtf(block_sum<THR / kWave>(ss, lds) / (float)n + eps);
|
||||
|
||||
norm_quant_row<WF32, THR, HI8>(nr, w, y ? y + (size_t)row * y_ld : nullptr,
|
||||
@@ -307,7 +324,7 @@ __global__ __launch_bounds__(1024) void gate_quant_fp8_kernel(
|
||||
// Bit-identical to the pair it replaces. Pass two is norm_quant_row. Pass one reproduces the
|
||||
// all-reduce's arithmetic (an f32 sum stored as bf16, as in r4d_ar_oneshot_2rank_exact's vadd) and
|
||||
// stores it back into `x`, as the replaced kernel did, so other readers of `x` see the same bytes.
|
||||
// Both sum the squares in r4d_act_threads' `i = tid; i += THR` order.
|
||||
// Both sum the squares in the standalone norm's partition (lanes_sumsq).
|
||||
//
|
||||
// Both wires are served. Above --tp-wire-min-kb the message is sent 6-bit rotated; a step carries
|
||||
// n_seq * (1 + n_spec) rows, so it crosses that floor from the second concurrent sequence on, and
|
||||
@@ -664,9 +681,9 @@ __global__ __launch_bounds__(THR) void ar_rmsnorm_quant_fp8_kernel(
|
||||
uint16_t a;
|
||||
if constexpr (WIRE == 0) { a = f2bf(bf2f(xr[i]) + bf2f(pr[i])); xr[i] = a; }
|
||||
else { a = xr[i]; }
|
||||
const float av = bf2f(a);
|
||||
s1s += av * av;
|
||||
if constexpr (THR == kR4dSumLanes) { const float av = bf2f(a); s1s += av * av; }
|
||||
}
|
||||
if constexpr (THR != kR4dSumLanes) { __syncthreads(); s1s = lanes_sumsq(xr, n); }
|
||||
const float s1 = rsqrtf(block_sum<THR / kWave>(s1s, lds) / (float)n + eps);
|
||||
__syncthreads(); // lds is reused by the second sum
|
||||
for (uint32_t i = tid; i < n; i += THR) {
|
||||
@@ -674,8 +691,7 @@ __global__ __launch_bounds__(THR) void ar_rmsnorm_quant_fp8_kernel(
|
||||
const uint16_t pv = f2bf(bf2f(xr[i]) * s1 * (g + wadd));
|
||||
const uint16_t h = f2bf(bf2f(rr[i]) + bf2f(pv));
|
||||
rr[i] = h;
|
||||
const float v = bf2f(h);
|
||||
ss += v * v;
|
||||
if constexpr (THR == kR4dSumLanes) { const float v = bf2f(h); ss += v * v; }
|
||||
}
|
||||
} else
|
||||
for (uint32_t i = tid; i < n; i += THR) {
|
||||
@@ -687,8 +703,10 @@ __global__ __launch_bounds__(THR) void ar_rmsnorm_quant_fp8_kernel(
|
||||
float v;
|
||||
if (RES) { const uint16_t h = f2bf(bf2f(rr[i]) + bf2f(a)); rr[i] = h; v = bf2f(h); }
|
||||
else { v = bf2f(a); }
|
||||
ss += v * v;
|
||||
if constexpr (THR == kR4dSumLanes) ss += v * v;
|
||||
else (void)v;
|
||||
}
|
||||
if constexpr (THR != kR4dSumLanes) { __syncthreads(); ss = lanes_sumsq(nr, n); }
|
||||
/* block_sum's barrier is also what publishes pass one's stores to pass two's reads. */
|
||||
const float rs = rsqrtf(block_sum<THR / kWave>(ss, lds) / (float)n + eps);
|
||||
norm_quant_row<WF32, THR, HI8>(nr, w, y ? y + (size_t)row * y_ld : nullptr,
|
||||
@@ -734,10 +752,8 @@ static int rmsnorm_quant_launch(long x, long res, long w, long y, long q, long s
|
||||
if (!s_ld) s_ld = nkb;
|
||||
|
||||
// One workgroup per row, so a decode batch is 8-72 workgroups and the kernel is latency bound;
|
||||
// the workgroup width is the parallelism knob (crossover table in r4d_act_threads).
|
||||
//
|
||||
// rmsnorm_bf16 must pick the same width from the same function: the width decides which
|
||||
// columns a thread sums, so a different width changes the last bits and breaks bit identity.
|
||||
// the workgroup width is the parallelism knob (crossover table in r4d_act_threads). The sum of
|
||||
// squares is folded in kR4dSumLanes' partition at every width, as rmsnorm_bf16 folds it.
|
||||
const int thr = r4d_act_threads(M, n);
|
||||
#define R4D_RQ_H(wf, rs, T, H) \
|
||||
hipLaunchKernelGGL((rmsnorm_quant_fp8_kernel<wf, rs, T, H>), dim3((uint32_t)M), dim3(T), 0, \
|
||||
@@ -934,7 +950,7 @@ static int ar_rmsnorm_quant_launch(long peer_scratch, long my_scratch, long peer
|
||||
if (nb > M) nb = M;
|
||||
const int nbw = r4d_ar_max_blocks(); // the counter capacity; see r4d_ar_seq.h
|
||||
if (nb > nbw) nb = nbw;
|
||||
// The width must be r4d_act_threads', as for the standalone norm (it fixes the summation order).
|
||||
// The standalone norm's width; the sums fold in kR4dSumLanes' partition at any of the three.
|
||||
const int thr = nthreads ? nthreads : r4d_act_threads(M, n);
|
||||
if (thr != 256 && thr != 512 && thr != 1024) return -6;
|
||||
const bool pad = wire == 6 && (n % ARQ_CE) != 0;
|
||||
|
||||
Reference in new issue
Block a user