#[non_exhaustive]pub struct GatherQmm<'a> {
pub transpose: bool,
pub sorted_indices: bool,
pub global_scale: Option<&'a Array>,
}Expand description
Options of gather_qmm, built with setters.
GatherQmm::default() multiplies by the transposed weights (MLX’s default).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.transpose: boolx · wᵀ (MLX’s default) rather than x · w.
sorted_indices: boolThe right indices are sorted (rows grouped by expert), so one kernel can walk each expert’s weights once.
global_scale: Option<&'a Array>nvfp4 only: one float32 scale per expert (w.weight’s batch shape), multiplying the
expert’s decoded weights by global_scale / (448 · 6). Needs the right indices.
Implementations§
Source§impl<'a> GatherQmm<'a>
impl<'a> GatherQmm<'a>
Sourcepub fn groups(rows: usize, experts: usize) -> bool
pub fn groups(rows: usize, experts: usize) -> bool
Whether a gather of rows sorted index rows over experts weight batches takes the
grouped kernel (each expert’s rows in tiles), rather than one product per row. Two
gathers that take the same kernel give a row the same bits, whatever other rows are
gathered with it: a caller batching gathers keeps each one’s bits when its rows and
the batch’s agree here.
Sourcepub fn sorted_indices(self, sorted_indices: bool) -> Self
pub fn sorted_indices(self, sorted_indices: bool) -> Self
Whether the right indices are sorted.
Sourcepub fn global_scale(self, global_scale: &'a Array) -> Self
pub fn global_scale(self, global_scale: &'a Array) -> Self
The per-expert nvfp4 global scale.
Trait Implementations§
impl<'a> Copy for GatherQmm<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for GatherQmm<'a>
impl<'a> !UnwindSafe for GatherQmm<'a>
impl<'a> Freeze for GatherQmm<'a>
impl<'a> Send for GatherQmm<'a>
impl<'a> Sync for GatherQmm<'a>
impl<'a> Unpin for GatherQmm<'a>
impl<'a> UnsafeUnpin for GatherQmm<'a>
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more