NgramRowCache

Struct NgramRowCache 

Source
pub struct NgramRowCache {
    pub hits: u64,
    pub misses: u64,
    pub evictions: u64,
    /* private fields */
}
Expand description

2026-09-25: One table’s backing files and its resident row cache.

Fields§

§hits: u64§misses: u64§evictions: u64

Implementations§

Source§

impl NgramRowCache

Source

pub fn open( path: &Path, scale_path: Option<&Path>, rows_total: u64, row_stride: usize, slots: usize, ) -> Result<Self>

2026-09-25: Open path as the backing store for a table of rows_total rows of row_stride bytes, caching slots of them in pinned GPU-addressable memory. scale_path supplies the per-row f32 scales of an FP8 table.

Source

pub fn open_at( path: &Path, base_offset: u64, scale_path: Option<&Path>, rows_total: u64, row_stride: usize, slots: usize, ) -> Result<Self>

2026-09-25: As Self::open, with the table starting at base_offset in the file. Zero geometry or row_stride > BLOCK is an error.

Source

pub fn open_segmented( shards: &[(PathBuf, u64)], rows_per_shard: u64, scale_path: Option<&Path>, row_stride: usize, slots: usize, ) -> Result<Self>

2026-09-25: As Self::open_at, for a table split into shards at arbitrary offsets, possibly in several files. shards[i] is shard i’s file and the offset of its first row; every shard holds rows_per_shard rows.

Source

pub fn table_dev_va(&self) -> Result<u64>

2026-09-25: Device VA of the row arena, the table the gather kernels index by slot.

Source

pub fn set_constant_scale(&mut self, scale: f32) -> Result<()>

2026-09-25: Give every slot the same scale, for an FP8 table with one scale for all rows. The scale arena is filled here and never faulted.

§Errors

If the scale arena cannot be allocated.

Source

pub fn scale_dev_va(&self) -> Result<Option<u64>>

2026-09-25: Device VA of the [slots] f32 scale array; None for a BF16 table.

Source

pub fn stats(&self) -> (u64, u64, u64)

Source

pub fn resolve( &mut self, row_ids: &[u64], out_slots: &mut Vec<u32>, ) -> Result<()>

2026-09-25: Resolve row_ids to slot indices, faulting misses in from NVMe.

Every returned slot stays pinned until Self::end_batch, so a later resolve in the same batch cannot evict a row the gather has yet to read. An id at or past the table’s row count, every slot pinned, or a failed read is an error.

Source

pub fn end_batch(&mut self)

2026-09-25: Release the batch’s pins; call after the gather kernels are issued.

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,