mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-21 21:39:15 +00:00
Modularize ckProfiler operations (#514)
* Re-structure ckProfiler source files
* Rename profiler.cpp to main.cpp
* Modularize ckProfiler operations
* Add description for profiler operations
* Use longer name to avoid name collision
* Use macro to delay expansion
* Use std::move() to avoid object copying
* Prohibit users from calling dtor
* Use macro to eliminate redundant code
* Make friend function hidden
* Add missing include directive <iostream>
* Fix wrong include directives
* Remove int8 from batchnorm-forward instances since it is not needed for forward training and could fail test
Co-authored-by: Qianfeng Zhang <Qianfeng.Zhang@amd.com>
[ROCm/composable_kernel commit: 8784a72e23]
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
#include <initializer_list>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "profiler/include/profile_batched_gemm_gemm_impl.hpp"
|
||||
#include "profiler/profile_batched_gemm_gemm_impl.hpp"
|
||||
#include "profiler_operation_registry.hpp"
|
||||
|
||||
using F16 = ck::half_t;
|
||||
using F32 = float;
|
||||
@@ -14,6 +15,9 @@ using F32 = float;
|
||||
using Row = ck::tensor_layout::gemm::RowMajor;
|
||||
using Col = ck::tensor_layout::gemm::ColumnMajor;
|
||||
|
||||
#define OP_NAME "batched_gemm_gemm"
|
||||
#define OP_DESC "Batched GEMM+GEMM"
|
||||
|
||||
int profile_batched_gemm_gemm(int argc, char* argv[])
|
||||
{
|
||||
enum struct GemmMatrixLayout
|
||||
@@ -101,7 +105,7 @@ int profile_batched_gemm_gemm(int argc, char* argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("arg1: tensor operation (batched_gemm_gemm: Batched_GEMM+Gemm)\n");
|
||||
printf("arg1: tensor operation (" OP_NAME ": " OP_DESC ")\n");
|
||||
printf("arg2: data type (1: fp16)\n");
|
||||
printf("arg3: matrix layout (0: Relu(A0[m, k] * B0[n, k] + D0[m, n]) * B1[n, o] + D1[m, o] "
|
||||
"= E1[m, o]; 1: Relu(A0[m, k] * B0[n, k] + D0[m, n]) * B1[o, n] + D1[m, o] = E1[m, "
|
||||
@@ -179,3 +183,5 @@ int profile_batched_gemm_gemm(int argc, char* argv[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
REGISTER_PROFILER_OPERATION(OP_NAME, OP_DESC, profile_batched_gemm_gemm);
|
||||
|
||||
Reference in New Issue
Block a user