pub struct ExpertRecordSpec {
pub inter: u64,
pub hidden: u64,
pub group_size: u64,
pub sub_align: u64,
/* private fields */
}Expand description
Where every sub-buffer of one expert record sits, relative to the record’s
base. Shared by the offline builder (to place bytes) and the streamer (to
compute the device pointers it patches into the ExpertPtrTable).
Layout within a record (all offsets are relative to the record base and are
aligned to sub_align, which must satisfy the fused MoE kernels’ pointer
alignment requirement):
[ 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
Build the canonical record layout for a model whose experts have the
given inter(mediate) and hidden dims. sub_align is the alignment
applied to every sub-buffer (256 is a safe default for CUTLASS/MMQ).
pub fn proj_bytes(&self, p: Proj) -> ProjBytes
Sourcepub fn packed_off(&self, p: Proj) -> u64
pub fn packed_off(&self, p: Proj) -> u64
Offset of a projection’s packed-weight sub-buffer within the record.
Sourcepub fn scale_off(&self, p: Proj) -> u64
pub fn scale_off(&self, p: Proj) -> u64
Offset of a projection’s block-scale sub-buffer within the record.
Sourcepub fn raw_bytes(&self) -> u64
pub fn raw_bytes(&self) -> u64
Total raw record bytes (header + sub-buffers), before I/O-block rounding.
Sourcepub fn payload_bytes(&self) -> u64
pub fn payload_bytes(&self) -> u64
Sum of all six sub-buffer payloads (excludes header + alignment padding).
Trait Implementations§
Source§impl Clone for ExpertRecordSpec
impl Clone for ExpertRecordSpec
Source§fn clone(&self) -> ExpertRecordSpec
fn clone(&self) -> ExpertRecordSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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
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
key and return true if they are equal.