# flint-iq8r.recipe -- Recursive Flint from its bf16 release with an IQ8R trunk and rotated int8 # experts, served by arch/flint (the same rotated int8 forms qwen35moe_w8a8 serves with # data/recipes/q36-35b-a3b-iq8r.recipe). # # rad-convert --add data/flint-zero-bias.safetensors \ # --recipe data/recipes/flint-iq8r.recipe \ # --chat-template data/flint-chat-template.jinja \ # -o flint-iq8r.rad # # - IQ8R: every trunk linear (attention q, k, v and output; the two dense layers' gate/up and # down; the shared expert's gate/up) as int8 codes in -127..127 with one u8 scale per # (row, 256 of K) under one bf16 scale a row, each 128 of K rotated by the unnormalised # Hadamard before rounding and the 1/128 kept in the row scale (`transform=fwht128`). Round to # nearest with a scale search; no calibration data is read. The norms, the gated products and # the attention output write the matching rotated int8 codes, so no linear quantises its own # input. # - The 256 routed experts of every layer as int8 on the same rotated grid with one bf16 scale # per (row, 128 of K). The grouped GEMM reads them at i8a8h (moe_gemm_i8a8): gate/up against # the block input's own rotated codes, down against the gated product's at one scale a 128. # - The shared expert's down projection on the experts' grid, its input written at one scale a # 128 by its gated product. # - The router, the norms, the sinks and the embedding stay bf16; the lm_head is int8 unrotated # with a bf16 scale per (row, 128) (logits_gemm_i8). # # About 38 GiB, as the int8 container measured on the 1.17-era build. Serve with --tp 2 (expert # parallel: each card holds 128 whole experts a layer). blk.*.attn_q.weight rtn codes=i8 group=256 scale=u8 scale2=bf16 block2=1x* transform=fwht128 clamp=sym rule=search blk.*.attn_k.weight rtn codes=i8 group=256 scale=u8 scale2=bf16 block2=1x* transform=fwht128 clamp=sym rule=search blk.*.attn_v.weight rtn codes=i8 group=256 scale=u8 scale2=bf16 block2=1x* transform=fwht128 clamp=sym rule=search blk.*.attn_output.weight rtn codes=i8 group=256 scale=u8 scale2=bf16 block2=1x* transform=fwht128 clamp=sym rule=search blk.0.ffn_gate_up.weight rtn codes=i8 group=256 scale=u8 scale2=bf16 block2=1x* transform=fwht128 clamp=sym rule=search blk.0.ffn_down.weight rtn codes=i8 group=256 scale=u8 scale2=bf16 block2=1x* transform=fwht128 clamp=sym rule=search blk.1.ffn_gate_up.weight rtn codes=i8 group=256 scale=u8 scale2=bf16 block2=1x* transform=fwht128 clamp=sym rule=search blk.1.ffn_down.weight rtn codes=i8 group=256 scale=u8 scale2=bf16 block2=1x* transform=fwht128 clamp=sym rule=search blk.*.ffn_gate_up_exps.*.weight rtn codes=i8 group=128 scale=bf16 transform=fwht128 clamp=sym rule=search blk.*.ffn_down_exps.*.weight rtn codes=i8 group=128 scale=bf16 transform=fwht128 clamp=sym rule=search blk.*.ffn_gate_up_shexp.weight rtn codes=i8 group=256 scale=u8 scale2=bf16 block2=1x* transform=fwht128 clamp=sym rule=search blk.*.ffn_down_shexp.weight rtn codes=i8 group=128 scale=bf16 transform=fwht128 clamp=sym rule=search output.weight rtn codes=i8 group=128 scale=bf16 clamp=sym rule=search