pub struct RtTurboConfig {
pub low_dim: usize,
pub sliding_window: usize,
pub sink_tokens: usize,
pub block_size: usize,
pub retrieval_head_ratio: f32,
pub top_p: f32,
pub calibration_mode: CalibrationMode,
}Expand description
Configuration for RTPurbo retrieval head sparse decode.
Feature gate: rt_turbo (opt-in, requires dash_attn).
Adds head-wise retrieval/local classification + dynamic top-p token selection
for decode-phase sparse attention. Complements DashAttention’s α-entmax block
routing with per-head specialization.
Must pass 6/6 GOAT proofs before default-on promotion.
Fields ordered by descending alignment to minimize padding: usize (8B) → f32 (4B) → CalibrationMode (1B) — no padding between groups.
§Calibration mode (Plan 358)
CalibrationMode::AttentionMass is the default (cheaper: 1 forward pass).
CalibrationMode::CausalNecessity is opt-in — strictly stronger on
workloads with correlated bystanders but ~10–100× more expensive to
calibrate. See calibrate_from_causal_scores in rt_turbo::calibration.
Fields§
§low_dim: usizeLow-dimensional projection size for pre-RoPE scoring (default: 16). Paper ablation: dim=16 is the sweet spot for low-frequency retrieval.
sliding_window: usizeSliding window size for local heads (default: 8192).
sink_tokens: usizeNumber of attention sink tokens always retained for local heads (default: 4).
block_size: usizeBlock size for block-level top-p variant (default: 64).
Should match DashAttnConfig::chunk_size for consistent routing.
retrieval_head_ratio: f32Fraction of heads classified as retrieval heads (default: 0.15). Paper ablation: 15% is optimal balance of accuracy vs sparsity.
top_p: f32Cumulative attention mass threshold for dynamic top-p selection (default: 0.9). Paper ablation: top-p=0.9 preserves >93% attention mass at 97% sparsity.
calibration_mode: CalibrationModeWhich score semantics to use for head calibration (Plan 358). Default:
AttentionMass (cheaper). CausalNecessity is opt-in — strictly
stronger on bystander-heavy workloads but ~10–100× more expensive.
AdaptiveCausal (Proposal 004) is opt-in — cheap-proxy escalate,
unvalidated, requires per-head OV norms from the caller.
Trait Implementations§
Source§impl Clone for RtTurboConfig
impl Clone for RtTurboConfig
Source§fn clone(&self) -> RtTurboConfig
fn clone(&self) -> RtTurboConfig
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 RtTurboConfig
Source§impl Debug for RtTurboConfig
impl Debug for RtTurboConfig
Auto Trait Implementations§
impl Freeze for RtTurboConfig
impl RefUnwindSafe for RtTurboConfig
impl Send for RtTurboConfig
impl Sync for RtTurboConfig
impl Unpin for RtTurboConfig
impl UnsafeUnpin for RtTurboConfig
impl UnwindSafe for RtTurboConfig
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