device_batched_gemm_gemm_xdl_cshuffle.hpp Source File#
device_batched_gemm_gemm_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
std::string getGemmSpecializationString(const GemmSpecialization &s)
Definition gemm_specialization.hpp:32
GemmSpecialization
Definition gemm_specialization.hpp:11
__global__ void kernel_gemm_gemm_xdl_cshuffle_v1(const FloatAB *__restrict__ p_a_grid, const FloatAB *__restrict__ p_b_grid, const FloatAB *__restrict__ p_b1_grid, FloatC *__restrict__ p_c_grid, const AElementwiseOperation a_element_op, const BElementwiseOperation b_element_op, const AccElementwiseOperation acc_element_op, const B1ElementwiseOperation b1_element_op, const CElementwiseOperation c_element_op, const AGridDesc_AK0_M_AK1 a_grid_desc_ak0_m_ak1, const BGridDesc_BK0_N_BK1 b_grid_desc_bk0_n_bk1, const B1GridDesc_BK0_N_BK1 b1_grid_desc_bk0_n_bk1, const CGridDescriptor_MBlock_MPerBlock_NBlock_NPerBlock c_grid_desc_mblock_mperblock_nblock_nperblock, const Block2CTileMap block_2_ctile_map, const index_t batch_count, const ComputeBasePtrOfStridedBatch compute_base_ptr_of_batch)
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:44
Definition convolution_backward_data_specialization.hpp:7
Definition ck.hpp:268
__host__ __device__ constexpr auto make_pass_through_transform(const LowLength &low_length)
Definition multi_index_transform_helper.hpp:12
__host__ __device__ constexpr auto make_naive_tensor_descriptor(const Tuple< Lengths... > &lengths, const Tuple< Strides... > &strides)
Definition tensor_descriptor_helper.hpp:49
__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
__host__ __device__ constexpr auto make_unmerge_transform(const UpLengths &up_lengths, integral_constant< bool, Use24BitIntegerCalculation >=integral_constant< bool, false >{})
Definition multi_index_transform_helper.hpp:90
Definition ck/stream_config.hpp:10
Definition gridwise_batched_gemm_gemm_xdl_cshuffle_v1.hpp:80
__host__ static __device__ constexpr bool CheckValidity(const AGridDesc_AK0_M_AK1 &a_grid_desc_ak0_m_ak1, const BGridDesc_BK0_N_BK1 &b_grid_desc_bk0_n_bk1, const B1GridDesc_BK0_N_BK1 &b1_grid_desc_bk0_n_bk1, const CGridDesc_M_N &c_grid_desc_m_n, const Block2CTileMap &block_2_ctile_map)
Definition gridwise_batched_gemm_gemm_xdl_cshuffle_v1.hpp:223
Definition utility/sequence.hpp:43
Definition utility/integral_constant.hpp:20
Definition device_base.hpp:197
BaseArgument()=default
BaseInvoker()=default
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:422
const B1DataType * p_b1_grid_
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:477
ComputeBasePtrOfStridedBatch compute_base_ptr_of_batch_
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:490
index_t batch_count_
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:489
AGridDesc_AK0_M_AK1 a_grid_desc_ak0_m_ak1_
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:479
AElementwiseOperation a_element_op_
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:484
void Print() const
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:466
CDataType * p_c_grid_
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:478
const ADataType * p_a_grid_
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:475
BElementwiseOperation b_element_op_
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:485
B1ElementwiseOperation b1_element_op_
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:487
CGridDesc_M_N c_grid_desc_m_n_
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:482
const BDataType * p_b_grid_
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:476
BGridDesc_BK0_N_BK1 b_grid_desc_bk0_n_bk1_
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:480
Argument(const ADataType *p_a_grid, const BDataType *p_b_grid, const B1DataType *p_b1_grid, CDataType *p_c_grid, index_t MRaw, index_t NRaw, index_t KRaw, index_t Gemm1NRaw, index_t Batch, index_t StrideA, index_t StrideB, index_t StrideB1, index_t StrideC, index_t BatchStrideA, index_t BatchStrideB, index_t BatchStrideB1, index_t BatchStrideC, AElementwiseOperation a_element_op, BElementwiseOperation b_element_op, AccElementwiseOperation acc_element_op, B1ElementwiseOperation b1_element_op, CElementwiseOperation c_element_op)
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:423
B1GridDesc_BK0_N_BK1 b1_grid_desc_bk0_n_bk1_
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:481
GridwiseGemm64::DefaultBlock2CTileMap block_2_ctile_map_
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:483
AccElementwiseOperation acc_element_op_
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:486
CElementwiseOperation c_element_op_
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:488
std::vector< index_t > raw_lengths_m_n_k_o_
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:493
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:312
__host__ __device__ constexpr long_index_t GetB1BasePtr(index_t g_idx) const
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:334
__host__ __device__ constexpr long_index_t GetABasePtr(index_t g_idx) const
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:324
__host__ __device__ constexpr long_index_t GetCBasePtr(index_t g_idx) const
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:339
ComputeBasePtrOfStridedBatch(index_t BatchStrideA, index_t BatchStrideB, index_t BatchStrideB1, index_t BatchStrideC)
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:313
__host__ __device__ constexpr long_index_t GetBBasePtr(index_t g_idx) const
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:329
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:498
float Run(const Argument &arg, const StreamConfig &stream_config=StreamConfig{})
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:574
float Run(const BaseArgument *p_arg, const StreamConfig &stream_config=StreamConfig{}) override
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:593
DeviceOp::Argument Argument
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:499
float RunImp(const Argument &arg, const StreamConfig &stream_config=StreamConfig{})
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:502
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:189
static bool IsSupportedArgument(const Argument &arg)
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:606
static constexpr auto matrix_padder
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:200
bool IsSupportedArgument(const BaseArgument *p_arg) override
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:663
static auto MakeCGridDescriptor_M_N(index_t MRaw, index_t NRaw, index_t StrideC)
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:293
GridwiseBatchedGemmGemm_Xdl_CShuffle< ADataType, GemmAccDataType, CShuffleDataType, CDataType, AElementwiseOperation, BElementwiseOperation, AccElementwiseOperation, B1ElementwiseOperation, CElementwiseOperation, InMemoryDataOperationEnum::Set, AGridDesc_AK0_M_AK1, BGridDesc_BK0_N_BK1, B1GridDesc_BK0_N_BK1, CGridDesc_M_N, NumGemmKPrefetchStage, BlockSize, MPerBlock, NPerBlock, KPerBlock, Gemm1NPerBlock, Gemm1KPerBlock, AK1, BK1, B1K1, MPerXDL, NPerXDL, MXdlPerWave_, NXdlPerWave, Gemm1NXdlPerWave, ABlockTransferThreadClusterLengths_AK0_M_AK1, ABlockTransferThreadClusterArrangeOrder, ABlockTransferSrcAccessOrder, ABlockTransferSrcVectorDim, ABlockTransferSrcScalarPerVector, ABlockTransferDstScalarPerVector_AK1, true, ABlockLdsExtraM, BBlockTransferThreadClusterLengths_BK0_N_BK1, BBlockTransferThreadClusterArrangeOrder, BBlockTransferSrcAccessOrder, BBlockTransferSrcVectorDim, BBlockTransferSrcScalarPerVector, BBlockTransferDstScalarPerVector_BK1, true, BBlockLdsExtraN, B1BlockTransferThreadClusterLengths_BK0_N_BK1, B1BlockTransferThreadClusterArrangeOrder, B1BlockTransferSrcAccessOrder, B1BlockTransferSrcVectorDim, B1BlockTransferSrcScalarPerVector, B1BlockTransferDstScalarPerVector_BK1, false, B1BlockLdsExtraN, CShuffleMXdlPerWavePerShuffle, CShuffleNXdlPerWavePerShuffle, CShuffleBlockTransferClusterLengths_MBlock_MPerBlock_NBlock_NPerBlock, CShuffleBlockTransferScalarPerVector_NPerBlock, LoopSched > GridwiseGemmBase
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:358
std::unique_ptr< BaseArgument > MakeArgumentPointer(const void *p_a, const void *p_b, const void *p_b1, void *p_c, index_t MRaw, index_t NRaw, index_t KRaw, index_t Gemm1NRaw, index_t Batch, index_t StrideA, index_t StrideB, index_t StrideB1, index_t StrideC, index_t BatchStrideA, index_t BatchStrideB, index_t BatchStrideB1, index_t BatchStrideC, AElementwiseOperation a_element_op, BElementwiseOperation b_element_op, AccElementwiseOperation acc_element_op, B1ElementwiseOperation b1_element_op, CElementwiseOperation c_element_op) override
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:701
std::unique_ptr< BaseInvoker > MakeInvokerPointer() override
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:749
decltype(MakeBGridDescriptor_BK0_N_BK1(1, 1, 1)) BGridDesc_BK0_N_BK1
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:352
static constexpr auto I0
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:196
static auto MakeInvoker()
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:698
decltype(MakeB1GridDescriptor_BK0_N_BK1(1, 1, 1)) B1GridDesc_BK0_N_BK1
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:353
static constexpr auto MXdlPerWave32
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:194
static auto MakeAGridDescriptor_AK0_M_AK1(index_t MRaw, index_t KRaw, index_t StrideA)
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:204
static auto MakeBGridDescriptor_BK0_N_BK1(index_t KRaw, index_t NRaw, index_t StrideB)
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:233
static constexpr auto I2
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:198
static auto MakeB1GridDescriptor_BK0_N_BK1(index_t KRaw, index_t NRaw, index_t StrideB)
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:263
static constexpr auto MXdlPerWave64
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:192
static constexpr auto I1
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:197
decltype(MakeCGridDescriptor_M_N(1, 1, 1)) CGridDesc_M_N
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:354
decltype(MakeAGridDescriptor_AK0_M_AK1(1, 1, 1)) AGridDesc_AK0_M_AK1
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:351
DeviceBatchedGemmGemm_Xdl_CShuffle DeviceOp
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:190
static auto MakeArgument(const ADataType *p_a, const BDataType *p_b, const B1DataType *p_b1, CDataType *p_c, index_t MRaw, index_t NRaw, index_t KRaw, index_t Gemm1NRaw, index_t Batch, index_t StrideA, index_t StrideB, index_t StrideB1, index_t StrideC, index_t BatchStrideA, index_t BatchStrideB, index_t BatchStrideB1, index_t BatchStrideC, AElementwiseOperation a_element_op, BElementwiseOperation b_element_op, AccElementwiseOperation acc_element_op, B1ElementwiseOperation b1_element_op, CElementwiseOperation c_element_op)
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:668
GridwiseGemmBase< MXdlPerWave32 > GridwiseGemm32
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:418
GridwiseGemmBase< math::max(MXdlPerWave64, 1)> GridwiseGemm64
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:417
std::string GetTypeString() const override
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:755
static constexpr bool IsValidCompilationParameter()
Definition device_batched_gemm_gemm_xdl_cshuffle.hpp:600
Definition device_batched_gemm_gemm.hpp:29
Definition matrix_padder.hpp:63