From 17d004d0d032776325468962d53ddd55c4eb66b1 Mon Sep 17 00:00:00 2001 From: Juup Date: Thu, 22 Oct 2026 07:54:30 +0000 Subject: [PATCH] data/recipes, deploy: Sage-A1.5 MXFP4 with DFlash2 The trunk linears, the routed and shared experts, and the DFlash2 linears round to OCP-MXFP4 (fp4_e2m1, one e8m0 scale per 32 of K); output.weight stays block FP8 and the draft head its 2-bit copy. 19.52 GiB against the block-FP8 sibling's 34.45, served at 25.8 GiB of VRAM a card on tp2. --- data/recipes/sage-a1.5-mxfp4-df2.recipe | 35 +++++++++++++++++++++++++ deploy/compose/sage-a1.5-mxfp4-df2.yaml | 21 +++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 data/recipes/sage-a1.5-mxfp4-df2.recipe create mode 100644 deploy/compose/sage-a1.5-mxfp4-df2.yaml diff --git a/data/recipes/sage-a1.5-mxfp4-df2.recipe b/data/recipes/sage-a1.5-mxfp4-df2.recipe new file mode 100644 index 00000000..a59d8011 --- /dev/null +++ b/data/recipes/sage-a1.5-mxfp4-df2.recipe @@ -0,0 +1,35 @@ +# sage-a1.5-mxfp4-df2.recipe -- Sage-A1.5 at MXFP4 with incoai's Qwen3.6-35B-A3B DFlash2 drafter +# merged in place of the MTP head. The trunk and the drafter's linears are rounded to MXFP4 +# (`fp4_e2m1`, an e8m0 exponent per 32 of K, the OCP rule), everything else as the checkpoint holds +# it. Trained from bf16 ideally: the source here is Sage-A1.5-FP8's per-row FP8 release, which +# carries one rounding already, so this is a second quantisation of the same weights. +# +# rad-convert InternScience/Sage-A1.5-FP8 --draft-model incoai/Qwen3.6-35B-A3B-DFlash2 \ +# --recipe data/recipes/sage-a1.5-mxfp4-df2.recipe -o sage-a1.5-mxfp4-df2.rad +# +# The trunk's rule set is sage-a1.5-fp8.recipe's, with `codes=fp4_e2m1 group=32 scale=e8m0` in +# place of block fp8 (the OCP rule needs no second level: `mx` is the default for e8m0). The +# DFlash2 drafter uses the same rules as the trunk's linears, and its draft head stays the 2-bit +# copy. + +blk.*.attn_qg.weight rtn codes=fp4_e2m1 group=32 scale=e8m0 +blk.*.attn_k.weight rtn codes=fp4_e2m1 group=32 scale=e8m0 +blk.*.attn_v.weight rtn codes=fp4_e2m1 group=32 scale=e8m0 +blk.*.attn_output.weight rtn codes=fp4_e2m1 group=32 scale=e8m0 +blk.*.ssm_inz.weight rtn codes=fp4_e2m1 group=32 scale=e8m0 +blk.*.ssm_out.weight rtn codes=fp4_e2m1 group=32 scale=e8m0 +blk.*.ffn_gate_up_exps.*.weight rtn codes=fp4_e2m1 group=32 scale=e8m0 +blk.*.ffn_down_exps.*.weight rtn codes=fp4_e2m1 group=32 scale=e8m0 +blk.*.ffn_gate_up_shexp.weight rtn codes=fp4_e2m1 group=32 scale=e8m0 +blk.*.ffn_down_shexp.weight rtn codes=fp4_e2m1 group=32 scale=e8m0 + +output.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16 + +dflash.fc.weight rtn codes=fp4_e2m1 group=32 scale=e8m0 +dflash.blk.*.attn_q.weight rtn codes=fp4_e2m1 group=32 scale=e8m0 +dflash.blk.*.attn_k.weight rtn codes=fp4_e2m1 group=32 scale=e8m0 +dflash.blk.*.attn_v.weight rtn codes=fp4_e2m1 group=32 scale=e8m0 +dflash.blk.*.attn_output.weight rtn codes=fp4_e2m1 group=32 scale=e8m0 +dflash.blk.*.ffn_gate_up.weight rtn codes=fp4_e2m1 group=32 scale=e8m0 +dflash.blk.*.ffn_down.weight rtn codes=fp4_e2m1 group=32 scale=e8m0 +dflash.draft_head.weight rtn codes=u2 zero=u8 group=128 scale=f16 diff --git a/deploy/compose/sage-a1.5-mxfp4-df2.yaml b/deploy/compose/sage-a1.5-mxfp4-df2.yaml new file mode 100644 index 00000000..db62a6d8 --- /dev/null +++ b/deploy/compose/sage-a1.5-mxfp4-df2.yaml @@ -0,0 +1,21 @@ +# Sage-A1.5 with incoai's Qwen3.6-35B-A3B DFlash2 drafter in place of the MTP head, made by +# data/recipes/sage-a1.5-mxfp4-df2.recipe. The trunk linears, the routed and shared experts and the +# drafter's linears are OCP-MXFP4 (fp4_e2m1, one e8m0 scale per 32 of K); output.weight stays block +# FP8 and the draft head stays the 2-bit copy. The container is 19.52 GiB against 34.45 GiB for the +# block-FP8 sibling, and at tp2 it leaves ~8 GiB a card more VRAM for the cache (25.8 GiB against +# 33.8 GiB of weights+state a card). +# +# The profile below is the measured one on the deployment box: ten 262,144-token sessions, the whole +# expert plane in VRAM. Sampling is the model card's (temp 1.0, top_p 0.95, top_k 20, presence 1.5). +name: radiance-sage-a1.5-mxfp4-df2 +services: + radiance: + extends: { file: common.yaml, service: radiance } + container_name: radiance-sage-a1.5-mxfp4-df2 + command: > + --model /models/sage-a1.5-mxfp4-df2.rad + --host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env} + --tp 2 --max-num-seqs 10 --max-model-len 262144 --kv-cache-dtype fp8 + --gpu-headroom-mib 96 + --num-speculative-tokens auto --max-num-batched-tokens 2048 + --temp 1.0 --top-p 0.95 --top-k 20 --presence-penalty 1.5