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
2026-09-25: DSA geometry for one layer, from ModelConfig.
Attention head counts are per rank (local_heads); the indexer is replicated, so
index_heads is the full count. See tp.
Fields§
§index_heads: usize§index_head_dim: usize§index_kpool: usize§index_topk: usize§always_select_tail: bool§local_heads: usize2026-09-25: Attention heads this rank owns.
q_lora_rank: usize§kv_lora_rank: usize§qk_nope_head_dim: usize§qk_rope_head_dim: usize2026-09-25: 0 on GLM-5.3 (NoPE). build::absorb_q and build::absorb_o refuse any
other value.
v_head_dim: usize§max_context: usize2026-09-25: Tokens a sequence’s indexer cache is sized for: --max-seq-len, or 16,384
when it is unset (from_config). state::max_dsa_context rounds it down to whole
pools.
Implementations§
Source§impl Glm5NextDsaConfig
impl Glm5NextDsaConfig
Sourcepub fn from_config(config: &ModelConfig) -> Result<Self>
pub fn from_config(config: &ModelConfig) -> Result<Self>
2026-09-25: local_heads is config.num_attention_heads, which the serve’s
serve_phases::topology has already divided by tp_size. Returns the result of
validate.
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
2026-09-25: Pools selected per query, capped by how many pools exist.
Sourcepub fn out_width(&self) -> usize
pub fn out_width(&self) -> usize
2026-09-25: Width of the emitted index row: index_topk, plus index_kpool - 1 tail
slots when always_select_tail.
Sourcepub fn kv_cache_dim(&self) -> usize
pub fn kv_cache_dim(&self) -> usize
2026-09-25: KV latent cache width. Under NoPE this is kv_lora_rank, 512 on GLM-5.3;
the DeepSeek-V4-Flash cache carries a rope tail and is 576 wide (MLA_CACHE_DIM in
kernels/gb10/deepseek-v4-flash/nvfp4/mla_paged_decode.cu).
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
§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.