pub struct ExpertRecordSpec {
pub inter: u64,
pub hidden: u64,
pub group_size: u64,
pub sub_align: u64,
/* private fields */
}Expand description
2026-09-25: Where each sub-buffer of an expert record sits, relative to the
record base; pack_record and unpack_record place and read bytes by it.
Every offset is a multiple of sub_align:
[ header (ExpertRecordHeader::BYTES) ]
[ gate.packed ][ gate.scale ]
[ up.packed ][ up.scale ]
[ down.packed ][ down.scale ]
[ pad to record_stride ]Fields§
§inter: u64§group_size: u64§sub_align: u64Implementations§
Source§impl ExpertRecordSpec
impl ExpertRecordSpec
Sourcepub fn new(inter: u64, hidden: u64, group_size: u64, sub_align: u64) -> Self
pub fn new(inter: u64, hidden: u64, group_size: u64, sub_align: u64) -> Self
2026-09-25: The record layout for experts of intermediate size inter
and hidden size hidden. Panics unless sub_align is a power of two.
pub fn proj_bytes(&self, p: Proj) -> ProjBytes
Sourcepub fn packed_off(&self, p: Proj) -> u64
pub fn packed_off(&self, p: Proj) -> u64
2026-09-25: Offset of p’s packed sub-buffer in the record.
Sourcepub fn scale_off(&self, p: Proj) -> u64
pub fn scale_off(&self, p: Proj) -> u64
2026-09-25: Offset of p’s scale sub-buffer in the record.
Sourcepub fn payload_bytes(&self) -> u64
pub fn payload_bytes(&self) -> u64
2026-09-25: Sum of the six sub-buffers, without header and padding.
Trait Implementations§
Source§impl Clone for ExpertRecordSpec
impl Clone for ExpertRecordSpec
Source§fn clone(&self) -> ExpertRecordSpec
fn clone(&self) -> ExpertRecordSpec
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 ExpertRecordSpec
impl Debug for ExpertRecordSpec
Source§impl PartialEq for ExpertRecordSpec
impl PartialEq for ExpertRecordSpec
impl Copy for ExpertRecordSpec
impl Eq for ExpertRecordSpec
impl StructuralPartialEq for ExpertRecordSpec
Auto Trait Implementations§
impl Freeze for ExpertRecordSpec
impl RefUnwindSafe for ExpertRecordSpec
impl Send for ExpertRecordSpec
impl Sync for ExpertRecordSpec
impl Unpin for ExpertRecordSpec
impl UnwindSafe for ExpertRecordSpec
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.