pub enum KvPrecision {
Bf16,
Fp8,
Int4,
}Expand description
The element type the cache is stored in.
Int4 is half a byte per element, which is why element size is a f64 rather
than an integer.
Variants§
Bf16
bf16 or fp16: two bytes per element. The default for most runtimes.
Fp8
fp8 KV cache: one byte per element.
Int4
int4 KV cache: half a byte per element.
Implementations§
Source§impl KvPrecision
impl KvPrecision
Sourcepub fn bytes_per_element(self) -> f64
pub fn bytes_per_element(self) -> f64
Bytes occupied by one cached element.
Trait Implementations§
Source§impl Clone for KvPrecision
impl Clone for KvPrecision
Source§fn clone(&self) -> KvPrecision
fn clone(&self) -> KvPrecision
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 KvPrecision
Source§impl Debug for KvPrecision
impl Debug for KvPrecision
impl Eq for KvPrecision
Source§impl PartialEq for KvPrecision
impl PartialEq for KvPrecision
impl StructuralPartialEq for KvPrecision
Auto Trait Implementations§
impl Freeze for KvPrecision
impl RefUnwindSafe for KvPrecision
impl Send for KvPrecision
impl Sync for KvPrecision
impl Unpin for KvPrecision
impl UnsafeUnpin for KvPrecision
impl UnwindSafe for KvPrecision
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