docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
sdfg::gpu::rocm::RocmMmaSupport Struct Reference

#include <sdfg/targets/rocm/rocm_arch.h>

Inheritance diagram for sdfg::gpu::rocm::RocmMmaSupport:
[legend]

Public Member Functions

 RocmMmaSupport (bool base_support, bool f32_support, uint16_t threads, uint16_t int8_block_k=0)
MmaBlockSize int8_block_size () const
 The block size Int8 matmuls use by default, at the full Int8 rate.
bool supported_types (types::PrimitiveType input_type, types::PrimitiveType output_type) const override
types::PrimitiveType get_accumulator_type (types::PrimitiveType input_type, types::PrimitiveType output_type, types::PrimitiveType desired_acc_type) const override
bool is_valid_block_size (const MmaBlockSize &block_size, types::PrimitiveType input_type, types::PrimitiveType acc_type) const override
std::optional< GpuMmaTiling > try_get_mma_tiling (const MmaBlockSize &block_size, const BlockCounts *wave_tile_hint, const symbolic::MultiExpression &res_shape, types::PrimitiveType acc_type, bool ceil_counts=false) const
std::optional< GpuMmaTiling > get_mma_tiling (const symbolic::MultiExpression &res_shape, types::PrimitiveType input_type, types::PrimitiveType acc_type, const MmaBlockSize *block_size_hint, const BlockCounts *wave_tile_hint) const override
std::optional< GpuMmaTiling > get_ragged_mma_tiling (const symbolic::MultiExpression &padded_shape, types::PrimitiveType input_type, types::PrimitiveType output_type, types::PrimitiveType acc_type, const MmaBlockSize *block_size_hint, const BlockCounts *wave_tile_hint) const override
 Tiling for a ragged problem: padded_shape is a constant upper bound of each extent that need not be a multiple of the MMA block.
void set_mma_fragment_storage_type (types::StorageType &storage_type, const GpuMmaTiling &size, MmaFragmentType type, MmaFragmentLayout layout) const override
data_flow::ImplementationType get_mma_impl_type (const GpuMmaTiling &tiling) const override
void emit_block_frag_type (std::ostream &os, const types::StorageType &storage_type, types::PrimitiveType element_type) const
std::vector< MmaBlockSize > get_supported_block_sizes (types::PrimitiveType input_type, types::PrimitiveType acc_type) const override
Public Member Functions inherited from sdfg::gpu::GpuMmaSupport
virtual ~GpuMmaSupport ()=default
types::PrimitiveType get_accumulator_type (types::PrimitiveType input_type, types::PrimitiveType output_type) const
 GpuMmaSupport ()=default

Static Public Member Functions

static bool is_mma_type (const types::StorageType &storage)
static RocmMmaVariant select_variant (const GpuMmaTiling &tiling)
static void emit_bare_fragment_decl_type (std::ostream &os, MmaFragmentType type, const MmaBlockSize &dims, MmaFragmentLayout layout, types::PrimitiveType scalar_type, std::optional< std::pair< int, int > > coop_dims)
static void emit_block_frag_type (std::ostream &os, MmaFragmentType type, const MmaBlockSize &dims, MmaFragmentLayout layout, types::PrimitiveType scalar_type, std::optional< std::pair< int, int > > coop_dims)
Static Public Member Functions inherited from sdfg::gpu::GpuMmaSupport
static int get_integer_block_count (const symbolic::Expression &size, uint16_t block_size)
static int get_ceil_block_count (const symbolic::Expression &size, uint16_t block_size)
 ceil(size / block_size) for a positive integer size, otherwise 0.

Public Attributes

const bool base_support
const bool f32_support
const uint16_t threads_per_mma_block
const uint16_t int8_block_k
 K of the native Int8 x Int8 -> Int32 instruction of 16x16 blocks (16 on CDNA2 and RDNA, 32 on CDNA3, where rocWMMA pads 16x16x16 to 16x16x32 at half the throughput); 0 without Int8 matrix support.

Static Public Attributes

static constexpr const char * MMA_FRAGMENT_STORAGE_TYPE = "ROCM_MMA"
static constexpr const char * MMA_REGS_STORAGE_TYPE = "ROCM_MMA_REGS"

Static Protected Attributes

static constexpr MmaBlockSize DEFAULT_BLOCK_SIZE = {16, 16, 16}
static constexpr MmaBlockSize CDNA_BLOCK_SIZE = {32, 32, 8}

Additional Inherited Members

Static Protected Member Functions inherited from sdfg::gpu::GpuMmaSupport
static int get_storage_type_arg_as_int (const types::StorageType &storage, int idx)

Constructor & Destructor Documentation

◆ RocmMmaSupport()

sdfg::gpu::rocm::RocmMmaSupport::RocmMmaSupport ( bool base_support,
bool f32_support,
uint16_t threads,
uint16_t int8_block_k = 0 )
inline

Member Function Documentation

◆ emit_bare_fragment_decl_type()

void sdfg::gpu::rocm::RocmMmaSupport::emit_bare_fragment_decl_type ( std::ostream & os,
MmaFragmentType type,
const MmaBlockSize & dims,
MmaFragmentLayout layout,
types::PrimitiveType scalar_type,
std::optional< std::pair< int, int > > coop_dims )
static

◆ emit_block_frag_type() [1/2]

void sdfg::gpu::rocm::RocmMmaSupport::emit_block_frag_type ( std::ostream & os,
const types::StorageType & storage_type,
types::PrimitiveType element_type ) const

◆ emit_block_frag_type() [2/2]

