pub struct MlaDeviceKv {
pub k: DevicePtr,
pub v: DevicePtr,
pub seq_len: usize,
pub cap: usize,
/* private fields */
}Expand description
Device-resident MLA KV. Append is one-row D2D/H2D; SDPA reads the buffer.
Host MlaKv remains the CPU oracle. Do not re-upload [0..T] each token.
Fields§
§k: DevicePtr§v: DevicePtr§seq_len: usize§cap: usizeImplementations§
Source§impl MlaDeviceKv
impl MlaDeviceKv
pub fn k_row(&self) -> usize
pub fn v_row(&self) -> usize
pub fn alloc( gpu: &dyn GpuBackend, cap: usize, k_row: usize, v_row: usize, ) -> Result<Self>
pub fn alloc_and_upload( gpu: &dyn GpuBackend, host: &MlaKv, cap: usize, k_row: usize, v_row: usize, ) -> Result<Self>
pub fn validate_cfg(&self, cfg: &MlaConfig) -> Result<()>
pub fn download(&self, gpu: &dyn GpuBackend, host: &mut MlaKv) -> Result<()>
pub fn free(self, gpu: &dyn GpuBackend) -> Result<()>
Auto Trait Implementations§
impl Freeze for MlaDeviceKv
impl RefUnwindSafe for MlaDeviceKv
impl Send for MlaDeviceKv
impl Sync for MlaDeviceKv
impl Unpin for MlaDeviceKv
impl UnwindSafe for MlaDeviceKv
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