pub struct DashAttnConfig {
pub chunk_size: usize,
pub alpha: f32,
pub scaling_factor: f32,
pub sigma: f32,
pub estimate_diagonal: bool,
}Expand description
Configuration for DashAttention adaptive sparse hierarchical attention. Controls α-entmax routing, chunk summarization, and routing bias.
Fields ordered by descending alignment to minimize padding: usize (8B) → f32 (4B) → bool (1B) — 24 bytes total, no wasted padding.
Fields§
§chunk_size: usizeChunk size for block-level attention (default: 64).
alpha: f32α parameter for entmax. Only α=1.5 supported (quadratic, closed-form).
scaling_factor: f32Scaling factor γ applied to chunk logits before entmax (default: 1.0).
sigma: f32Prior strength σ for routing bias (default: 1e6, weak prior).
estimate_diagonal: boolWhether to estimate diagonal attention contribution (default: true). Tail-packed after f32 group to avoid bool-between-f32 padding.
Trait Implementations§
Source§impl Clone for DashAttnConfig
impl Clone for DashAttnConfig
Source§fn clone(&self) -> DashAttnConfig
fn clone(&self) -> DashAttnConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DashAttnConfig
Source§impl Debug for DashAttnConfig
impl Debug for DashAttnConfig
Auto Trait Implementations§
impl Freeze for DashAttnConfig
impl RefUnwindSafe for DashAttnConfig
impl Send for DashAttnConfig
impl Sync for DashAttnConfig
impl Unpin for DashAttnConfig
impl UnsafeUnpin for DashAttnConfig
impl UnwindSafe for DashAttnConfig
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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