pub enum NgramTable {
Bf16(DenseWeight),
Fp8(Fp8DenseWeight),
Cached(Box<NgramRowCache>),
}Expand description
2026-09-25: One n-gram lookup table. Fp8 holds E4M3 rows with a
per-row f32 scale, which the gather (batched_embed_fp8) applies.
Variants§
Bf16(DenseWeight)
Fp8(Fp8DenseWeight)
Cached(Box<NgramRowCache>)
2026-09-25: NVMe-backed: a bounded set of rows is resident in a
GPU-addressable arena. The host maps row ids to arena slots
(NgramRowCache::resolve) and the same gather kernels read the arena
by slot.
Implementations§
Source§impl NgramTable
impl NgramTable
Sourcepub fn quantize_bf16(
w: &DenseWeight,
rows: usize,
dim: usize,
gpu: &dyn GpuBackend,
stream: u64,
) -> Result<Self>
pub fn quantize_bf16( w: &DenseWeight, rows: usize, dim: usize, gpu: &dyn GpuBackend, stream: u64, ) -> Result<Self>
2026-09-25: Quantize a BF16 table to FP8 on the GPU with
quantize_bf16_to_fp8. w is not freed.
Auto Trait Implementations§
impl Freeze for NgramTable
impl RefUnwindSafe for NgramTable
impl Send for NgramTable
impl Sync for NgramTable
impl Unpin for NgramTable
impl UnwindSafe for NgramTable
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