pub enum KvCacheMemoryFraction {
OfTotal(f64),
OfFree(f64),
}Expand description
Backend-tagged memory fraction. The variant encodes the XOR between
TRT-LLM’s free-fraction and vLLM/SGLang’s total-fraction semantics; the
Python estimate_kv_cache validates it against engine.backend and returns
an error (mapped to KvCacheEstimateError::IncompatibleMemoryFraction) if
mismatched.
Variants§
OfTotal(f64)
Fraction of TOTAL GPU memory. Compatible with vLLM
(gpu_memory_utilization) and SGLang (mem_fraction_static).
OfFree(f64)
Fraction of FREE (post-non-KV) GPU memory. Compatible with TRT-LLM
(free_gpu_memory_fraction).
Trait Implementations§
Source§impl Clone for KvCacheMemoryFraction
impl Clone for KvCacheMemoryFraction
Source§fn clone(&self) -> KvCacheMemoryFraction
fn clone(&self) -> KvCacheMemoryFraction
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 KvCacheMemoryFraction
Source§impl Debug for KvCacheMemoryFraction
impl Debug for KvCacheMemoryFraction
Source§impl<'de> Deserialize<'de> for KvCacheMemoryFraction
impl<'de> Deserialize<'de> for KvCacheMemoryFraction
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
Source§impl PartialEq for KvCacheMemoryFraction
impl PartialEq for KvCacheMemoryFraction
Source§impl Serialize for KvCacheMemoryFraction
impl Serialize for KvCacheMemoryFraction
impl StructuralPartialEq for KvCacheMemoryFraction
Auto Trait Implementations§
impl Freeze for KvCacheMemoryFraction
impl RefUnwindSafe for KvCacheMemoryFraction
impl Send for KvCacheMemoryFraction
impl Sync for KvCacheMemoryFraction
impl Unpin for KvCacheMemoryFraction
impl UnsafeUnpin for KvCacheMemoryFraction
impl UnwindSafe for KvCacheMemoryFraction
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