pub struct KvCachePolicyConfig {
pub q8_threshold: f32,
pub q4_threshold: f32,
pub hysteresis: f32,
pub ewma_alpha: f32,
pub min_level: KvCacheLevel,
pub max_level: KvCacheLevel,
}Expand description
Configuration for KvCachePolicy.
Default values: upgrade to Q8 above 80 % cache occupancy, upgrade to Q4 above 95 %; hysteresis margin 5 %; EWMA factor 0.20.
Fields§
§q8_threshold: f32Cache occupancy threshold (0.0..=1.0) above which we upgrade FP16 → Q8.
q4_threshold: f32Cache occupancy threshold above which we upgrade Q8 → Q4.
hysteresis: f32Symmetric hysteresis margin: a downgrade fires only after pressure
drops below threshold - hysteresis.
ewma_alpha: f32EWMA smoothing factor (alpha in s_t = alpha * x_t + (1-alpha)*s_{t-1}).
Higher = more reactive, lower = more stable.
min_level: KvCacheLevelInitial / minimum tier — set to Fp16 to allow downgrade.
max_level: KvCacheLevelMaximum tier — set to Q4 to allow full compression range.
Implementations§
Source§impl KvCachePolicyConfig
impl KvCachePolicyConfig
Sourcepub fn aggressive() -> Self
pub fn aggressive() -> Self
Aggressive profile — starts at Q8 and reaches Q4 sooner.
Trait Implementations§
Source§impl Clone for KvCachePolicyConfig
impl Clone for KvCachePolicyConfig
Source§fn clone(&self) -> KvCachePolicyConfig
fn clone(&self) -> KvCachePolicyConfig
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 moreSource§impl Debug for KvCachePolicyConfig
impl Debug for KvCachePolicyConfig
Auto Trait Implementations§
impl Freeze for KvCachePolicyConfig
impl RefUnwindSafe for KvCachePolicyConfig
impl Send for KvCachePolicyConfig
impl Sync for KvCachePolicyConfig
impl Unpin for KvCachePolicyConfig
impl UnsafeUnpin for KvCachePolicyConfig
impl UnwindSafe for KvCachePolicyConfig
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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