#[repr(u8)]pub enum AttentionMode {
Causal = 0,
Bidirectional = 1,
BlockCausal = 2,
SpKv = 3,
SpKvQuant = 4,
DashAttn = 5,
}Expand description
Attention mode for forward passes.
Causal: Standard autoregressive — only attend to positions ≤ current (default).Bidirectional: Attend to ALL positions — used for dLLM masked prediction (Plan 066).BlockCausal: Bidirectional within current block, causal across blocks — D2F student.SpKv: SP-KV self-pruned key-value attention (Plan 070).SpKvQuant: SP-KV + Quantized KV fusion (Plan 070 Phase 3, Task T12).
Variants§
Causal = 0
Bidirectional = 1
Full bidirectional: all positions see all positions (teacher mode).
BlockCausal = 2
Block-causal: bidirectional within block, causal across blocks (student mode).
SpKv = 3
SP-KV self-pruned key-value attention (Plan 070). Learns which KV pairs to retain via utility prediction. Gate bias = log(u) during training, 0|-inf during inference.
SpKvQuant = 4
SP-KV + Quantized KV fusion (Plan 070 Phase 3, Task T12). Selective write (SP-KV utility gating) + lossy quantize (any QuantizedKVCache backend). Two-stage compression: only useful KV pairs kept, those compressed to 2-4 bits/coord.
DashAttn = 5
DashAttention: adaptive sparse hierarchical attention via α-entmax routing (Plan 106). Replaces fixed-budget top-k block selection with adaptive support selection. Learned chunk summaries via head_cls vectors.
Trait Implementations§
Source§impl Clone for AttentionMode
impl Clone for AttentionMode
Source§fn clone(&self) -> AttentionMode
fn clone(&self) -> AttentionMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for AttentionMode
Source§impl Debug for AttentionMode
impl Debug for AttentionMode
Source§impl Default for AttentionMode
impl Default for AttentionMode
Source§fn default() -> AttentionMode
fn default() -> AttentionMode
impl Eq for AttentionMode
Source§impl PartialEq for AttentionMode
impl PartialEq for AttentionMode
impl StructuralPartialEq for AttentionMode
Auto Trait Implementations§
impl Freeze for AttentionMode
impl RefUnwindSafe for AttentionMode
impl Send for AttentionMode
impl Sync for AttentionMode
impl Unpin for AttentionMode
impl UnsafeUnpin for AttentionMode
impl UnwindSafe for AttentionMode
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,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more