pub struct ExpertLayout {
pub num_layers: u32,
pub num_experts: u32,
pub record_stride: u64,
pub fs_block_size: u64,
}Expand description
2026-09-25: File geometry of an expert store: one file per MoE layer
(ExpertIndex::file_name), each holding num_experts records back to back
at record_stride.
Fields§
§num_layers: u32§num_experts: u32§record_stride: u642026-09-25: Record stride on disk, a multiple of fs_block_size.
fs_block_size: u64Implementations§
Source§impl ExpertLayout
impl ExpertLayout
Sourcepub fn from_spec(
num_layers: u32,
num_experts: u32,
spec: &ExpertRecordSpec,
fs_block_size: u64,
) -> Self
pub fn from_spec( num_layers: u32, num_experts: u32, spec: &ExpertRecordSpec, fs_block_size: u64, ) -> Self
2026-09-25: record_stride is spec.raw_bytes() rounded up to a
multiple of fs_block_size.
Sourcepub fn bytes_per_layer(&self) -> u64
pub fn bytes_per_layer(&self) -> u64
2026-09-25: Bytes of one MoE layer’s file.
Sourcepub fn file_offset(&self, key: ExpertKey) -> u64
pub fn file_offset(&self, key: ExpertKey) -> u64
2026-09-25: Offset of key’s record in its layer file. Debug builds
assert that expert is in range.
pub fn record_id(&self, key: ExpertKey) -> ExpertRecordId
Sourcepub fn record_bytes(&self) -> u64
pub fn record_bytes(&self) -> u64
2026-09-25: Bytes of one record on disk: record_stride.
Trait Implementations§
Source§impl Clone for ExpertLayout
impl Clone for ExpertLayout
Source§fn clone(&self) -> ExpertLayout
fn clone(&self) -> ExpertLayout
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExpertLayout
impl Debug for ExpertLayout
Source§impl PartialEq for ExpertLayout
impl PartialEq for ExpertLayout
impl Copy for ExpertLayout
impl Eq for ExpertLayout
impl StructuralPartialEq for ExpertLayout
Auto Trait Implementations§
impl Freeze for ExpertLayout
impl RefUnwindSafe for ExpertLayout
impl Send for ExpertLayout
impl Sync for ExpertLayout
impl Unpin for ExpertLayout
impl UnwindSafe for ExpertLayout
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.