Repository navigation
model : deepseek41 DSpark speculative draft - #296
danielhanchen wants to merge 9 commits into
Conversation
…ariant) DeepSeek-V4.1 ships a 3-stage DSpark block drafter (mtp.0..2). It is exported as a separate DFLASH GGUF with convert_hf_to_gguf.py --dspark and used with --spec-type draft-dspark, like the V4 DSpark draft. - DFLASH graph_dsv41: single-pass mHC (each sublayer collapses with the previous sublayer's pre-mix, output with the last FFN pre-mix, no hc_head), no per-head q norm, plain rope; markov and confidence heads as V4. Flagged by dflash.hyper_connection.single_pass. - Block queries see the main-KV window up to the anchor plus the whole block; n_swa grows by one so the first query's mask row reaches window_size positions before the anchor. - deepseek41 exports the target features (mean over the hc copies of the layer input) via embeddings_layer_inp. - Converter: DeepseekV41DSparkModel (MXFP4 experts bit-exact, dense BF16, conf_proj F32; embeddings and lm head come from the target).
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…context Drafts that borrow token_embd/output from the target (DFlash, DSpark, Eagle3) could not be measured during --fit: their context requires ctx_other, so fit logged 'failed to measure the memory of the extra model, fitting without it' and the draft weights, KV cache and compute buffers were never reserved. Measure a separate draft next to an allocation-free target context passed as ctx_other (its memory stays counted with the main model) and apply what the speculative decoder sets on the draft after creating it (backend top-k samplers, nextn embeddings) before reading the breakdown, so the larger compute graph reserved after speculative init is counted too. Normal inference without ctx_other still throws.
|
Fix for Problem. A DSpark/DFlash draft borrows Fix.
Evidence. Tiny DSV4.1 + DSpark fixture, base vs head:
On Not covered: a multi-GPU split (tested on one device only) and a real 3090. |
|
Pushed cf6d1a9 (merges the #289 output LoRA fix first). The DSpark draft now normalises the router weights as With two selected router logits of -24, the reference gives [0.5, 0.5]. The DSpark graph gave [0.1007, 0.1007] (sum 0.201) before this change and [0.5, 0.5] after. The condition is keyed on |
Adds the DeepSeek-V4.1 DSpark speculative draft. V4.1 ships a 3-stage DSpark block drafter (
mtp.0..2); it is exported as a separate DFLASH GGUF withconvert_hf_to_gguf.py --dsparkand used with--spec-type draft-dspark, like the DeepSeek-V4 DSpark draft.Stacked on the performance PR (#295,
dsv41-perf). The diff is only this change: 10 files, +425/-9.What it adds
src/models/dflash.cpp), flagged bydflash.hyper_connection.single_pass:hc_head.n_swagrows by one so that the first query's mask row reacheswindow_sizepositions before the anchor.deepseek41exports the mean over the HC copies of the layer input viaembeddings_layer_inp.DeepseekV41DSparkModel): MXFP4 experts bit-exact, dense weights BF16,conf_projF32. The embeddings and LM head come from the target model.Verification
All results are local, on B200 (CUDA
sm_100a) and x86 CPU.Known gaps