void sdfg::gpu::rocm::RocmMmaSupport::emit_block_frag_type ( std::ostream & os,
MmaFragmentType type,
const MmaBlockSize & dims,
MmaFragmentLayout layout,
types::PrimitiveType scalar_type,
std::optional< std::pair< int, int > > coop_dims )
static

◆ get_accumulator_type()

types::PrimitiveType sdfg::gpu::rocm::RocmMmaSupport::get_accumulator_type ( types::PrimitiveType input_type,
types::PrimitiveType output_type,
types::PrimitiveType desired_acc_type ) const
overridevirtual

◆ get_mma_impl_type()

data_flow::ImplementationType sdfg::gpu::rocm::RocmMmaSupport::get_mma_impl_type ( const GpuMmaTiling & tiling) const
overridevirtual

◆ get_mma_tiling()

std::optional< GpuMmaTiling > sdfg::gpu::rocm::RocmMmaSupport::get_mma_tiling ( const symbolic::MultiExpression & res_shape,
types::PrimitiveType input_type,
types::PrimitiveType acc_type,
const MmaBlockSize * block_size_hint,
const BlockCounts * wave_tile_hint ) const
overridevirtual

◆ get_ragged_mma_tiling()

std::optional< GpuMmaTiling > sdfg::gpu::rocm::RocmMmaSupport::get_ragged_mma_tiling ( const symbolic::MultiExpression & padded_shape,
types::PrimitiveType input_type,
types::PrimitiveType output_type,
types::PrimitiveType acc_type,
const MmaBlockSize * block_size_hint,
const BlockCounts * wave_tile_hint ) const
overridevirtual

Tiling for a ragged problem: padded_shape is a constant upper bound of each extent that need not be a multiple of the MMA block.

Fragments crossing the exact extent are clipped (zero-filled loads, masked stores; see GpuMmaFromMemoryLayout::rows/cols). Targets without masked fragment transfers return nullopt.

Reimplemented from sdfg::gpu::GpuMmaSupport.

◆ get_supported_block_sizes()

std::vector< MmaBlockSize > sdfg::gpu::rocm::RocmMmaSupport::get_supported_block_sizes ( types::PrimitiveType input_type,
types::PrimitiveType acc_type ) const
overridevirtual

◆ int8_block_size()

MmaBlockSize sdfg::gpu::rocm::RocmMmaSupport::int8_block_size ( ) const
inline

The block size Int8 matmuls use by default, at the full Int8 rate.

◆ is_mma_type()

bool sdfg::gpu::rocm::RocmMmaSupport::is_mma_type ( const types::StorageType & storage)
static

◆ is_valid_block_size()

bool sdfg::gpu::rocm::RocmMmaSupport::is_valid_block_size ( const MmaBlockSize & block_size,
types::PrimitiveType input_type,
types::PrimitiveType acc_type ) const
overridevirtual

◆ select_variant()

RocmMmaVariant sdfg::gpu::rocm::RocmMmaSupport::select_variant ( const GpuMmaTiling & tiling)
static

◆ set_mma_fragment_storage_type()

void sdfg::gpu::rocm::RocmMmaSupport::set_mma_fragment_storage_type ( types::StorageType & storage_type,
const GpuMmaTiling & size,
MmaFragmentType type,
MmaFragmentLayout layout ) const
overridevirtual

◆ supported_types()

bool sdfg::gpu::rocm::RocmMmaSupport::supported_types ( types::PrimitiveType input_type,
types::PrimitiveType output_type ) const
overridevirtual

◆ try_get_mma_tiling()

std::optional< GpuMmaTiling > sdfg::gpu::rocm::RocmMmaSupport::try_get_mma_tiling ( const MmaBlockSize & block_size,
const BlockCounts * wave_tile_hint,
const symbolic::MultiExpression & res_shape,
types::PrimitiveType acc_type,
bool ceil_counts = false ) const

Member Data Documentation

◆ base_support

const bool sdfg::gpu::rocm::RocmMmaSupport::base_support

◆ CDNA_BLOCK_SIZE

MmaBlockSize sdfg::gpu::rocm::RocmMmaSupport::CDNA_BLOCK_SIZE = {32, 32, 8}
staticconstexprprotected

◆ DEFAULT_BLOCK_SIZE

MmaBlockSize sdfg::gpu::rocm::RocmMmaSupport::DEFAULT_BLOCK_SIZE = {16, 16, 16}
staticconstexprprotected

◆ f32_support

const bool sdfg::gpu::rocm::RocmMmaSupport::f32_support

◆ int8_block_k

const uint16_t sdfg::gpu::rocm::RocmMmaSupport::int8_block_k

K of the native Int8 x Int8 -> Int32 instruction of 16x16 blocks (16 on CDNA2 and RDNA, 32 on CDNA3, where rocWMMA pads 16x16x16 to 16x16x32 at half the throughput); 0 without Int8 matrix support.

◆ MMA_FRAGMENT_STORAGE_TYPE

const char* sdfg::gpu::rocm::RocmMmaSupport::MMA_FRAGMENT_STORAGE_TYPE = "ROCM_MMA"
staticconstexpr

◆ MMA_REGS_STORAGE_TYPE

const char* sdfg::gpu::rocm::RocmMmaSupport::MMA_REGS_STORAGE_TYPE = "ROCM_MMA_REGS"
staticconstexpr

◆ threads_per_mma_block

const uint16_t sdfg::gpu::rocm::RocmMmaSupport::threads_per_mma_block

The documentation for this struct was generated from the following file: