DflashConfig

Struct DflashConfig 

Source
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§

§hidden_size: usize§num_hidden_layers: usize§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: usize

Block size γ. Qwen3.6-DFlash ships block_size: 16.

§dflash_config: Option<DflashSubConfig>

DFlash-specific nested config object.

§rope_theta: f32

Drafter 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: usize

DSpark 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: bool

DSpark 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: bool

When true the confidence head’s input is [hidden ‖ markov_embed] (input_dim = hidden_size + markov_rank); when false, hidden only.

Implementations§

Source§

impl DflashConfig

Source

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

Source§

fn clone(&self) -> DflashConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DflashConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for DflashConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,