TokenOverlaySet

Struct TokenOverlaySet 

Source
pub struct TokenOverlaySet {
    pub overlays: Vec<Option<EmbedOverlay>>,
    pub embed_slot_map_table: DevicePtr,
    pub embed_rows_table: DevicePtr,
    pub embed_n_table: DevicePtr,
    pub vocab: u32,
    pub lmhead_rows_table: DevicePtr,
    pub lmhead_ids_table: DevicePtr,
    pub n_override_table: DevicePtr,
    pub max_n_override: u32,
}
Expand description

2026-09-25: The overlay tables for the whole adapter pool, built from the per-slot EmbedOverlays. Model-engine keeps it only when some slot has an overlay (any_active).

Fields§

§overlays: Vec<Option<EmbedOverlay>>

2026-09-25: The per-slot overlays, kept so the buffers the tables point into stay allocated.

§embed_slot_map_table: DevicePtr

2026-09-25: u64[max_loras] of i32[vocab] slot_map pointers, 0 for a slot without an overlay.

§embed_rows_table: DevicePtr

2026-09-25: u64[max_loras] of embed row pointers ([n, h] BF16).

§embed_n_table: DevicePtr

2026-09-25: u32[max_loras] embed row counts; the embed kernel skips a slot_map entry not below it. n_override_table is the lm_head count.

§vocab: u32

2026-09-25: The slot_map length of every overlay (0 when there is none); the kernels skip token ids >= vocab.

§lmhead_rows_table: DevicePtr

2026-09-25: u64[max_loras] of lm_head row pointers.

§lmhead_ids_table: DevicePtr

2026-09-25: u64[max_loras] of lm_head id pointers (u32[n]).

§n_override_table: DevicePtr

2026-09-25: u32[max_loras] lm_head row counts; 0 skips the slot.

§max_n_override: u32

2026-09-25: The largest lm_head row count, the lm_head kernel’s grid.y (token_overlay.cu).

Implementations§

Source§

impl TokenOverlaySet

Source

pub fn from_slots( gpu: &dyn GpuBackend, overlays: Vec<Option<EmbedOverlay>>, max_loras: usize, tied: bool, ) -> Result<Self>

2026-09-25: Build the tables. A slot’s lm_head cells are its own lm_head overlay when it has one; else, when tied, its embed rows and ids; else empty (count 0). An error when two overlays were built against different vocab sizes.

Source

pub fn any_active(&self) -> bool

2026-09-25: True when at least one slot has an overlay.

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> 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 = 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,