StageMatmulFamily

Trait StageMatmulFamily 

Source
pub trait StageMatmulFamily:
    Send
    + Sync
    + 'static {
    type Matmul<MP: MatmulPrecision, TL: TilingLayout, TR: TilingLayout, TA: TilingLayout, TO: TilingLayout>: StageMatmul<MP, Config = Self::Config, LhsStage = <Self::LhsStage as StageFamily>::Stage<LhsS<MP>, TL>, RhsStage = <Self::RhsStage as StageFamily>::Stage<RhsS<MP>, TR>, AccStage = <Self::AccStage as StageFamily>::Stage<AccS<MP>, TA>, OutStage = <Self::OutStage as StageFamily<ReadWrite>>::Stage<AccS<MP>, TO>>;
    type LhsStage: StageFamily;
    type RhsStage: StageFamily;
    type AccStage: StageFamily;
    type OutStage: StageFamily<ReadWrite>;
    type Config: StageConfig;

    // Required method
    fn setup<MP: MatmulPrecision, R: Runtime>(
        client: &ComputeClient<R::Server>,
        problem: &MatmulProblem,
        selection: &MatmulSelection,
        line_sizes: &MatmulLineSizes,
        num_stages: NumStages,
        max_global_readers: Option<MaxGlobalReaderPlanes>,
        ordered: bool,
    ) -> Result<Self::Config, MatmulSetupError>;

    // Provided method
    fn filter_line_sizes(
        available_line_sizes: AvailableLineSizes,
    ) -> AvailableLineSizes { ... }
}
Expand description

A family of StageMatmul implementations that operate with any precision.

Required Associated Types§

Source

type Matmul<MP: MatmulPrecision, TL: TilingLayout, TR: TilingLayout, TA: TilingLayout, TO: TilingLayout>: StageMatmul<MP, Config = Self::Config, LhsStage = <Self::LhsStage as StageFamily>::Stage<LhsS<MP>, TL>, RhsStage = <Self::RhsStage as StageFamily>::Stage<RhsS<MP>, TR>, AccStage = <Self::AccStage as StageFamily>::Stage<AccS<MP>, TA>, OutStage = <Self::OutStage as StageFamily<ReadWrite>>::Stage<AccS<MP>, TO>>

The specific [TileMatmul] implementation associated with this family.

Source

type LhsStage: StageFamily

Stage family for Lhs

Source

type RhsStage: StageFamily

Stage family for Rhs

Source

type AccStage: StageFamily

Stage family for Acc

Source

type OutStage: StageFamily<ReadWrite>

Stage family for Out

Source

type Config: StageConfig

The configuration type associated with this matmul family.

Required Methods§

Source

fn setup<MP: MatmulPrecision, R: Runtime>( client: &ComputeClient<R::Server>, problem: &MatmulProblem, selection: &MatmulSelection, line_sizes: &MatmulLineSizes, num_stages: NumStages, max_global_readers: Option<MaxGlobalReaderPlanes>, ordered: bool, ) -> Result<Self::Config, MatmulSetupError>

Constructs the configuration based on the matmul problem, selection, line sizes, number of stages, maximum of tasks per plane, and whether the algorithm is an ordered variant

This function may return an error if the configuration cannot be supported on the current runtime.

Provided Methods§

Source

fn filter_line_sizes( available_line_sizes: AvailableLineSizes, ) -> AvailableLineSizes

Filters out line sizes that are incompatible with this matmul family.

By default, returns the input unchanged.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<TM: TileMatmulFamily<LhsTile = StageIn::TileKind, RhsTile = StageIn::TileKind, AccTile = StageAcc::TileKind, OutTile = Strided>, StageIn: StageFamily, StageAcc: StageFamily> StageMatmulFamily for UnitMatmulFamily<TM, StageIn, StageAcc>

Source§

type LhsStage = StageIn

Source§

type RhsStage = StageIn

Source§

type AccStage = StageAcc

Source§

type OutStage = PartitionedStageFamily

Source§

