Archived
libr4d: logits_gemm_bf16_cols -- the bf16 head without a block per column at n_embd 4096
logits_gemm_bf16 runs a 256-thread block per vocabulary column. At n_embd 4096 a thread makes two 16-byte weight loads before the block-wide sum, and each row widens both operands for its own product: GLM-5.3's TP8 slice (19360 columns) took 303 us at six rows and 1133 at 24, where a verify pass of eight streams lands, against 235 at one. The new row runs a wave per four columns: lane l takes, in turn, threads 32q + l of the old block for q = 0..7 -- the same 8-wide k chunks summed from 0 and added in k order, the same lane butterfly per q, the eight wave sums added in q order from 0 -- so each column gets the old row's bytes. bf16 widens to f32 exactly, so each weight is widened once for every row and each activation once for every column. It outranks the block row at n_embd 4096 only; the block row is unchanged and serves every other width. Measured at the TP8 slice (r4d_selftest --perflogits), us: rows 1 6 8 16 24 48 logits_gemm_bf16 239.1 303.2 378.2 741.4 1133.2 2354.5 ..._cols 235.5 247.5 250.4 404.5 635.6 1220.1 Two columns a wave and 16 rows a pass measured slower. r4d_selftest compares both rows byte for byte from one row to past one 8-row chunk, at a vocabulary off the column step and a pitched activation with a NaN and a signed zero. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1ff9abe2ba
commit
f909576d09
5 files changed
+245
No files matched your search
@@ -67,6 +67,9 @@ enum {
|
||||
* these rows' layout hooks refuse a bf16 head, and the bf16 row has no hook for a scaled
|
||||
* one. */
|
||||
R4D_PRIO_LOGITS_FP8 = 60,
|
||||
/* The bf16 head's column form, above the block-per-column row whose bytes it gives, at the
|
||||
* n_embd it is built for. */
|
||||
R4D_PRIO_LOGITS_COLS = 55,
|
||||
|
||||
/* Runtime LoRA: the tiled rows serve a subset of the scalar rows' dtypes at every M, so they
|
||||
* must outrank them to be reached; the scalar rows keep f16 / f32 activations (no exact WMMA)
|
||||
@@ -718,6 +721,7 @@ int r4d_rad_kv_store_fp8 (const RadArgs*, RadStream);
|
||||
int r4d_rad_kv_store_fp8v4 (const RadArgs*, RadStream);
|
||||
int r4d_rad_kv_store_k6v4 (const RadArgs*, RadStream);
|
||||
int r4d_rad_logits_gemm (const RadArgs*, RadStream);
|
||||
int r4d_rad_logits_gemm_cols(const RadArgs*, RadStream);
|
||||
|
||||
/* -- the decomposed sampler chain (r4d_sample_stages_f32.hip) --
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user