pub struct ExpertFileWriter { /* private fields */ }Expand description
Offline writer: creates the manifest + one file per MoE layer and places records at their strided offsets. Plain buffered writes (no O_DIRECT) — alignment only matters on the streamer’s read path, and the record stride is already a 4 KiB multiple, so the files are O_DIRECT-readable.
Implementations§
Source§impl ExpertFileWriter
impl ExpertFileWriter
pub fn create(dir: &Path, index: ExpertIndex) -> Result<Self>
pub fn spec(&self) -> &ExpertRecordSpec
Sourcepub fn write_record(
&self,
key: ExpertKey,
header: &ExpertRecordHeader,
projs: &[ProjData<'_>; 3],
) -> Result<()>
pub fn write_record( &self, key: ExpertKey, header: &ExpertRecordHeader, projs: &[ProjData<'_>; 3], ) -> Result<()>
Assemble and write one expert record at its strided offset.
Auto Trait Implementations§
impl Freeze for ExpertFileWriter
impl RefUnwindSafe for ExpertFileWriter
impl Send for ExpertFileWriter
impl Sync for ExpertFileWriter
impl Unpin for ExpertFileWriter
impl UnwindSafe for ExpertFileWriter
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