diff --git a/example/65_gemm_multiply_multiply/moe_gemm1_xdl_fp8_blockscale_splitk.cpp b/example/65_gemm_multiply_multiply/moe_gemm1_xdl_fp8_blockscale_splitk.cpp index 08a1d6614e..ae707e74a2 100644 --- a/example/65_gemm_multiply_multiply/moe_gemm1_xdl_fp8_blockscale_splitk.cpp +++ b/example/65_gemm_multiply_multiply/moe_gemm1_xdl_fp8_blockscale_splitk.cpp @@ -209,11 +209,15 @@ int main(int argc, char* argv[]) ck::index_t sorted_tile_num = 261; ck::index_t valid_tile_num = 256; #endif - + ck::index_t KBatch = 6; if(argc == 1) { // use default case } + else if(argc == 2) + { + KBatch = std::stoi(argv[1]); + } else if(argc == 4) { // use default case @@ -267,8 +271,6 @@ int main(int argc, char* argv[]) ck::index_t Scale_Stride_BN = (K + Scale_Block_K - 1) / Scale_Block_K; ck::index_t Scale_Stride_B = (N + Scale_Block_N - 1) / Scale_Block_N * 2; - ck::index_t KBatch = 6; - Tensor expert_ids(HostTensorDescriptor({sorted_tile_num}, {1})); Tensor sorted_token_ids(HostTensorDescriptor({sorted_size}, {1})); Tensor max_token_id(HostTensorDescriptor({1 + sorted_tile_num})); @@ -318,6 +320,8 @@ int main(int argc, char* argv[]) std::cout << "b0_e_n_k: " << b0_e_n_k.mDesc << std::endl; std::cout << "b1_e_n_k: " << b1_e_n_k.mDesc << std::endl; std::cout << "e_t_n: " << e_t_n_host_result.mDesc << std::endl; + std::cout << "k_batch:" << KBatch << std::endl; + std::cout << "init_method:" << init_method << std::endl; switch(init_method) { @@ -326,7 +330,7 @@ int main(int argc, char* argv[]) a0_t_k.GenerateTensorValue(GeneratorTensor_3{-1.0, 1.0}); a1_t_k.GenerateTensorValue(GeneratorTensor_3{0.0, 1.0}); b0_e_n_k.GenerateTensorValue(GeneratorTensor_3{-1.0, 1.0}); - b1_e_n_k.GenerateTensorValue(GeneratorTensor_3{0, 1.0}); + b1_e_n_k.GenerateTensorValue(GeneratorTensor_3{0.0, 1.0}); break; case 2: a0_t_k.GenerateTensorValue(GeneratorTensor_1{}); diff --git a/include/ck/tensor_operation/gpu/grid/gridwise_moe_gemm_blockscale.hpp b/include/ck/tensor_operation/gpu/grid/gridwise_moe_gemm_blockscale.hpp index 4ba8ab00ea..c556dbec10 100644 --- a/include/ck/tensor_operation/gpu/grid/gridwise_moe_gemm_blockscale.hpp +++ b/include/ck/tensor_operation/gpu/grid/gridwise_moe_gemm_blockscale.hpp @@ -765,9 +765,8 @@ struct GridwiseMoeGemmBlockScale else if constexpr(is_same_v) { // KPack * NLane * KLane * K0 * N0 - b_k_split_offset = k_id * karg.KRead * NLane / BPackedSize; - bscale_k_split_offset = - k_id * karg.KRead / ScaleBlockK + k_id * NLane / ScaleBlockN; + b_k_split_offset = k_id * karg.KRead * NLane / BPackedSize; + bscale_k_split_offset = k_id * karg.KRead / ScaleBlockK; } // if(k_id < karg.KBatch - 1)