type Matmul<MP: MatmulPrecision, TL: TilingLayout, TR: TilingLayout, TA: TilingLayout, TO: TilingLayout> = PartitionedStageMatmul<MP, <TM as TileMatmulFamily>::Matmul<<<MP as MatmulPrecision>::Lhs as MatrixPrecision>::Register, <<MP as MatmulPrecision>::Rhs as MatrixPrecision>::Register, <<MP as MatmulPrecision>::Acc as MatrixPrecision>::Register>, <StageIn as StageFamily>::Stage<<<<MP as MatmulSpec>::Precision as MatmulPrecision>::Lhs as MatrixPrecision>::Stage, TL>, <StageIn as StageFamily>::Stage<<<<MP as MatmulSpec>::Precision as MatmulPrecision>::Rhs as MatrixPrecision>::Stage, TR>, <StageAcc as StageFamily>::Stage<<<<MP as MatmulSpec>::Precision as MatmulPrecision>::Acc as MatrixPrecision>::Stage, TA>, PartitionedStage<<<<MP as MatmulSpec>::Precision as MatmulPrecision>::Acc as MatrixPrecision>::Stage>, UnitPartitioner, UnitPartitionedStageConfig<<<TM as TileMatmulFamily>::Matmul<<<MP as MatmulPrecision>::Lhs as MatrixPrecision>::Register, <<MP as MatmulPrecision>::Rhs as MatrixPrecision>::Register, <<MP as MatmulPrecision>::Acc as MatrixPrecision>::Register> as TileMatmul<<<MP as MatmulPrecision>::Lhs as MatrixPrecision>::Register, <<MP as MatmulPrecision>::Rhs as MatrixPrecision>::Register, <<MP as MatmulPrecision>::Acc as MatrixPrecision>::Register>>::Config>>

Source§

type Config = UnitPartitionedStageConfig<<TM as TileMatmulFamily>::Config>

Source§

impl<TM: TileMatmulFamily<OutTile = Strided>, StageLhs: StageFamily<TileKind = TM::LhsTile>, StageRhs: StageFamily<TileKind = TM::RhsTile>, StageAcc: StageFamily<TileKind = TM::AccTile>> StageMatmulFamily for PlaneMatmulFamily<TM, StageLhs, StageRhs, StageAcc>

Source§

type LhsStage = StageLhs

Source§

type RhsStage = StageRhs

Source§

type AccStage = StageAcc

Source§

type OutStage = PartitionedStageFamily

Source§

type Matmul<MP: MatmulPrecision, TL: TilingLayout, TR: TilingLayout, TA: TilingLayout, TO: TilingLayout> = PartitionedStageMatmul<MP, <TM as TileMatmulFamily>::Matmul<<<MP as MatmulPrecision>::Lhs as MatrixPrecision>::Register, <<MP as MatmulPrecision>::Rhs as MatrixPrecision>::Register, <<MP as MatmulPrecision>::Acc as MatrixPrecision>::Register>, <StageLhs as StageFamily>::Stage<<<<MP as MatmulSpec>::Precision as MatmulPrecision>::Lhs as MatrixPrecision>::Stage, TL>, <StageRhs as StageFamily>::Stage<<<<MP as MatmulSpec>::Precision as MatmulPrecision>::Rhs as MatrixPrecision>::Stage, TR>, <StageAcc as StageFamily>::Stage<<<<MP as MatmulSpec>::Precision as MatmulPrecision>::Acc as MatrixPrecision>::Stage, TA>, PartitionedStage<<<<MP as MatmulSpec>::Precision as MatmulPrecision>::Acc as MatrixPrecision>::Stage>, PlanePartitioner, PlanePartitionedStageConfig<<<TM as TileMatmulFamily>::Matmul<<<MP as MatmulPrecision>::Lhs as MatrixPrecision>::Register, <<MP as MatmulPrecision>::Rhs as MatrixPrecision>::Register, <<MP as MatmulPrecision>::Acc as MatrixPrecision>::Register> as TileMatmul<<<MP as MatmulPrecision>::Lhs as MatrixPrecision>::Register, <<MP as MatmulPrecision>::Rhs as MatrixPrecision>::Register, <<MP as MatmulPrecision>::Acc as MatrixPrecision>::Register>>::Config>>

Source§

type Config = PlanePartitionedStageConfig<<TM as TileMatmulFamily>::Config>