pub enum KimiExpertBacking {
Resident(Vec<KimiExpertWeights>),
Stored {
store: Arc<ExpertStore<KimiExpertSource>>,
layout: KimiStoredExpertLayout,
n_experts: usize,
layer: u32,
},
}Expand description
How a Kimi layer’s routed experts are held: Resident is the
original always-constructed form (zero-copy MXFP4 mmap views);
Stored holds only the per-layer byte layout and materializes one
expert at a time from a bounded, lease-protected store shared by
every layer – same design (and same bit-equivalence argument) as
the GGUF path’s ferrox_models::decoder::ExpertBacking. Every
expert in a Kimi layer has identical dims, so one layout serves the
whole layer.
Variants§
Resident(Vec<KimiExpertWeights>)
Stored
Implementations§
Source§impl KimiExpertBacking
impl KimiExpertBacking
pub fn n_experts(&self) -> usize
Sourcepub fn with_expert<R>(
&self,
e: usize,
f: impl FnOnce(&KimiExpertWeights) -> R,
) -> R
pub fn with_expert<R>( &self, e: usize, f: impl FnOnce(&KimiExpertWeights) -> R, ) -> R
Runs f against expert e, materializing it from the store
first when store-backed (the lease pins the cache entry for
exactly f’s borrow).
Auto Trait Implementations§
impl Freeze for KimiExpertBacking
impl RefUnwindSafe for KimiExpertBacking
impl Send for KimiExpertBacking
impl Sync for KimiExpertBacking
impl Unpin for KimiExpertBacking
impl UnsafeUnpin for KimiExpertBacking
impl UnwindSafe for KimiExpertBacking
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more