pub struct KvCacheShapeV2 {
pub batch: u32,
pub layers: u32,
pub num_q_heads: u32,
pub num_kv_heads: u32,
pub seq_len: u64,
pub head_dim: u32,
pub layout: KvLayout,
pub dtype: DType,
pub attention_kind: KvAttentionKind,
}Fields§
§batch: u32§layers: u32§num_q_heads: u32§num_kv_heads: u32§seq_len: u64§head_dim: u32§layout: KvLayout§dtype: DType§attention_kind: KvAttentionKindImplementations§
Source§impl KvCacheShapeV2
impl KvCacheShapeV2
pub fn new( batch: u32, layers: u32, num_q_heads: u32, num_kv_heads: u32, seq_len: u64, head_dim: u32, layout: KvLayout, dtype: DType, attention_kind: KvAttentionKind, ) -> Result<Self, QuantCodecError>
pub fn mha( batch: u32, layers: u32, heads: u32, seq_len: u64, head_dim: u32, layout: KvLayout, dtype: DType, ) -> Result<Self, QuantCodecError>
pub fn mqa( batch: u32, layers: u32, num_q_heads: u32, seq_len: u64, head_dim: u32, layout: KvLayout, dtype: DType, ) -> Result<Self, QuantCodecError>
pub fn gqa( batch: u32, layers: u32, num_q_heads: u32, num_kv_heads: u32, seq_len: u64, head_dim: u32, layout: KvLayout, dtype: DType, ) -> Result<Self, QuantCodecError>
pub fn validate(&self) -> Result<(), QuantCodecError>
Trait Implementations§
Source§impl Clone for KvCacheShapeV2
impl Clone for KvCacheShapeV2
Source§fn clone(&self) -> KvCacheShapeV2
fn clone(&self) -> KvCacheShapeV2
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 KvCacheShapeV2
impl Debug for KvCacheShapeV2
Source§impl<'de> Deserialize<'de> for KvCacheShapeV2
impl<'de> Deserialize<'de> for KvCacheShapeV2
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 Hash for KvCacheShapeV2
impl Hash for KvCacheShapeV2
Source§impl PartialEq for KvCacheShapeV2
impl PartialEq for KvCacheShapeV2
Source§fn eq(&self, other: &KvCacheShapeV2) -> bool
fn eq(&self, other: &KvCacheShapeV2) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for KvCacheShapeV2
impl Serialize for KvCacheShapeV2
impl Eq for KvCacheShapeV2
impl StructuralPartialEq for KvCacheShapeV2
Auto Trait Implementations§
impl Freeze for KvCacheShapeV2
impl RefUnwindSafe for KvCacheShapeV2
impl Send for KvCacheShapeV2
impl Sync for KvCacheShapeV2
impl Unpin for KvCacheShapeV2
impl UnsafeUnpin for KvCacheShapeV2
impl UnwindSafe for KvCacheShapeV2
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