pub struct Glm5NextDsaConfig {Show 13 fields
pub hidden: usize,
pub index_heads: usize,
pub index_head_dim: usize,
pub index_kpool: usize,
pub index_topk: usize,
pub always_select_tail: bool,
pub local_heads: usize,
pub q_lora_rank: usize,
pub kv_lora_rank: usize,
pub qk_nope_head_dim: usize,
pub qk_rope_head_dim: usize,
pub v_head_dim: usize,
pub max_context: usize,
}Expand description
DSA geometry for one layer, read from the checkpoint config — never defaulted.
Head counts are per-rank local for the MLA side and full for the indexer,
which is replicated. See tp for why.
Fields§
§index_heads: usize§index_head_dim: usize§index_kpool: usize§index_topk: usize§always_select_tail: bool§local_heads: usizeAttention heads this rank owns.
q_lora_rank: usize§kv_lora_rank: usize§qk_nope_head_dim: usize§qk_rope_head_dim: usizeZero on GLM-5.3. Kept explicit so a nonzero value is a loud change.
v_head_dim: usize§max_context: usizeLongest context a sequence’s indexer cache is reserved for, in tokens — the serve’s
--max-seq-len. Not a kernel limit (the top-k select is tiled); an ALLOCATION, and
the biggest per-sequence one GLM-5.3 makes. See state::max_dsa_context.
Implementations§
Source§impl Glm5NextDsaConfig
impl Glm5NextDsaConfig
Sourcepub fn from_config(config: &ModelConfig) -> Result<Self>
pub fn from_config(config: &ModelConfig) -> Result<Self>
config carries per-rank-local attention head counts: serve_phases::topology
divides num_attention_heads by tp_size before any loader runs.
pub fn qk_head_dim(&self) -> usize
Sourcepub fn select_k(&self, n_pools: usize) -> usize
pub fn select_k(&self, n_pools: usize) -> usize
Pools selected per query, capped by how many pools exist.
Sourcepub fn out_width(&self) -> usize
pub fn out_width(&self) -> usize
Width of the emitted index row; the tail adds kpool - 1 slots.
Sourcepub fn kv_cache_dim(&self) -> usize
pub fn kv_cache_dim(&self) -> usize
KV latent cache width. No rope section under NoPE, so this is exactly
kv_lora_rank — 512 for GLM-5.3, where DeepSeek-V4-Flash uses 576.
pub fn validate(&self) -> Result<()>
Trait Implementations§
Source§impl Clone for Glm5NextDsaConfig
impl Clone for Glm5NextDsaConfig
Source§fn clone(&self) -> Glm5NextDsaConfig
fn clone(&self) -> Glm5NextDsaConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Glm5NextDsaConfig
impl Debug for Glm5NextDsaConfig
Source§impl PartialEq for Glm5NextDsaConfig
impl PartialEq for Glm5NextDsaConfig
impl Copy for Glm5NextDsaConfig
impl Eq for Glm5NextDsaConfig
impl StructuralPartialEq for Glm5NextDsaConfig
Auto Trait Implementations§
impl Freeze for Glm5NextDsaConfig
impl RefUnwindSafe for Glm5NextDsaConfig
impl Send for Glm5NextDsaConfig
impl Sync for Glm5NextDsaConfig
impl Unpin for Glm5NextDsaConfig
impl UnwindSafe for Glm5NextDsaConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.