Archived
qwen35_fp8: read the delta net's out-projection beside its decode recurrent update
At decode heights the recurrent update runs one workgroup per (sequence, head) and leaves the card's memory mostly idle. Each delta-net layer now reads its out-projection (the whole weight, 7.9 MB a rank in MXFP4) into the on-die cache there, on the second lane behind a join from lane 0, as prefetch_beside does beside the all-reduces. Up to four decode sequences and 32 rows; no read on a step that carries a prompt's rows, at one rank, or where the deployment turns weight prefetch off (RadBuildCtx::weight_prefetch_off: nothing is declared). Qwen3.8-27B MXFP4 + DFlash2 at tp 2 on 2x R9700, production flags, 1k context, hwgrid ms/step, median of five interleaved rounds, none -> whole projection: x1 19.40 -> 19.10 (-1.5 %), x2 20.93 -> 20.78 (-0.7 %), x4 24.26 -> 24.17 (-0.4 %), every round faster at each of the three; x8 25.22 -> 25.48 (+1.0 %, four rounds of five slower) -- hence the four-sequence ceiling; x16 (64 rows, no read) and 90k x4 unchanged. 4 MB reads as the whole. Against this main (one round): x1 19.40 -> 19.15, other cells within noise. Greedy output identical to the build without the read (300/300 tokens on two prompts, |dlogprob| 0). arch_test: qwen35_fp8_reads_the_delta_net_out_projection_beside_its_decode_update; the qwen35_fp8 step pins move (prg_pins.py). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
49ca5ff9c6
commit
a64c75eb34
3 files changed
+76
-3
No files matched your search
@@ -127,6 +127,11 @@ struct GdnFP8 {
|
||||
* the widest decode window the fold serves. */
|
||||
rad_op op_cr = 0;
|
||||
int64_t cr_rows = 0;
|
||||
/* Set by the architecture after declare: a `prefetch` of the out-projection's leading bytes
|
||||
* (decl_prefetch, rad_arch.h), issued on the second lane beside the decode recurrent update on
|
||||
* steps of up to pf_out_rows rows and pf_out_seqs sequences. 0 where none is declared. */
|
||||
rad_op op_pf_out = 0;
|
||||
int64_t pf_out_rows = 0, pf_out_seqs = 0;
|
||||
rad_op op_ar = 0, op_add = 0;
|
||||
/* The next block absorbs this block's closing all-reduce (see rad_block_attn_gated_fp8.h). */
|
||||
bool ar_out = false;
|
||||
@@ -481,6 +486,14 @@ inline void GdnFP8::step(RadCtx* c, const RadBatch* batch, bool own_ar,
|
||||
const int64_t PT = T - DT;
|
||||
const int64_t in_w = conv_dim + v_dim; /* w.in.x's declared row width */
|
||||
|
||||
/* The recurrent update at decode heights runs one workgroup per (sequence, head) and leaves the
|
||||
* card's memory mostly idle, so the out-projection's weight is read into the on-die cache
|
||||
* beside it, on the second lane behind a join from lane 0 (as prefetch_beside). */
|
||||
if (op_pf_out && D > 0 && D <= pf_out_seqs && P == 0 && T <= pf_out_rows) {
|
||||
if (rad_lane_join(c, 0, 1) == RAD_OK && rad_lane(c, 1) == RAD_OK)
|
||||
RAD_ISSUE(c, op_pf_out, RAD_W(out.w));
|
||||
rad_lane(c, 0);
|
||||
}
|
||||
if (D > 0 && op_cr && qd <= cr_rows) {
|
||||
RAD_ISSUE_N(c, op_cr, qd,
|
||||
bcol(w.in.x, 0, conv_dim, DT), RAD_W(w_conv), RAD_NONE, kv_cache(kv_conv, layer),
|
||||
|
||||
Reference in new issue
Block a user