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
@@ -6055,6 +6055,26 @@ MetaKV q35moe_meta() {
|
||||
return k;
|
||||
}
|
||||
|
||||
/* The 35B-A3B-VL: the routed trunk with the Qwen3.5 vision tower beside it, as Sage-A1.5 and
|
||||
* Ornith-1.5 carry it. The fixture's trunk is q35fp8_meta's (5120 wide), so the tower emits
|
||||
* that width; the shipped checkpoints' tower is 2048, the real trunk's width. */
|
||||
MetaKV q35moe_vl_meta() {
|
||||
MetaKV k = q35moe_meta();
|
||||
k.set("vision_config.depth", "2")
|
||||
.set("vision_config.hidden_size", "1152")
|
||||
.set("vision_config.num_heads", "16")
|
||||
.set("vision_config.intermediate_size", "4304")
|
||||
.set("vision_config.patch_size", "16")
|
||||
.set("vision_config.temporal_patch_size", "2")
|
||||
.set("vision_config.in_channels", "3")
|
||||
.set("vision_config.spatial_merge_size", "2")
|
||||
.set("vision_config.out_hidden_size", "5120")
|
||||
.set("vision_config.num_position_embeddings", "2304")
|
||||
.set("vision_config.deepstack_visual_indexes", "")
|
||||
.set("vision_config.hidden_act", "gelu_pytorch_tanh");
|
||||
return k;
|
||||
}
|
||||
|
||||
/* A DFlash2 drafter merged under `draft.`: two layers reading trunk layers 1, 3 and 5, a block
|
||||
* of 8 (seven drafts), the selector of rank 64 over 8 candidates. */
|
||||
MetaKV with_dflash2(MetaKV k) {
|
||||
@@ -6701,6 +6721,46 @@ TEST(qwen35moe_fp8_steps_lint_clean_with_its_routed_mtp_head) {
|
||||
lint_qwen35_fp8_family(qwen35moe_fp8::declare, qwen35moe_fp8::step, mk.meta(), 3, false, 0);
|
||||
}
|
||||
|
||||
/* The 35B-A3B-VL: the routed trunk and the vision tower declare together, the tower once and
|
||||
* not a copy a rank, and the routed MTP head beside them -- Sage-A1.5's shape, which no fixture
|
||||
* covered before (the MoE fixture had no tower, the VL fixture was dense). */
|
||||
TEST(qwen35moe_fp8_declares_the_vision_tower_beside_the_routed_trunk) {
|
||||
MetaKV mk = q35moe_vl_meta();
|
||||
/* With no encoder budget the tower is not declared, whatever the container carries. */
|
||||
{
|
||||
RadBuilder b;
|
||||
RadBuildCtx ctx = vl_ctx(0);
|
||||
REQUIRE_EQ(qwen35moe_fp8::declare(&b, mk.meta(), &ctx), RAD_OK);
|
||||
CHECK(b.encoder_name.empty());
|
||||
CHECK(find_w(b, "v.patch.weight") == nullptr);
|
||||
CHECK_EQ(count_op(b, "router_topk"), 8);
|
||||
}
|
||||
RadBuilder b;
|
||||
RadBuildCtx ctx = vl_ctx(1024);
|
||||
ctx.max_spec = 3;
|
||||
REQUIRE_EQ(qwen35moe_fp8::declare(&b, mk.meta(), &ctx), RAD_OK);
|
||||
|
||||
CHECK_EQ(b.encoder_name, std::string("vision"));
|
||||
CHECK_EQ(b.encoder.modalities, (uint32_t)(RAD_MM_IMAGE | RAD_MM_VIDEO));
|
||||
CHECK_EQ(b.encoder.max_patches, 1024);
|
||||
CHECK_EQ(b.encoder.n_embd, 5120);
|
||||
CHECK_EQ(b.encoder.merge, 4);
|
||||
|
||||
/* The trunk is still the routed one (eight blocks, plus the MTP layer's own router under
|
||||
* --max-spec 3), and the shared expert is still folded in. */
|
||||
CHECK_EQ(count_op(b, "router_topk"), 9);
|
||||
CHECK(count_op(b, "moe_gemm_q") >= 16);
|
||||
|
||||
/* 3 stem + 12 a block + 6 merger, each mapped from the checkpoint's model.visual.*. */
|
||||
int nv = 0;
|
||||
for (const auto& w : b.weights)
|
||||
if (w.name.rfind("v.", 0) == 0) {
|
||||
++nv;
|
||||
CHECK(find_map(b, w.name) != nullptr);
|
||||
}
|
||||
CHECK_EQ(nv, 3 + 12 * 2 + 6);
|
||||
}
|
||||
|
||||
/* `layer_types` is checked against the interval rule, not ignored: a model built with the wrong
|
||||
* layers linear still generates fluent text. A disagreeing, short or unknown schedule is refused
|
||||
* by every plugin of the family; an agreeing one declares. */
|
||||
|
||||
Reference in new issue
Block a user