Files
Strata/engine/tests
Niko1221 a8326c6b78 ling32 mtp: the upstream MTP layer as the speculative drafter (sidecar loader, MTP cache, chained drafts)
- GpuModel::load_mtp reads Ling-3.2-Air-MTP.strata (kind mtp_sidecar, .strata v1.1: manifest with the MIT text and attribution, mtp.* tensors, 512 expert slabs in
  the trunk's layout) and uploads the MTP layer next to the trunk: MLA + MoE weights, eh_proj / enorm / hnorm / final_layernorm, its own latent cache and expert block.
- The MTP layer runs through the trunk's layer(): mla_layer / moe_ffn take the layer from LY(il) (il == n_layers is the MTP layer), experts from the sidecar block.
- spec_init(mtp): no DFly weights or taps; DflyDrafter::init_mtp keeps the device-side cycle record, sampling config and q records, so spec_accept / kda_rollback /
  the verify graph are shared.  Prefill fills the MTP cache chunk by chunk (hook in forward_mm); every verify cycle runs the MTP layer over the verify rows (the kept
  ones are the first a + 1) and then drafts K tokens chained: step j feeds the drafted token and the MTP's own final_layernorm output; positions are the target's.
- Adaptive K from per-slot acceptance EMAs against a verify / draft cost model; flags --mtp FILE --spec mtp [--spec-block K] [--spec-adaptive]; default K_max 4.
- make-mtp-fixture (ling32_pyref.py) builds a tiny sidecar for the fixture geometry.
2026-12-01 10:33:04 +01:00
..