提交 e757691f 编写于 作者: D dingminghui 提交者: jackzhang235

refactor: reduce hwtime log to ease analyzing for CI

subgraph will rebuild while batchsize changable is on and encounter a
unsupported operator. graph will be destructed and recreated, in which Nan
hw perf log is printed
上级 7cd585aa
...@@ -54,11 +54,13 @@ class Graph { ...@@ -54,11 +54,13 @@ class Graph {
CNRT_CALL(cnrtDestroyNotifier(&notifier_start_)); CNRT_CALL(cnrtDestroyNotifier(&notifier_start_));
CNRT_CALL(cnrtDestroyNotifier(&notifier_end_)); CNRT_CALL(cnrtDestroyNotifier(&notifier_end_));
double total_time = 0; double total_time = 0;
for (auto& f : time_log_) { if (!time_log_.empty()) {
total_time += f; for (auto& f : time_log_) {
total_time += f;
}
std::cout << "cnml hardware time for " << time_log_.size()
<< " process:" << total_time / time_log_.size() << std::endl;
} }
std::cout << "cnml hardware time for " << time_log_.size()
<< " process:" << total_time / time_log_.size() << std::endl;
#endif #endif
} }
// Data node // Data node
......
...@@ -55,6 +55,8 @@ class SubgraphEngine : public subgraph::Engine { ...@@ -55,6 +55,8 @@ class SubgraphEngine : public subgraph::Engine {
<< GetBoolFromEnv("PADDLE_LITE_MLU_SAVE_OFFLINE_MODEL"); << GetBoolFromEnv("PADDLE_LITE_MLU_SAVE_OFFLINE_MODEL");
VLOG(4) << "[MLU] PADDLE_LITE_MLU_DISABLE_BATCH_SIZE_CHANGEABLE is " VLOG(4) << "[MLU] PADDLE_LITE_MLU_DISABLE_BATCH_SIZE_CHANGEABLE is "
<< GetBoolFromEnv("PADDLE_LITE_MLU_DISABLE_BATCH_SIZE_CHANGEABLE"); << GetBoolFromEnv("PADDLE_LITE_MLU_DISABLE_BATCH_SIZE_CHANGEABLE");
VLOG(4) << "[MLU] LITE_DISABLE_MLU_CAST is "
<< GetBoolFromEnv("LITE_DISABLE_MLU_CAST");
if (GetBoolFromEnv("PADDLE_LITE_MLU_DISABLE_BATCH_SIZE_CHANGEABLE")) { if (GetBoolFromEnv("PADDLE_LITE_MLU_DISABLE_BATCH_SIZE_CHANGEABLE")) {
disable_batch_size_changeable_ = true; disable_batch_size_changeable_ = true;
} }
...@@ -105,6 +107,7 @@ class SubgraphEngine : public subgraph::Engine { ...@@ -105,6 +107,7 @@ class SubgraphEngine : public subgraph::Engine {
if (shape_graph_map_.count(inputs_shape_) > 0) { if (shape_graph_map_.count(inputs_shape_) > 0) {
return false; return false;
} }
VLOG(3) << "MLU graph input shape changed" << std::endl;
return true; return true;
} }
...@@ -131,8 +134,8 @@ class SubgraphEngine : public subgraph::Engine { ...@@ -131,8 +134,8 @@ class SubgraphEngine : public subgraph::Engine {
if (subgraph::CHECK_SUCCESS(status)) { if (subgraph::CHECK_SUCCESS(status)) {
return status; return status;
} }
VLOG(4) << "[MLU] build batch_size changeable subgraph op failed, " LOG(INFO) << "[MLU] build batch_size changeable subgraph op failed, "
"changed to input_shape changeable"; "changed to input_shape changeable";
} }
error_compile_batch_size_changeable_ = true; error_compile_batch_size_changeable_ = true;
disable_batch_size_changeable_ = true; disable_batch_size_changeable_ = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册