Archived
arch, data/recipes, deploy: Sage-A1.5's routed trunk with its vision tower, and DFlash2 in place of the MTP head
Sage-A1.5 (InternScience) is Qwen3.5-MoE's routed trunk with the Qwen3.5 vision tower beside it -- a shape qwen35moe_fp8 already declares, but no fixture covered the two together: the MoE fixture had no tower, the VL fixture was dense. arch_test gains q35moe_vl_meta, and checks the tower declares once for the build (not a copy a rank), that it is withheld when no encoder budget is given, and that the routed blocks, the folded shared expert and the MTP layer's own router are still declared beside it. sage-a1.5-fp8.recipe puts every trunk linear -- attention, the delta net's in- and out-projections, the routed and shared experts of all 40 blocks, and the MTP layer at index 40 -- into block fp8, the head likewise, and keeps the routers, the shared-expert gates, the delta net's parameters, the norms, the embedding and the whole vision tower as the checkpoint ships them. recipe_test reads the shipped file and asserts all of that. sage-a1.5-fp8-df2.recipe is the same trunk with incoai/Qwen3.6-35B-A3B-DFlash2's tensors in place of the MTP head, which the shared source declares through declare_dflash2. On two R9700s it decodes 392.9 tok/s against 281.6 with the MTP head, at 49.3% acceptance and depth 7; on one card, 231.6 against 168.3. Compose: sage-a1.5.yaml (two cards, four 32k sessions), sage-a1.5-tp1.yaml (one card, an 8 GiB pinned host pool, one 262,144-token session) and sage-a1.5-df2.yaml. README, DOCKER.md and ARCHITECTURES.md list the containers and the drafter.
This commit is contained in:
1 parent
c4a47673f2
commit
ef219c2192
10 files changed
+264
No files matched your search
@@ -0,0 +1,38 @@
|
||||
# sage-a1.5-fp8-df2.recipe -- Sage-A1.5 with incoai's Qwen3.6-35B-A3B DFlash2 drafter merged in
|
||||
# place of the MTP head. The trunk rules are sage-a1.5-fp8.recipe's unchanged; the drafter's
|
||||
# linears take the same 128x128 block form as the trunk, and its draft head is the target's
|
||||
# lm_head as the 2-bit copy the draft rounds read.
|
||||
#
|
||||
# rad-convert InternScience/Sage-A1.5-FP8 \
|
||||
# --draft-model incoai/Qwen3.6-35B-A3B-DFlash2 \
|
||||
# --recipe data/recipes/sage-a1.5-fp8-df2.recipe -o sage-a1.5-fp8-df2.rad
|
||||
#
|
||||
# The drafter is a DFlash2DraftModel: six Qwen3-shaped layers at 2048, eight taps
|
||||
# (target_layer_ids 1 6 11 16 22 27 32 37), block 8, selector rank 256 / top 16, vocab 248320.
|
||||
# Sage's text_config is Qwen3.6-35B-A3B's key for key, so the drafter's geometry matches the
|
||||
# trunk it was trained against. qwen35moe_fp8 (qwen35_fp8.cpp with QWEN35_MOE=1) declares it and
|
||||
# drops the MTP head, which is then neither declared nor carried.
|
||||
#
|
||||
# The drafter's norms, the selector's projection and codebooks, and the convolution kernels and
|
||||
# bases stay bf16/f32 as the checkpoint holds them.
|
||||
|
||||
blk.*.attn_qg.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
||||
blk.*.attn_k.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
||||
blk.*.attn_v.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
||||
blk.*.attn_output.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
||||
blk.*.ssm_inz.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
||||
blk.*.ssm_out.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
||||
blk.*.ffn_gate_up_exps.*.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
||||
blk.*.ffn_down_exps.*.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
||||
blk.*.ffn_gate_up_shexp.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
||||
blk.*.ffn_down_shexp.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
||||
output.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
||||
|
||||
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
|
||||
dflash.draft_head.weight rtn codes=u2 zero=u8 group=128 scale=f16
|
||||
@@ -0,0 +1,39 @@
|
||||
# sage-a1.5-fp8.recipe -- Sage-A1.5, InternScience's post-train of Qwen3.5-35B-A3B-VL, as the
|
||||
# qwen35moe_fp8 plugin serves it (256 experts of 512, top 8, a routed MTP head, the Qwen3.5
|
||||
# vision tower).
|
||||
#
|
||||
# rad-convert InternScience/Sage-A1.5-FP8 --recipe data/recipes/sage-a1.5-fp8.recipe \
|
||||
# -o sage-a1.5-fp8.rad
|
||||
#
|
||||
# The published FP8 release is compressed-tensors with one scale an output row, and it leaves
|
||||
# the vision tower, the routers and the whole MTP head bf16. The engine's expert kernels read
|
||||
# block-scaled fp8 only (a scale a 128x128 block) and its plugin refuses bf16 experts, so this
|
||||
# re-expresses every linear into Qwen's own block form, the same weights in the same form as
|
||||
# qwen3.6-35b-a3b-fp8.rad. From the bf16 release instead, the same recipe applies and the format
|
||||
# has to be stated too:
|
||||
#
|
||||
# rad-convert InternScience/Sage-A1.5 --recipe data/recipes/sage-a1.5-fp8.recipe \
|
||||
# --set quantization_config.quant_method=fp8 --set quantization_config.fmt=e4m3 \
|
||||
# --set "quantization_config.weight_block_size=128 128" \
|
||||
# --set quantization_config.activation_scheme=dynamic -o sage-a1.5-fp8.rad
|
||||
#
|
||||
# The linears -- attention q/gate, k, v and output, the delta net's qkv/z and output
|
||||
# projections, the routed and shared experts of all 40 blocks, and the MTP layer's, which the
|
||||
# blk.* patterns reach at its own index 40 -- as E4M3 with one bf16 scale a 128x128 block. The
|
||||
# lm_head likewise, and the MTP head's 2-bit copy of it, which the draft rounds read in place of
|
||||
# the full head. The routers, the shared-expert gates, the delta net's a/b projection, its conv
|
||||
# and decay parameters, the norms, the embedding and the vision tower stay as the checkpoint
|
||||
# holds them.
|
||||
|
||||
blk.*.attn_qg.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
||||
blk.*.attn_k.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
||||
blk.*.attn_v.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
||||
blk.*.attn_output.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
||||
blk.*.ssm_inz.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
||||
blk.*.ssm_out.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
||||
blk.*.ffn_gate_up_exps.*.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
||||
blk.*.ffn_down_exps.*.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
||||
blk.*.ffn_gate_up_shexp.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
||||
blk.*.ffn_down_shexp.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
||||
output.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
|
||||
mtp.draft_head.weight rtn codes=u2 zero=u8 group=128 scale=f16
|
||||
Reference in new issue
Block a user