pub struct CacheConfig {
pub max_seq_len: usize,
pub page_size: usize,
pub kind: CacheKind,
pub quantize_kv: bool,
}Expand description
Configuration for a KV cache instance.
Fields§
§max_seq_len: usizeMaximum number of cached positions (arena capacity).
page_size: usizeTokens per page (paged cache only).
kind: CacheKindImplementation to use.
quantize_kv: boolStore global-layer KV pages int8-quantized (group-32 along
head_dim, packed 4 bytes per int element) — ~3.5× less KV memory
on the f32 build at near-lossless int8 fidelity. Sliding-window
layers stay in float (they hold at most w-1 tokens). Set from
COMBS_KV_QUANT=1 by the engine.
Implementations§
Source§impl CacheConfig
impl CacheConfig
Sourcepub const DEFAULT_PAGE_SIZE: usize = 16
pub const DEFAULT_PAGE_SIZE: usize = 16
Default page size (MLC uses 16 as well).
Sourcepub fn contiguous(max_seq_len: usize) -> Self
pub fn contiguous(max_seq_len: usize) -> Self
Contiguous (baseline) cache.
Trait Implementations§
Source§impl Clone for CacheConfig
impl Clone for CacheConfig
Source§fn clone(&self) -> CacheConfig
fn clone(&self) -> CacheConfig
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 CacheConfig
Auto Trait Implementations§
impl Freeze for CacheConfig
impl RefUnwindSafe for CacheConfig
impl Send for CacheConfig
impl Sync for CacheConfig
impl Unpin for CacheConfig
impl UnsafeUnpin for CacheConfig
impl UnwindSafe for CacheConfig
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