pub struct FuseSharedInputMatMul;Expand description
Detects two MatMul nodes with the same input and concatenates their weight matrices into a single larger MatMul.
Pattern: %a = matmul(%x, %w1) %b = matmul(%x, %w2) Becomes: %ab = matmul(%x, concat(%w1, %w2)) %a = narrow(%ab, …, 0, n1) %b = narrow(%ab, …, n1, n2)
This saves one full input read (the shared input is read once instead of twice). Critical for SwiGLU (fc11+fc12) and QKV fusion.
Trait Implementations§
Auto Trait Implementations§
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