device_grouped_contraction_multiple_d_xdl_cshuffle.hpp Source File#
device_grouped_contraction_multiple_d_xdl_cshuffle.hpp
Go to the documentation of this file.
float launch_and_time_kernel(const StreamConfig &stream_config, F kernel, dim3 grid_dim, dim3 block_dim, std::size_t lds_byte, Args... args)
Definition host_utility/kernel_launch.hpp:14
Definition convolution_backward_data_specialization.hpp:8
TensorSpecialization
Definition tensor_specialization.hpp:11
@ Packed
Definition tensor_specialization.hpp:13
GemmSpecialization
Definition gemm_specialization.hpp:11
Definition convolution_backward_data_specialization.hpp:7
CK_TILE_HOST float launch_kernel(const stream_config &s, Callables &&... callables)
Definition tile/host/kernel_launch.hpp:173
Definition ck.hpp:268
__host__ __device__ constexpr auto make_multi_index(Xs &&... xs)
Definition array_multi_index.hpp:15
__host__ __device__ T CK_CONSTANT_ADDRESS_SPACE * cast_pointer_to_constant_address_space(T *p)
Definition amd_address_space.hpp:35
__host__ __device__ constexpr auto make_naive_tensor_descriptor(const Tuple< Lengths... > &lengths, const Tuple< Strides... > &strides)
Definition tensor_descriptor_helper.hpp:49
typename tuple_element< I, TTuple >::type tuple_element_t
Definition utility/tuple.hpp:208
__host__ __device__ constexpr auto make_merge_transform(const LowLengths &low_lengths)
Definition multi_index_transform_helper.hpp:55
__host__ __device__ constexpr auto get_container_subset(const Array< T, N > &arr, Sequence< Is... >)
Definition utility/container_helper.hpp:346
__host__ __device__ constexpr auto container_reduce(const Container &x, Reduce reduce, Init init, Number< IBegin >=Number< 0 >{}, Number< IEnd >=Number< Container::Size()>{}, Number< IStep >=Number< 1 >{})
Definition utility/container_helper.hpp:111
__host__ __device__ constexpr auto generate_tuple(F &&f, Number< N >)
Definition tuple_helper.hpp:21
__host__ __device__ constexpr auto make_tuple(Xs &&... xs)
Definition utility/tuple.hpp:211
__host__ __device__ constexpr auto transform_tensor_descriptor(const OldTensorDescriptor &old_tensor_desc, const NewTransforms &new_transforms, NewLowerDimensionOldVisibleIdss, NewUpperDimensionNewVisibleIdss)
Definition tensor_description/tensor_descriptor.hpp:319
__global__ void kernel_grouped_contraction_multiple_d_xdl_cshuffle(const void CK_CONSTANT_ADDRESS_SPACE *contraction_args, const index_t group_count, const AElementwiseOperation a_element_op, const BElementwiseOperation b_element_op, const CDEElementwiseOperation cde_element_op)
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:33
__device__ T * cast_pointer_to_generic_address_space(T CK_CONSTANT_ADDRESS_SPACE *p)
Definition amd_address_space.hpp:24
constexpr LoopScheduler make_default_loop_scheduler()
Definition loop_scheduler.hpp:20
Definition ck/stream_config.hpp:10
Definition gridwise_gemm_multiple_d_xdl_cshuffle.hpp:78
__host__ static __device__ constexpr auto MakeDefaultBGridDescriptor_BK0_N_BK1(const BGridDesc_N_K &b_grid_desc_n_k)
Definition gridwise_gemm_multiple_d_xdl_cshuffle.hpp:207
__host__ static __device__ constexpr auto MakeDefaultAGridDescriptor_AK0_M_AK1(const AGridDesc_M_K &a_grid_desc_m_k)
Definition gridwise_gemm_multiple_d_xdl_cshuffle.hpp:190
__host__ static __device__ constexpr bool CheckValidity(const AGridDesc_M_K &a_grid_desc_m_k, const BGridDesc_N_K &b_grid_desc_n_k, const DsGridDesc_M_N &ds_grid_desc_m_n, const EGridDesc_M_N &e_grid_desc_m_n, const Block2ETileMap &, index_t k_batch=1)
Definition gridwise_gemm_multiple_d_xdl_cshuffle.hpp:334
__host__ static __device__ constexpr auto MakeEGridDescriptor_MBlock_MPerBlock_NBlock_NPerBlock(const EGridDesc_M_N &e_grid_desc_m_n)
Definition gridwise_gemm_multiple_d_xdl_cshuffle.hpp:224
__host__ static __device__ constexpr auto MakeDefaultBlock2ETileMap(const EGridDesc_M_N &e_grid_desc_m_n)
Definition gridwise_gemm_multiple_d_xdl_cshuffle.hpp:257
__host__ static __device__ constexpr auto MakeDsGridDescriptor_MBlock_MPerBlock_NBlock_NPerBlock(const DsGridDesc_M_N &ds_grid_desc_m_n)
Definition gridwise_gemm_multiple_d_xdl_cshuffle.hpp:245
Definition utility/sequence.hpp:43
typename conditional< kHasContent, type0, type1 >::type type
Definition utility/sequence.hpp:271
Definition utility/integral_constant.hpp:20
Definition utility/math.hpp:34
Definition functional2.hpp:33
Definition device_base.hpp:197
void * p_workspace_
Definition device_base.hpp:204
BaseArgument()=default
BaseInvoker()=default
Definition device_grouped_contraction_multiple_d.hpp:17
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:486
DsGridDesc_M_N ds_grid_desc_m_n_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:490
index_t b_nz_stride_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:497
index_t a_mz_stride_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:495
index_t b_kz_stride_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:498
EGridDesc_M_N e_grid_desc_m_n_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:491
BGridDesc_N_K b_grid_desc_n_k_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:489
index_t a_kz_stride_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:496
std::array< index_t, NumDTensor > ds_nz_stride_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:499
AGridDesc_M_K a_grid_desc_m_k_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:488
index_t e_nz_stride_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:501
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:465
const BDataType * p_b_grid_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:468
EGridDesc_MBlock_MPerBlock_NBlock_NPerBlock e_grid_desc_mblock_mperblock_nblock_nperblock_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:477
GroupedContractionBlock2ETileMap block_2_etile_map_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:480
GridwiseGemm64::DsGridPointer p_ds_grid_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:469
EDataType * p_e_grid_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:470
DsGridDesc_MBlock_MPerBlock_NBlock_NPerBlock ds_grid_desc_mblock_mperblock_nblock_nperblock_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:476
ck::index_t block_end_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:482
AGridDesc_AK0_M_AK1 a_grid_desc_ak0_m_ak1_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:473
ck::index_t block_start_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:482
const ADataType * p_a_grid_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:467
BGridDesc_BK0_N_BK1 b_grid_desc_bk0_n_bk1_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:474
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:428
__host__ __device__ bool ValidCTileIndex(const CTileIdx &c_tile_idx, const CTileDim &c_tile_dim) const
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:449
__host__ __device__ constexpr auto CalculateBottomIndex(const TopIdx &idx_top) const
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:441
__host__ bool CheckValidity(const EGridDesc_M_N &e_grid_desc_m_n) const
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:455
Block2ETileMap default_block_2_etile_map_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:460
remove_cvref_t< decltype(GridwiseGemm64::MakeDefaultBlock2ETileMap(EGridDesc_M_N{}))> Block2ETileMap
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:430
GroupedContractionBlock2ETileMap(const EGridDesc_M_N &e_grid_desc_m_n, ck::index_t BlockStart)
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:433
ck::index_t block_start_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:461
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:506
CDEElementwiseOperation cde_element_op_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:665
BElementwiseOperation b_element_op_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:664
index_t grid_size_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:660
std::vector< ContractionMultiDKernelArg > contraction_multi_d_kernel_args_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:656
AElementwiseOperation a_element_op_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:663
Argument(std::vector< const void * > p_a_vec, std::vector< const void * > p_b_vec, std::vector< std::array< const void *, NumDTensor > > p_ds_vec, std::vector< void * > p_e_vec, std::vector< ContractionDesc< NumDTensor > > contraction_descs, AElementwiseOperation a_element_op, BElementwiseOperation b_element_op, CDEElementwiseOperation cde_element_op)
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:507
std::vector< ContractionMultiDDeviceArg > contraction_multi_d_device_args_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:657
ck::tensor_operation::device::DeviceGroupedContractionMultipleD_Xdl_CShuffle::Argument::group_count_
std::size_t group_count_
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:659
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:670
float RunImp(const Argument &arg, const StreamConfig &stream_config=StreamConfig{})
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:674
INVOKER_RUN_IMPL float Run(const BaseArgument *p_arg, const StreamConfig &stream_config=StreamConfig{}) override
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:736
DeviceOp::Argument Argument
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:671
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:168
remove_cvref_t< decltype(GridwiseGemm64::MakeDsGridDescriptor_MBlock_MPerBlock_NBlock_NPerBlock( DsGridDesc_M_N{}))> DsGridDesc_MBlock_MPerBlock_NBlock_NPerBlock
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:420
static constexpr auto I3
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:179
static constexpr auto I2
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:178
static constexpr auto I0
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:176
static auto MakeArgument(std::vector< const void * > p_a_vec, std::vector< const void * > p_b_vec, std::vector< std::array< const void *, NumDTensor > > p_ds_vec, std::vector< void * > p_e_vec, std::vector< ContractionDesc< NumDTensor > > contraction_descs, AElementwiseOperation a_element_op, BElementwiseOperation b_element_op, CDEElementwiseOperation cde_element_op)
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:882
size_t GetWorkSpaceSize(const BaseArgument *p_arg) const override
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:955
decltype(MakeEGridDescriptor_M_N({}, {})) EGridDesc_M_N
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:361
decltype(MakeAGridDescriptor_M_K({}, {})) AGridDesc_M_K
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:358
std::string GetTypeString() const override
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:931
remove_cvref_t< decltype(GridwiseGemm64::MakeDefaultBGridDescriptor_BK0_N_BK1( BGridDesc_N_K{}))> BGridDesc_BK0_N_BK1
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:417
static auto MakeDsGridDescriptor_M_N(const std::array< std::vector< index_t >, NumDTensor > &ds_ms_ns_lengths_vec, const std::array< std::vector< index_t >, NumDTensor > &ds_ms_ns_strides_vec)
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:346
remove_cvref_t< decltype(GridwiseGemm64::MakeDefaultAGridDescriptor_AK0_M_AK1( AGridDesc_M_K{}))> AGridDesc_AK0_M_AK1
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:414
decltype(MakeBGridDescriptor_N_K({}, {})) BGridDesc_N_K
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:359
static constexpr auto I1
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:177
static auto MakeAGridDescriptor_M_K(const std::vector< index_t > &a_ms_ks_lengths_vec, const std::vector< index_t > &a_ms_ks_strides_vec)
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:185
static auto MakeEGridDescriptor_M_N(const std::vector< index_t > &e_ms_ns_lengths_vec, const std::vector< index_t > &e_ms_ns_strides_vec)
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:293
std::unique_ptr< BaseArgument > MakeArgumentPointer(std::vector< const void * > p_a_vec, std::vector< const void * > p_b_vec, std::vector< std::array< const void *, NumDTensor > > p_ds_vec, std::vector< void * > p_e_vec, std::vector< ContractionDesc< NumDTensor > > contraction_descs, AElementwiseOperation a_element_op, BElementwiseOperation b_element_op, CDEElementwiseOperation cde_element_op) override
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:905
bool IsSupportedArgument(const BaseArgument *p_arg) override
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:877
remove_cvref_t< decltype(GridwiseGemm64::MakeEGridDescriptor_MBlock_MPerBlock_NBlock_NPerBlock( EGridDesc_M_N{}))> EGridDesc_MBlock_MPerBlock_NBlock_NPerBlock
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:423
ADataType ComputeDataType
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:363
static GET_NXDL_PER_WAVE_IMPL constexpr auto NXdlPerWave64
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:172
static constexpr auto matrix_padder
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:181
DeviceGroupedContractionMultipleD_Xdl_CShuffle DeviceOp
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:169
static auto MakeBGridDescriptor_N_K(const std::vector< index_t > &b_ns_ks_lengths_vec, const std::vector< index_t > &b_ns_ks_strides_vec)
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:239
static constexpr auto NXdlPerWave32
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:173
static bool IsSupportedArgument(const Argument &arg)
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:743
static auto MakeInvoker()
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:901
GridwiseGemmMultipleD_xdl_cshuffle< ADataType, BDataType, ComputeDataType, AccDataType, CShuffleDataType, DsDataType, EDataType, AElementwiseOperation, BElementwiseOperation, CDEElementwiseOperation, NumGemmKPrefetchStage, BlockSize, MPerBlock, NPerBlock, KPerBlock, AK1, BK1, MPerXDL, NPerXDL, MXdlPerWave, NXdlPerWave_, ABlockTransferThreadClusterLengths_AK0_M_AK1, ABlockTransferThreadClusterArrangeOrder, ABlockTransferSrcAccessOrder, ABlockTransferSrcVectorDim, ABlockTransferSrcScalarPerVector, ABlockTransferDstScalarPerVector_AK1, false, ABlockLdsExtraM, BBlockTransferThreadClusterLengths_BK0_N_BK1, BBlockTransferThreadClusterArrangeOrder, BBlockTransferSrcAccessOrder, BBlockTransferSrcVectorDim, BBlockTransferSrcScalarPerVector, BBlockTransferDstScalarPerVector_BK1, false, BBlockLdsExtraN, CShuffleMXdlPerWavePerShuffle, CShuffleNXdlPerWavePerShuffle, CDEBlockTransferClusterLengths_MBlock_MPerBlock_NBlock_NPerBlock, CDEBlockTransferScalarPerVector_NPerBlock, LoopSched > GridwiseGemmBase
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:367
GridwiseGemmBase< NXdlPerWave32 > GridwiseGemm32
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:411
GridwiseGemmBase< math::max(NXdlPerWave64, 1)> GridwiseGemm64
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:410
std::unique_ptr< BaseInvoker > MakeInvokerPointer() override
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:925
static constexpr index_t NumDTensor
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:174
remove_cvref_t< decltype(MakeDsGridDescriptor_M_N({{}}, {{}}))> DsGridDesc_M_N
Definition device_grouped_contraction_multiple_d_xdl_cshuffle.hpp:360
Definition device_grouped_contraction_multiple_d.hpp:54
Definition matrix_padder.hpp:180