pub enum MatmulTransformAction {
Keep,
MergeBatches {
rows: usize,
},
}Expand description
The action to take for a batched matmul with a broadcast rhs.
Variants§
Keep
Launch the matmul as-is.
MergeBatches
Fold every lhs/out batch dim into the rows: [.., b, m, k] @ [.., 1, k, n]
runs as one [b*m, k] @ [k, n] matmul against the shared rhs, instead of
b matmuls that each re-read it.
Implementations§
Source§impl MatmulTransformAction
impl MatmulTransformAction
Sourcepub fn apply(&self, meta: &mut Metadata)
pub fn apply(&self, meta: &mut Metadata)
Apply the action to one merged operand (lhs or out): fold the batch dims into the rows, in place. A pure metadata rewrite — the buffer is shared.
Requires batch-contiguous rows (see MatmulTransformAnalysis); the merge keeps the rank, with every batch dim set to 1.
Trait Implementations§
Source§impl Clone for MatmulTransformAction
impl Clone for MatmulTransformAction
Source§fn clone(&self) -> MatmulTransformAction
fn clone(&self) -> MatmulTransformAction
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for MatmulTransformAction
Source§impl Debug for MatmulTransformAction
impl Debug for MatmulTransformAction
impl Eq for MatmulTransformAction
Source§impl PartialEq for MatmulTransformAction
impl PartialEq for MatmulTransformAction
impl StructuralPartialEq for MatmulTransformAction
Auto Trait Implementations§
impl Freeze for MatmulTransformAction
impl RefUnwindSafe for MatmulTransformAction
impl Send for MatmulTransformAction
impl Sync for MatmulTransformAction
impl Unpin for MatmulTransformAction
impl UnsafeUnpin for MatmulTransformAction
impl UnwindSafe for MatmulTransformAction
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
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.