Archived
The drafter's head was `gemm_nt` over the target's bf16 table -- 352 MiB a rank at tp 4, every draft
pass, 566 us of a 26B-A4B decode step under --profile-ops on 4x R9700: the widest read on the draft
path, and the "first thing to change once the model runs" its own comment named.
A container may now hold the table a second time as `dflash.draft_head.weight`, block fp8 -- one
checkpoint tensor, two logical weights, as rad_block_dflash2.h does it -- made by the recipe line
dflash.draft_head.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
which the three gemma4-26b-a4b -df recipes now carry. Where the copy is there, the head is
quant_act_fp8 over the gathered rows and gemm_nt_q over the copy at fp8a8: half the bytes, for 176
MiB a rank more. The copy is row-sharded exactly as the table, so a rank's rows are the same
vocabulary slice and row_topk's vocab_off, the all_gather and pair_argmax are unchanged. Drafts are
verified, so the coarser logits change what is proposed and never what is accepted --
draft_n_accepted says whether they propose worse; there is no rerank against the bf16 table yet.
Where the copy is not there -- every container converted before this, or one whose recipe made it
something other than block fp8 -- the head reads the bf16 table exactly as before. The decision is
the stored encoding's (weight_enc on the copy's name), and the copy's name map entry alone writes
nothing: rad-convert walks the declared weights. The startup note names the head in use. The
block-fp8 test moves to one helper, which the routed experts' encoding check now uses too.
arch_test: with the copy's encoding block fp8, the copy is declared and the head is gemm_nt_q over
it from the quantised rows; without, nothing is declared and the head is gemm_nt over the table;
a draft pass issues the head once either way. ARCHITECTURES.md says so.
Not yet run on the cards; it needs a container converted with the new recipe line.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
1.6 KiB
Plaintext
24 lines
1.6 KiB
Plaintext
# gemma4-26b-a4b-df-bf16x.recipe -- gemma-4-26B-A4B-it with z-lab's DFlash drafter and the routed
|
|
# experts left bf16, as arch/gemma4 serves it.
|
|
#
|
|
# rad-convert <gemma-4-26B-A4B-it checkpoint> --draft-model <gemma-4-26B-A4B-it-DFlash checkpoint> \
|
|
# --recipe data/recipes/gemma4-26b-a4b-df-bf16x.recipe -o gemma4-26b-a4b-df-bf16x.rad
|
|
#
|
|
# The trunk exactly as the checkpoint holds it -- the bf16 reference the fp8-expert containers are
|
|
# measured against (radiance --kld-record) -- with only the drafter quantised.
|
|
|
|
# The DFlash drafter's six linears: block fp8 (the drafter only proposes; the trunk verifies).
|
|
dflash.fc.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
|
dflash.blk.*.attn_q.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
|
dflash.blk.*.attn_k.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
|
dflash.blk.*.attn_v.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
|
dflash.blk.*.attn_output.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
|
dflash.blk.*.ffn_gate_up.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
|
dflash.blk.*.ffn_down.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
|
|
|
# The drafter's head: the target's tied table again under a name of its own, block fp8, which the
|
|
# draft head reads instead of the bf16 table -- half the widest read on the draft path, for half
|
|
# the table's bytes again (176 MiB a rank at tp 4). Drafts are verified, so this changes what is
|
|
# proposed, never what is accepted.
|
|
dflash.draft_head.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|