pub struct ExpertIndex {
pub version: u32,
pub num_moe_layers: u32,
pub num_experts: u32,
pub inter: u64,
pub hidden: u64,
pub group_size: u64,
pub sub_align: u64,
pub fs_block_size: u64,
pub record_stride: u64,
pub record_raw_bytes: u64,
pub file_template: String,
pub moe_layer_to_model_layer: Vec<u32>,
}Expand description
Directory manifest describing a built expert store. Serialized as
manifest.json next to the per-layer .xpr files. This is the streamer’s
entry point — everything it needs to reconstruct geometry and open files.
Fields§
§version: u32Format version; must equal ExpertRecordHeader::VERSION.
num_moe_layers: u32§num_experts: u32§inter: u64§group_size: u64§sub_align: u64§fs_block_size: u64§record_stride: u64§record_raw_bytes: u64§file_template: Stringprintf-style template for per-layer file names, e.g. experts_{:05}.xpr.
moe_layer_to_model_layer: Vec<u32>Dense MoE-layer index -> absolute model layer index. Lets the runtime map a model layer back to its expert file (dense attention layers are absent).
Implementations§
Source§impl ExpertIndex
impl ExpertIndex
pub const FILE_TEMPLATE: &'static str = "experts_{:05}.xpr"
pub const MANIFEST_NAME: &'static str = "manifest.json"
pub fn new( inter: u64, hidden: u64, group_size: u64, sub_align: u64, fs_block_size: u64, moe_layer_to_model_layer: Vec<u32>, num_experts: u32, ) -> Self
Sourcepub fn load(dir: &Path) -> Result<Self>
pub fn load(dir: &Path) -> Result<Self>
Load just the manifest (manifest.json) from a store dir — geometry
only, no file handles. Lets the streamer size its arena before opening a
tier. Validates the format version.
pub fn spec(&self) -> ExpertRecordSpec
pub fn layout(&self) -> ExpertLayout
Sourcepub fn file_name(&self, moe_layer: u32) -> String
pub fn file_name(&self, moe_layer: u32) -> String
Per-layer file name for a dense MoE-layer index.
Sourcepub fn total_bytes(&self) -> u64
pub fn total_bytes(&self) -> u64
Total on-disk bytes across all layer files.
Trait Implementations§
Source§impl Clone for ExpertIndex
impl Clone for ExpertIndex
Source§fn clone(&self) -> ExpertIndex
fn clone(&self) -> ExpertIndex
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more