update profiling format

pull/653/head
taoxiangdong 4 years ago
parent 877569858f
commit b3005174f0

@ -112,7 +112,6 @@ ge::Status RegProfCtrlCallback(MsprofCtrlCallback func) {
if (ge::ProfilingManager::Instance().GetMsprofCallback().msprofCtrlCallback != nullptr) { if (ge::ProfilingManager::Instance().GetMsprofCallback().msprofCtrlCallback != nullptr) {
GELOGW("Msprof ctrl callback is exist, just ignore it."); GELOGW("Msprof ctrl callback is exist, just ignore it.");
} else { } else {
GELOGI("GE register Msprof ctrl callback.");
ge::ProfilingManager::Instance().SetMsprofCtrlCallback(func); ge::ProfilingManager::Instance().SetMsprofCtrlCallback(func);
} }
return ge::SUCCESS; return ge::SUCCESS;
@ -124,7 +123,6 @@ ge::Status RegProfSetDeviceCallback(MsprofSetDeviceCallback func) {
return ge::PARAM_INVALID; return ge::PARAM_INVALID;
} }
// Pass MsprofSetDeviceCallback to runtime // Pass MsprofSetDeviceCallback to runtime
GELOGI("GE pass setdevice callback to runtime.");
ge::Status rt_ret = rtRegDeviceStateCallback(kRtSetDeviceRegName.c_str(), static_cast<rtDeviceStateCallback>(func)); ge::Status rt_ret = rtRegDeviceStateCallback(kRtSetDeviceRegName.c_str(), static_cast<rtDeviceStateCallback>(func));
if (rt_ret != ge::SUCCESS) { if (rt_ret != ge::SUCCESS) {
GELOGE(rt_ret, "Pass MsprofSetDeviceCallback to runtime failed!"); GELOGE(rt_ret, "Pass MsprofSetDeviceCallback to runtime failed!");
@ -158,7 +156,7 @@ ge::Status ProfCommandHandle(ProfCommandHandleType type, void *data, uint32_t le
if (type != kProfCommandhandleFinalize) { if (type != kProfCommandhandleFinalize) {
GE_CHECK_NOTNULL(data); GE_CHECK_NOTNULL(data);
} }
ProfCommandHandleData *prof_config_param = (ProfCommandHandleData *)data; ProfCommandHandleData *prof_config_param = reinterpret_cast<ProfCommandHandleData *>(data);
auto iter = kProfCommandTypeMap.find(type); auto iter = kProfCommandTypeMap.find(type);
if (iter == kProfCommandTypeMap.end()) { if (iter == kProfCommandTypeMap.end()) {
GELOGW("The prof comand type is invalid."); GELOGW("The prof comand type is invalid.");

@ -805,7 +805,8 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::GetFpBpP
if (!fp_point_.empty() && !bp_point_.empty()) { if (!fp_point_.empty() && !bp_point_.empty()) {
fp_point = fp_point_; fp_point = fp_point_;
bp_point = bp_point_; bp_point = bp_point_;
GELOGI("Bp Fp have been initialized in env or options. bp_point: %s, fp_point: %s", bp_point.c_str(), fp_point.c_str()); GELOGI("Bp Fp have been initialized in env or options. bp_point: %s, fp_point: %s", bp_point.c_str(),
fp_point.c_str());
return; return;
} }
// ProfApi mode and training trace is set // ProfApi mode and training trace is set

@ -36,21 +36,21 @@ using Json = nlohmann::json;
namespace { namespace {
const std::string GE_PROFILING_MODULE = "Framework"; const std::string GE_PROFILING_MODULE = "Framework";
// DataTypeConfig MASK // DataTypeConfig MASK
#define PROF_ACL_API_MASK 0x0001 const int PROF_ACL_API_MASK = 0x0001;
#define PROF_TASK_TIME_MASK 0x0002 const int PROF_TASK_TIME_MASK = 0x0002;
#define PROF_AICORE_METRICS_MASK 0x0004 const int PROF_AICORE_METRICS_MASK = 0x0004;
#define PROF_AICPU_TRACE_MASK 0x0008 const int PROF_AICPU_TRACE_MASK = 0x0008;
#define PROF_MODEL_EXECUTE_MASK 0x0010 const int PROF_MODEL_EXECUTE_MASK = 0x0010;
#define PROF_RUNTIME_API_MASK 0x0020 const int PROF_RUNTIME_API_MASK = 0x0020;
#define PROF_RUNTIME_TRACE_MASK 0x0040 const int PROF_RUNTIME_TRACE_MASK = 0x0040;
#define PROF_SCHEDULE_TIMELINE_MASK 0x0080 const int PROF_SCHEDULE_TIMELINE_MASK = 0x0080;
#define PROF_SCHEDULE_TRACE_MASK 0x0100 const int PROF_SCHEDULE_TRACE_MASK = 0x0100;
#define PROF_AIVECTORCORE_METRICS_MASK 0x0200 const int PROF_AIVECTORCORE_METRICS_MASK = 0x0200;
#define PROF_SUBTASK_TIME_MASK 0x0400 const int PROF_SUBTASK_TIME_MASK = 0x0400;
#define PROF_TRAINING_TRACE_MASK 0x0800 const int PROF_TRAINING_TRACE_MASK = 0x0800;
#define PROF_HCCL_TRACE_MASK 0x1000 const int PROF_HCCL_TRACE_MASK = 0x1000;
#define PROF_DATA_PROCESS_MASK 0x2000 const int PROF_DATA_PROCESS_MASK = 0x2000;
#define PROF_MODEL_LOAD_MASK 0x8000000000000000 const int PROF_MODEL_LOAD_MASK = 0x8000000000000000;
} // namespace } // namespace
namespace ge { namespace ge {
@ -80,7 +80,8 @@ class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ProfilingManager {
bool ProfilingTrainingTraceOn() const { return is_training_trace_; } bool ProfilingTrainingTraceOn() const { return is_training_trace_; }
bool ProfilingModelLoadOn() const { return is_load_profiling_; } bool ProfilingModelLoadOn() const { return is_load_profiling_; }
bool ProfilingModelExecuteOn() const; bool ProfilingModelExecuteOn() const;
bool ProfilingOn() const { return is_load_profiling_ && is_execute_profiling_; } // is_execute_profiling_ only used by ge option and env // is_execute_profiling_ only used by ge option and env
bool ProfilingOn() const { return is_load_profiling_ && is_execute_profiling_; }
void ReportProfilingData(uint32_t model_id, const std::vector<TaskDescInfo> &task_desc_info, void ReportProfilingData(uint32_t model_id, const std::vector<TaskDescInfo> &task_desc_info,
const std::vector<ComputeGraphDescInfo> &compute_graph_desc_info); const std::vector<ComputeGraphDescInfo> &compute_graph_desc_info);
void ProfilingTaskDescInfo(uint32_t model_id, const std::vector<TaskDescInfo> &task_desc_info, void ProfilingTaskDescInfo(uint32_t model_id, const std::vector<TaskDescInfo> &task_desc_info,

@ -20,7 +20,7 @@
#include "ge/ge_api_error_codes.h" #include "ge/ge_api_error_codes.h"
#include "toolchain/prof_callback.h" #include "toolchain/prof_callback.h"
#define MAX_DEV_NUM (64) const int MAX_DEV_NUM = 64;
enum ProfCommandHandleType { enum ProfCommandHandleType {
kProfCommandhandleInit = 0, kProfCommandhandleInit = 0,
kProfCommandhandleStart, kProfCommandhandleStart,

Loading…
Cancel
Save