arch, data/recipes, libr4d: the 31B's prefill overlap, q|k|v as one linear, RedHatAI's DFlash2, its fc split

The 31B's prefill steps of 1024 rows or more run as two slices with each slice's all-reduces
beside the other's compute; q, k and v as one linear where the container holds them so; the 31B
serves RedHatAI's DFlash2 speculator; DFlash2's fc projection is split over the ranks, bit for bit.

Squashed from:

- arch/gemma4_bf16: a prefill step in two slices, each slice's reductions on the second lane
- arch/gemma4_bf16: q, k and v as one linear where the container holds them so
- data/recipes: the 31B -df recipes make q, k and v one linear (blk.*.attn_qkv)
- arch/gemma4: the 31B serves RedHatAI's DFlash2 speculator (gemma-4-31B-it-speculator.dflash2)
- libr4d: gemm_nt_q takes split_n, and all_gather lands rows at a wider output pitch
- arch/common: DFlash2's fc split over the ranks as windows of block-aligned rows, bit for bit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
AshlynandClaude Opus 5.5 authored and StillDeadcode committed 2026-10-21 09:48:20 +02:00
1 parent bdb37d5d16
commit 04e5480387
21 files changed
+1805 -199

No files matched your search

+4 -2
View File
@@ -309,7 +309,8 @@ void r4d_ar_wht6_dims(int* group, int* bits, int* chunk_elems); // rotated-6-bit
void r4d_ar_gather_2rank(long peer_scratch, long my_scratch, long peer_flags, long my_flags,
long seq_ctrs, long slot_stride16, long inp, long out, long n_elem,
long dtype, long rank, long row_elems, long stream, long nblocks,
long nthreads, long drain, long acq);
long nthreads, long drain, long acq, long dpitch,
long spitch);
// ---- all-reduce: one-shot, push, 4 or 8 ranks over P2P -------------------------------------
// The same algorithm at width (r4d_ar_oneshot_Nrank_exact.hip). Peer arguments are in ascending
@@ -343,7 +344,8 @@ void r4d_ar_gather_3rank(long peer_scratch0, long peer_scratch1, long peer_flags
long peer_flags1, long my_scratch, long my_flags, long seq_ctrs,
long slot_stride16, long inp, long out, long n_elem, long dtype,
long rank, long row_elems, long stream, long nblocks, long nthreads,
long drain, long acq, long pub);
long drain, long acq, long pub, long dpitch,
long spitch);
void r4d_ar_oneshot_8rank_exact(long peer_scratch0, long peer_scratch1, long peer_scratch2,
long peer_scratch3, long peer_scratch4, long peer_scratch5,
long peer_scratch6, long peer_flags0, long peer_flags1,