Skip to main content

MixedGemm

Struct MixedGemm 

Source
pub struct MixedGemm<N>(/* private fields */);
Available on crate feature half only.
Expand description

The widen-and-FMA mixed-precision GEMM family: Lhs = Rhs = Out = N (a NarrowFloat, either f16 or bf16), with Acc = f32

Trait Implementations§

Source§

impl<N> Clone for MixedGemm<N>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<N> Copy for MixedGemm<N>

Source§

impl<N> KernelFamily for MixedGemm<N>
where N: NarrowFloat,

Source§

const OUT_IS_ACC: bool = false

Whether a running Acc partial sum can round-trip through C (Out) between kc depth panels without losing precision. This is true exactly when Out == Acc, which is also the default, so a family need not set it unless it narrows on store Read more
Source§

type Lhs = N

Left-hand input element type
Source§

type Rhs = N

Right-hand input element type
Source§

type Acc = f32

Accumulator element type. This is Lhs::Acc in every shipped family. That is f32 or f64 for float, i32 for i8, f32 for f16 or bf16, and the same as Lhs for complex
Source§

type Out = N

Output element type
Source§

unsafe fn pack_lhs( dst: *mut N, src: *const N, rs: isize, cs: isize, mc: usize, kc: usize, mr: usize, )

Pack an mc x kc LHS block into micropanel-major layout. The result is ceil(mc/mr) panels of mr rows each. Every panel stores one depth step at a time, with mr contiguous rows per step (mr == MR_REG*LANES). A short tail row-block is zero-padded up to mr Read more
Source§

unsafe fn pack_rhs( dst: *mut N, src: *const N, rs: isize, cs: isize, kc: usize, nc: usize, nr: usize, )

Pack a kc x nc RHS block into micropanel-major layout. The result is ceil(nc/nr) panels of nr columns each, with every panel stored one depth step at a time and nr contiguous columns per step. A short tail column-block is zero-padded up to nr Read more
Source§

unsafe fn microkernel_epi<S, E, const MR_REG: usize, const NR: usize>( simd: S, kc: usize, alpha: f32, beta: f32, alpha_status: AlphaStatus, beta_status: BetaStatus, a: *const N, a_cs: isize, b: *const N, b_rs: isize, b_cs: isize, c: *mut N, rsc: isize, csc: isize, mr_eff: usize, nr_eff: usize, row0: usize, col0: usize, last_k: bool, epi: &E, scratch: *mut f32, )
where S: KernelSimd<N, N, f32, N>, E: Epilogue<Self>,

Compute one MR x NR tile and store the fused Epilogue E applied to each element. row0 and col0 are the tile’s origin in the oriented problem frame, so a per-row or per-column bias can resolve its absolute base. last_k marks the final depth panel, the only one on which an OUT_IS_ACC family may apply the epilogue. Earlier panels store raw Acc partials, per the contract on KernelFamily::OUT_IS_ACC Read more
Source§

const FORCE_PACK_LHS: bool = false

Force the driver to always pack the LHS, bypassing its cost-based pack or no-pack decision. Set this when packing is not a plain copy, such as a k-group interleave, a signedness bias, or a conjugation. In that case the driver’s in-place read path would be wrong, not just slower, so the transform must always run. The default is false
Source§

const FORCE_PACK_RHS: bool = false

Source§

const DEPTH_MULTIPLE: usize = 1

Depth-panel padding multiple. The driver rounds every packed panel’s depth up to this before it sizes and addresses the A/B pack buffers. The default, 1, is a no-op for every homogeneous or widen-and-multiply family Read more
Source§

unsafe fn microkernel<S, const MR_REG: usize, const NR: usize>( simd: S, kc: usize, alpha: Self::Acc, beta: Self::Acc, alpha_status: AlphaStatus, beta_status: BetaStatus, a: *const Self::Lhs, a_cs: isize, b: *const Self::Rhs, b_rs: isize, b_cs: isize, c: *mut Self::Out, rsc: isize, csc: isize, mr_eff: usize, nr_eff: usize, scratch: *mut Self::Acc, )
where S: KernelSimd<Self::Lhs, Self::Rhs, Self::Acc, Self::Out>,

Compute one MR x NR output tile and store C <- combine(alpha*A*B, beta*C). MR == MR_REG*LANES, where LANES is the Acc lane count for token S Read more

Auto Trait Implementations§

§

impl<N> Freeze for MixedGemm<N>

§

impl<N> RefUnwindSafe for MixedGemm<N>
where N: RefUnwindSafe,

§

impl<N> Send for MixedGemm<N>
where N: Send,

§

impl<N> Sync for MixedGemm<N>
where N: Sync,

§

impl<N> Unpin for MixedGemm<N>
where N: Unpin,

§

impl<N> UnsafeUnpin for MixedGemm<N>

§

impl<N> UnwindSafe for MixedGemm<N>
where N: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.