Expand description
DFlash block-diffusion drafter (DFLASH-BRINGUP-PLAN.md, 2026-07-13).
5-layer qwen3-class mini-transformer that drafts a 16-token block in ONE non-causal
forward, conditioned on the TARGET’s hidden states at 6 tapped layers (concatenated
through fc + hidden_norm). No embed / lm_head of its own — the round reuses the
target’s. Reference: z-lab/dflash dflash/model.py (semantics frozen in the plan doc);
oracle: tools/dflash_oracle.py -> /data/cache/dflash-oracle.npz.
FIRST LIGHT = f32-resident weights + fresh full-context forward (no draft KV cache) — correctness vs the oracle, then the cache/quant/window arms land measurement-gated.
Structs§
- Confidence
Head - AcceptRatePredictor: raw linear proj over [hidden ; markov_prev_embedding(rank)] (with_markov=true on the q38 arm-a export) — output is the PRE-sigmoid scalar.
- Dflash
Cfg - Dflash
Draft - Dflash
Kv - Draft KV cache (round-cost fix, 2026-07-13): per-layer normed+roped ctx K and raw ctx V, append-only in committed order. Block K/V land TRANSIENTLY at [len..len+b] each round (never committed — the reference crops them identically). Kills the per-round full-ctx projection recompute (first light was O(ctx)/round -> 7 tok/s).
- Dflash
Layer - Dspark
Spec Session - Markov
Head
Enums§
- Dspark
Harvest - Draft-row harvest convention for DFlash-family block drafters (darklanes research/deepseek-flash-20260818/DSPARK-POSTMORTEM-20260820.md).
- Dspark
VtPolicy - Verify-window policy for the dspark round (H4, DSPARK-POSTMORTEM-20260820.md §3).
Functions§
- dspark_
accept_ prefix - Accepted-prefix length of a round’s candidates against the trunk’s verify argmaxes:
cand[0]= the round anchor (already decided),cand[1..]= the drafts;vam[j]= the trunk’s argmax prediction for position anchor+j+1. Returns m = number of accepted drafts (cand[1..=m]committed,vam[m]becomes the next anchor). Pure so the harvest-alignment fixture can exercise it CPU-side. - dspark_
confidence_ vt - H4 window sizing (the sglang-planner/vLLM-#47808 mechanism, thresholded):
raws[k]= the accept-rate head’s PRE-sigmoid score for draft slot k+1; survivalS_k = prod_{j<=k} sigmoid(raws[j]); the window keeps leading slots whileS_k >= tau. Returnsvt= 1 (anchor) + kept drafts, clamped to[2, vt_cap]: the draft forward is already paid, so at least one draft rides every verify — one extra verify row costs less than a guaranteed empty round. Pure, so the policy’s knee is testable CPU-side likedspark_accept_prefix. - dspark_
slot_ confidence_ vt - Owner-directive arm (2026-08-20, “take only high confidence offers”): keep the
longest draft PREFIX whose EVERY slot clears
tauon its own sigmoid — truncate at the first sub-threshold slot, so the low-confidence tail (B2 measured 0.2–0.5 slot rates at depth) never enters verify. Prefix truncation is forced by the accept rule anyway (dspark_accept_prefixstops at the first miss — a kept slot after a dropped one could never commit); the policy fork vsdspark_confidence_vtis only the stopping statistic (per-slot marginal vs cumulative survival). Same floor/cap contract. - dspark_
strategy_ census - Checkpoint training-strategy census over the raw config.json text (the loader’s
minimal-extractor idiom — no json dep in-tree). TRUE iff the export declares the
DSPARK strategy:
architecturesnaming a DSpark model class (Qwen3DSparkModel, the SpecForge OnlineDSparkModel export form) ordflash_config.projector_type == "dspark". z-lab / OnlineDFlashModel mask-fill exports carry neither signal. Pure, so the census is testable against config fragments without files.