radiance 1.2.0

- MXFP4 weights: block-fp8 Qwen3.5/3.6/3.8 dense models serve OCP-MXFP4 linears (e2m1, an E8M0
  exponent per 32) at 4-bit weights against E4M3 activations. New libr4d rows: the decode GEMM
  (M <= 128, split-K with a fused last-arriver reduction) and the prefill GEMM on a fragment-tiled
  activation. Qwen3.8-27B MXFP4 (AMD Quark AWQ) is in the model table.
- Cards without peer-to-peer access serve: every collective has a host-memory twin; --p2p
  auto|on|off.
- Stop strings apply to the answer, not to the reasoning block a reply starts in.
- A prefix hit ends one drafter window before the prompt's end, so a windowed block drafter
  (DFlash2) drafts from the first token of a follow-up turn.
This commit is contained in:
Deadcode committed 2026-10-06 21:36:24 +02:00
1 parent 7001841e45
commit e95d397288
47 files changed
+2611 -219

No files matched your search

+24
View File
@@ -321,6 +321,30 @@ struct GemmOps {
long long M, N, K;
};
/* THE MXFP4 GEMMS' ACTIVATION SCALE GRID, read off the operand rather than assumed. One f32 a row
* (`[M]` or `[M][1]`: a per-token quantiser) is group 0; one per (row, 128 of K) (`[M][ceil(K/128)]`:
* the block-scaled fp8 family's quantisers, which every fused producer in arch/common writes) is
* group 128, read at the operand's own row stride. Anything else is refused by shape: a grid read
* at the wrong width is an answer that is merely wrong. */
static inline int mx_ascale_grid(const GemmOps& g, int* group, int* rs) {
const RadTensor* s = g.ascale;
if (!s || g.M <= 0) return R4D_NO(RAD_E_INVAL);
long long cols = 1, rstride = 1;
if (s->rank >= 2) {
cols = s->shape[s->rank - 1];
rstride = s->stride[s->rank - 2];
if (s->shape[s->rank - 2] < g.M) return R4D_NO(RAD_E_SHAPE);
} else if (s->rank == 1) {
if (s->shape[0] < g.M) return R4D_NO(RAD_E_SHAPE);
cols = s->shape[0] / g.M;
rstride = cols;
}
const long long kb = (g.K + 127) / 128;
if (cols == 1 && (s->rank < 2 || rstride == 1)) { *group = 0; *rs = 1; return RAD_OK; }
if (cols == kb && rstride >= kb) { *group = 128; *rs = (int)rstride; return RAD_OK; }
return R4D_NO(RAD_E_SHAPE);
}
/* Common shape and layout checks. A is [M,K] row-major, C is [M,N] row-major and the weight is
* an opaque packed blob whose element count the layout hook owns -- so the weight's SHAPE is not
* checked here beyond being present, which is deliberate: the byte count that matters is the one