From 2ac0d966b3f6115c18ffa73d8f02f022f17a5bcd Mon Sep 17 00:00:00 2001 From: eddie168168 Date: Sat, 17 Oct 2026 15:42:07 +0800 Subject: [PATCH] arch/common: the MLP's gated fold is an fp8a8 tile; an int8 gate_up takes the pair decl_gated_fold was declared for any gate_up that was not bf16, MXFP4 or rotated 5-bit, so an int8 one got an fp8a8 fold over int8 codes. Only a host kernel took the op, and placement then pinned every layer group's weights to the host. Co-Authored-By: Claude Opus 5.5 --- arch/common/rad_block_mlp_fp8.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/common/rad_block_mlp_fp8.h b/arch/common/rad_block_mlp_fp8.h index 18485a41..ddb5dfd9 100644 --- a/arch/common/rad_block_mlp_fp8.h +++ b/arch/common/rad_block_mlp_fp8.h @@ -98,9 +98,10 @@ inline int MlpFP8::declare(RadBuilder* b, Names& nm, const Geom& geom, int l, co RAD_ARCH_TRY(down.probe(b, nm, g, down_base, { src.down })); RAD_ARCH_TRY(gq_ffn.declare(b, g, w.gate_up, w.ffn, g.n_ff, "silu", 0, down.reads_x)); - /* The fold (decl_gated_fold), an fp8a8 tile, so bf16, MXFP4, rotated 5-bit and 4-bit gate_up - * weights take the pair. */ - if (!gate_up.bf16 && !gate_up.mx && !gate_up.paro5 && !gate_up.w4) + /* The fold (decl_gated_fold), an fp8a8 tile, so bf16, MXFP4, rotated 5-bit, 4-bit and int8 + * gate_up weights take the pair. Declared over int8 codes, only a host kernel would take it, + * and that would pin the layer's weights to the host. */ + if (!gate_up.bf16 && !gate_up.mx && !gate_up.paro5 && !gate_up.w4 && !gate_up.i8) op_gated = decl_gated_fold(b, g.max_tok, gate_up.N, gate_up.K, gate_up.w, gate_up.ws, { w.h.q, w.h.s }, gq_ffn.want_x