pub struct KvCacheConfig {
pub cache_type: KvCacheType,
pub block_size: usize,
pub max_blocks: usize,
pub enable_compression: bool,
pub compression_ratio: f32,
pub enable_multi_level: bool,
pub swap_threshold: f32,
pub enable_prefix_caching: bool,
pub prefix_cache_size: usize,
}Expand description
KV Cache configuration
Fields§
§cache_type: KvCacheTypeCache implementation type
block_size: usizeBlock size for paged attention
max_blocks: usizeMaximum number of blocks
enable_compression: boolEnable cache compression
compression_ratio: f32Compression ratio target
enable_multi_level: boolEnable multi-level caching (GPU + CPU)
swap_threshold: f32Swap threshold (when to move to CPU)
enable_prefix_caching: boolEnable prefix caching
prefix_cache_size: usizePrefix cache size
Trait Implementations§
Source§impl Clone for KvCacheConfig
impl Clone for KvCacheConfig
Source§fn clone(&self) -> KvCacheConfig
fn clone(&self) -> KvCacheConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 KvCacheConfig
impl Debug for KvCacheConfig
Source§impl Default for KvCacheConfig
impl Default for KvCacheConfig
Source§impl<'de> Deserialize<'de> for KvCacheConfig
impl<'de> Deserialize<'de> for KvCacheConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for KvCacheConfig
impl RefUnwindSafe for KvCacheConfig
impl Send for KvCacheConfig
impl Sync for KvCacheConfig
impl Unpin for KvCacheConfig
impl UnsafeUnpin for KvCacheConfig
impl UnwindSafe for KvCacheConfig
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