Skip to main content

DflashKvTail

Struct DflashKvTail 

Source
pub struct DflashKvTail {
    pub layers: Vec<(CudaSlice<f32>, CudaSlice<f32>)>,
    pub base: usize,
    pub rows: usize,
    pub len: usize,
    pub row_bytes: usize,
}
Expand description

A DFlash draft-KV tail, per drafter layer, ready to ride a cross-request prefix-cache entry: (k, v) f32 rows covering absolute positions [base, base + rows).

Only the tail travels, and that is a fact about this export rather than an optimisation: every DFlash2 draft layer is sliding_attention (the port asserts it at load), so a round at context pos reads rows [pos - window + 1, pos + block) and nothing older. Storing the whole history for a 30k-token prompt would be ~1,229 MB — MORE than the ~1,057 MB of trunk planes it would ride with; the tail is ~85 MB.

Fields§

§layers: Vec<(CudaSlice<f32>, CudaSlice<f32>)>§base: usize

Absolute position of the first stored row.

§rows: usize

Rows stored per layer.

§len: usize

Logical length the KV had when exported (= pos), so an import can restore the same absolute row addressing the rope positions were baked against.

§row_bytes: usize

Bytes per row per layer, carried so an import cannot disagree about the geometry.

Implementations§

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.