pub enum FusionPattern {
MatMulBias,
MatMulBiasRelu,
MatMulBiasGelu,
ConvBatchNorm,
ConvBatchNormRelu,
ElementwiseChain,
Softmax,
LayerNorm,
GeluApprox,
AddRelu,
MulAdd,
}Expand description
Common fusion patterns.
Variants§
MatMulBias
MatMul followed by bias addition.
MatMulBiasRelu
MatMul followed by bias addition and ReLU.
MatMulBiasGelu
MatMul followed by bias addition and GELU.
ConvBatchNorm
Convolution followed by batch normalization.
ConvBatchNormRelu
Convolution followed by batch normalization and ReLU.
ElementwiseChain
Multiple elementwise operations.
Softmax
Softmax pattern (exp, sum, div).
LayerNorm
Layer normalization pattern.
GeluApprox
GELU approximation pattern.
AddRelu
Add followed by ReLU.
MulAdd
Multiply followed by add (FMA).
Implementations§
Source§impl FusionPattern
impl FusionPattern
Sourcepub fn estimated_speedup(&self) -> f32
pub fn estimated_speedup(&self) -> f32
Returns estimated speedup from this fusion.
Sourcepub fn is_memory_bound(&self) -> bool
pub fn is_memory_bound(&self) -> bool
Returns whether this pattern is memory-bound (vs compute-bound).
Trait Implementations§
Source§impl Clone for FusionPattern
impl Clone for FusionPattern
Source§fn clone(&self) -> FusionPattern
fn clone(&self) -> FusionPattern
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FusionPattern
impl Debug for FusionPattern
Source§impl Display for FusionPattern
impl Display for FusionPattern
Source§impl Hash for FusionPattern
impl Hash for FusionPattern
Source§impl PartialEq for FusionPattern
impl PartialEq for FusionPattern
impl Copy for FusionPattern
impl Eq for FusionPattern
impl StructuralPartialEq for FusionPattern
Auto Trait Implementations§
impl Freeze for FusionPattern
impl RefUnwindSafe for FusionPattern
impl Send for FusionPattern
impl Sync for FusionPattern
impl Unpin for FusionPattern
impl UnwindSafe for FusionPattern
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
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>
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 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>
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