mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-04-20 14:59:17 +00:00
Add json dump support to output details from CK/CKTile Examples. (#2551)
* Adding RapidJson Library * Adding Json Dumps in all CK_Tile Examples Not verified yet * Adding json to cktile Batched Transpose * adding json dumps to layernorm2d_fwd * Adding json dump to flatmm_basic * Adding RapidJson Library * Adding Json Dumps in all CK_Tile Examples Not verified yet * Adding json to cktile Batched Transpose * adding json dumps to layernorm2d_fwd * Adding json dump to flatmm_basic * Adding json in 03_gemm * Add json dump to 16_batched_gemm * Add json dump to gemm_multi_d_fp16 * Add json dump to grouped_gemm * fix fmha_bwd/fwd * Fix clang-format errors exclude include/rapidjson in jenkins as its a third-party library * Saparating function and defination. * Update Documentation of 03_gemm * Refactoring as per code review * Disable fp8 instances on unsupported targets (#2592) * Restrict building of gemm_universal_preshuffle_f8 instances to specific targets in CMakeLists.txt * Add condition to skip gemm_xdl_universal_preshuffle_f8 instances for unsupported targets in CMakeLists.txt * Add conditions to skip unsupported targets for gemm_universal_preshuffle_f8 and gemm_xdl_universal_preshuffle_f8 instances in CMakeLists.txt * Refine conditions to exclude gemm_universal_preshuffle_f8 instances for unsupported targets in CMakeLists.txt --------- Co-authored-by: AviralGoelAMD <aviralgoel@amd.com> * fix clang format * remove duplicate lines of code from library/src/tensor_operation_instance/gpu/CMakeLists.txt * Fixing Readme and unifying jsondumps * adding moe_smoothquant * adding fused_moe * Fixing Readme for batched_gemm * Fixing Readme for grouped_gemm * adding flatmm * adding gemm_multi_d_fp16 * adding elementwise * adding File name when json is dumped * Fixing Reduce after merge * adding batched_transpose * Adding Warptile in Gemm * Fixing Clang Format --------- Co-authored-by: Aviral Goel <aviral.goel@amd.com> Co-authored-by: AviralGoelAMD <aviralgoel@amd.com> Co-authored-by: illsilin_amdeng <Illia.Silin@amd.com>
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <set>
|
||||
|
||||
#include "ck_tile/host.hpp"
|
||||
#include "json_dump.hpp"
|
||||
#include "fused_moe.hpp"
|
||||
|
||||
// different threshold for different dtype
|
||||
@@ -130,7 +131,9 @@ auto create_args(int argc, char* argv[])
|
||||
"normalized(slow)")
|
||||
.insert("seed", "11939", "seed used to do random")
|
||||
.insert("warmup", "5", "cold iter")
|
||||
.insert("repeat", "20", "hot iter");
|
||||
.insert("repeat", "20", "hot iter")
|
||||
.insert("json", "0", "0: No Json, 1: Dump Results in Json format")
|
||||
.insert("jsonfile", "fused_moe.json", "json file name to dump results");
|
||||
|
||||
bool result = arg_parser.parse(argc, argv);
|
||||
return std::make_tuple(result, arg_parser);
|
||||
@@ -513,6 +516,29 @@ bool run(const ck_tile::ArgParser& arg_parser)
|
||||
std::cout << ", valid:" << (pass ? "y" : "n") << std::flush;
|
||||
}
|
||||
std::cout << std::flush << std::endl;
|
||||
|
||||
if(arg_parser.get_int("json") == 1)
|
||||
{
|
||||
dump_fused_moe_json(arg_parser.get_str("jsonfile"),
|
||||
api_str,
|
||||
prec_str,
|
||||
tokens,
|
||||
is_local_token,
|
||||
local_tokens,
|
||||
experts,
|
||||
topk,
|
||||
hidden_size,
|
||||
intermediate_size,
|
||||
stride,
|
||||
block_m,
|
||||
activation,
|
||||
gate_only,
|
||||
fused_quant,
|
||||
pass,
|
||||
ave_time,
|
||||
cal_tflops(ave_time),
|
||||
cal_tbps(ave_time));
|
||||
}
|
||||
return pass;
|
||||
}
|
||||
else if(api == 1)
|
||||
@@ -619,6 +645,29 @@ bool run(const ck_tile::ArgParser& arg_parser)
|
||||
}
|
||||
std::cout << std::flush << std::endl;
|
||||
|
||||
if(arg_parser.get_int("json") == 1)
|
||||
{
|
||||
dump_fused_moe_json(arg_parser.get_str("jsonfile"),
|
||||
api_str,
|
||||
prec_str,
|
||||
tokens,
|
||||
is_local_token,
|
||||
local_tokens,
|
||||
experts,
|
||||
topk,
|
||||
hidden_size,
|
||||
intermediate_size,
|
||||
stride,
|
||||
block_m,
|
||||
activation,
|
||||
gate_only,
|
||||
fused_quant,
|
||||
pass,
|
||||
ave_time,
|
||||
cal_tflops(ave_time),
|
||||
cal_tbps(ave_time));
|
||||
}
|
||||
|
||||
return pass;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user