pub struct DflashConfig {Show 17 fields
pub hidden_size: usize,
pub num_hidden_layers: usize,
pub intermediate_size: usize,
pub num_attention_heads: usize,
pub num_key_value_heads: usize,
pub head_dim: usize,
pub vocab_size: usize,
pub draft_vocab_size: Option<usize>,
pub tie_word_embeddings: bool,
pub block_size: usize,
pub dflash_config: Option<DflashSubConfig>,
pub rope_theta: f32,
pub rope_scaling: Option<DflashRopeScaling>,
pub markov_rank: usize,
pub markov_head_type: Option<String>,
pub enable_confidence_head: bool,
pub confidence_head_with_markov: bool,
}Expand description
Drafter HF config.json (subset Atlas consumes). Mirrors
z-lab/Qwen3.6-35B-A3B-DFlash/config.json field names verbatim so
serde_json::from_str works directly on the raw file.
Fields§
§intermediate_size: usize§num_attention_heads: usize§num_key_value_heads: usize§head_dim: usize§vocab_size: usize§draft_vocab_size: Option<usize>§tie_word_embeddings: bool§block_size: usizeBlock size γ. Qwen3.6-DFlash ships block_size: 16.
dflash_config: Option<DflashSubConfig>DFlash-specific nested config object.
rope_theta: f32Drafter base RoPE θ. Defaults to 10M (matches Qwen3.6-DFlash).
rope_scaling: Option<DflashRopeScaling>HF-style rope_scaling block. None ⇒ plain RoPE (the v2 2026-04-27
Qwen3.6-DFlash drafter ships rope_scaling: null). When present and
rope_type == "yarn", the drafter’s YaRN parameters are used to
build the inv_freq table at construction time.
alias = "rope_parameters": newer transformers releases (RadixArk
DSpark, incoai DFlash2) ship the block under that key — without the
alias Atlas silently drops the scaling (the RadixArk config.json had
to be hand-patched before this).
markov_rank: usizeDSpark Markov head rank. 0 (default) ⇒ plain DFlash drafter with no
Markov head. RadixArk Qwen3.8-27B-DSpark ships markov_rank: 256
top-level (SpecForge DSparkConfig convention — see the checkpoint’s
dspark.py: DSpark fields are declared as top-level config attrs).
markov_head_type: Option<String>DSpark Markov head flavor. Only "vanilla" (low-rank learned bigram
bias) is defined by the reference; anything else is rejected at load.
enable_confidence_head: boolDSpark confidence head (AcceptRatePredictor): a Linear(input, 1)
predicting per-draft-position acceptance probability, used for
adaptive block length. Loaded when present; consumed by the dynamic-K
scheduling phase (the Markov fixup works without it).
confidence_head_with_markov: boolWhen true the confidence head’s input is [hidden ‖ markov_embed]
(input_dim = hidden_size + markov_rank); when false, hidden only.
Implementations§
Source§impl DflashConfig
impl DflashConfig
Sourcepub fn effective_block_size(&self) -> usize
pub fn effective_block_size(&self) -> usize
Resolved block size γ: the drafter’s own trained value when the checkpoint states it, else the top-level field.
The top-level block_size defaults to 16, and serde fills that default
happily for a checkpoint that never mentioned it — so a DFlash2 drafter
trained at 8 comes up as 16 unless the sub-config is consulted first.
That is not a cosmetic mismatch: the serve then runs num_drafts=15
against an 8-block drafter, which measured 0% accept on EVERY verify
step, and sizes the drafter’s per-sequence pools for twice the block it
will ever use. --dflash-gamma still overrides both.
Trait Implementations§
Source§impl Clone for DflashConfig
impl Clone for DflashConfig
Source§fn clone(&self) -> DflashConfig
fn clone(&self) -> DflashConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more