pub struct ExpertStreamBank { /* private fields */ }Expand description
One stacked [n_experts, n, k] GGUF expert bank kept on disk.
Implementations§
Source§impl ExpertStreamBank
impl ExpertStreamBank
pub fn open( name: String, path: &Path, base_offset: u64, expert_bytes: usize, n_experts: usize, dtype: GgmlDType, n: usize, k: usize, ) -> Result<Arc<Self>>
pub fn dtype(&self) -> GgmlDType
pub fn n_experts(&self) -> usize
pub fn expert_dims(&self) -> (usize, usize)
pub fn expert_bytes(&self) -> usize
Sourcepub fn logical_bytes(&self) -> usize
pub fn logical_bytes(&self) -> usize
Full size of the bank as if resident (shape/size accounting only).
Sourcepub fn repin(&self, max_swaps: usize) -> Result<usize>
pub fn repin(&self, max_swaps: usize) -> Result<usize>
Live tier adaptation (--repin). Decay the session heat, then swap up to
[REPIN_MAX_SWAPS] of the coldest pinned experts for the hottest streamed ones, each
only when the heat gap clears the hysteresis margin ([tier_pick_swap]). Correctness
neutral: the pinned set changes, never the bytes – a promoted expert is the same
file slice it would stream, so indexed_moe_forward output is bit-identical. Cold
experts fall back to the LRU (still warm), hot experts come from the LRU or disk.
Call at a turn boundary. Returns the number of swaps performed.
Sourcepub fn prefetch(self: &Arc<Self>, eid: u32)
pub fn prefetch(self: &Arc<Self>, eid: u32)
Enqueue a router-lookahead prefetch of eid. Best effort and
non-blocking: dropped when disabled, out of range, or the worker queue is full – a
missed prefetch only costs a later on-demand fetch, never correctness.
pub fn resident_bytes(&self) -> usize
Auto Trait Implementations§
impl !Freeze for ExpertStreamBank
impl RefUnwindSafe for ExpertStreamBank
impl Send for ExpertStreamBank
impl Sync for ExpertStreamBank
impl Unpin for ExpertStreamBank
impl UnsafeUnpin for ExpertStreamBank
impl UnwindSafe for ExpertStreamBank
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
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>
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>
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