pub struct TpKvRankAllocationShape {
pub kv_dim_k: usize,
pub kv_dim_v: usize,
pub k_token_bytes: usize,
pub v_token_bytes: usize,
pub fixed_bytes: usize,
}Expand description
Exact allocation geometry for one rank of a tensor-parallel KV sidecar.
The context-linear coefficient and fixed allocation bytes are shared by the CUDA allocator and serving admission. Keeping both consumers on this function prevents a new KV format or rank width from making the pre-admit estimate disagree with the buffers allocated at decode.
Fields§
§kv_dim_k: usize§kv_dim_v: usize§k_token_bytes: usize§v_token_bytes: usize§fixed_bytes: usizeImplementations§
Source§impl TpKvRankAllocationShape
impl TpKvRankAllocationShape
pub fn bytes_per_token(self) -> usize
pub fn allocation_bytes(self, capacity: usize) -> usize
Trait Implementations§
Source§impl Clone for TpKvRankAllocationShape
impl Clone for TpKvRankAllocationShape
Source§fn clone(&self) -> TpKvRankAllocationShape
fn clone(&self) -> TpKvRankAllocationShape
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 TpKvRankAllocationShape
Source§impl Debug for TpKvRankAllocationShape
impl Debug for TpKvRankAllocationShape
impl Eq for TpKvRankAllocationShape
Source§impl PartialEq for TpKvRankAllocationShape
impl PartialEq for TpKvRankAllocationShape
impl StructuralPartialEq for TpKvRankAllocationShape
Auto Trait Implementations§
impl Freeze for TpKvRankAllocationShape
impl RefUnwindSafe for TpKvRankAllocationShape
impl Send for TpKvRankAllocationShape
impl Sync for TpKvRankAllocationShape
impl Unpin for TpKvRankAllocationShape
impl UnsafeUnpin for TpKvRankAllocationShape
impl UnwindSafe for TpKvRankAllocationShape
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