提交 ce238f10 编写于 作者: C chengmo

fix

上级 299fb8a7
...@@ -195,8 +195,8 @@ void prefetchs(const std::vector<std::string> &id_var_names, ...@@ -195,8 +195,8 @@ void prefetchs(const std::vector<std::string> &id_var_names,
const std::vector<std::string> &endpoints, const std::vector<std::string> &endpoints,
const framework::ExecutionContext &context, const framework::ExecutionContext &context,
const framework::Scope &scope) { const framework::Scope &scope) {
platform::RecordEvent record_event("Distributed_lookup_table::prefetchs", platform::PushEvent("Distributed_lookup_table::prefetchs",
platform::EventRole::kInnerOp); platform::EventRole::kInnerOp);
auto vec_dim_1 = 0; auto vec_dim_1 = 0;
auto vec_dim_0 = 0; auto vec_dim_0 = 0;
framework::Variable *var = scope.FindVar(persistable_var_name); framework::Variable *var = scope.FindVar(persistable_var_name);
...@@ -304,6 +304,8 @@ void prefetchs(const std::vector<std::string> &id_var_names, ...@@ -304,6 +304,8 @@ void prefetchs(const std::vector<std::string> &id_var_names,
#endif #endif
} }
} }
platform::PopEvent("Distributed_lookup_table::prefetchs",
platform::EventRole::kInnerOp);
} }
}; // namespace distributed }; // namespace distributed
......
...@@ -43,8 +43,8 @@ using DDim = framework::DDim; ...@@ -43,8 +43,8 @@ using DDim = framework::DDim;
template <typename T> template <typename T>
void RecvSelectedRows(const CommContext &rpc_ctx, void RecvSelectedRows(const CommContext &rpc_ctx,
const framework::Scope &scope) { const framework::Scope &scope) {
platform::RecordEvent record_event("ParameterRecv::RecvSelectedRows", platform::RecordEvent record_event_grpc("ParameterRecv::RecvSelectedRows",
platform::EventRole::kInnerOp); platform::EventRole::kInnerOp);
platform::DeviceContextPool &pool = platform::DeviceContextPool::Instance(); platform::DeviceContextPool &pool = platform::DeviceContextPool::Instance();
auto cpu_place = platform::CPUPlace(); auto cpu_place = platform::CPUPlace();
auto &cpu_ctx = *pool.Get(cpu_place); auto &cpu_ctx = *pool.Get(cpu_place);
...@@ -114,8 +114,8 @@ void RecvSelectedRows(const CommContext &rpc_ctx, ...@@ -114,8 +114,8 @@ void RecvSelectedRows(const CommContext &rpc_ctx,
template <typename T> template <typename T>
void RecvLodTensor(const CommContext &rpc_ctx, const framework::Scope &scope) { void RecvLodTensor(const CommContext &rpc_ctx, const framework::Scope &scope) {
platform::RecordEvent record_event("ParameterRecv::RecvLodTensor", platform::RecordEvent record_event_grpc("ParameterRecv::RecvLodTensor",
platform::EventRole::kInnerOp); platform::EventRole::kInnerOp);
platform::DeviceContextPool &pool = platform::DeviceContextPool::Instance(); platform::DeviceContextPool &pool = platform::DeviceContextPool::Instance();
auto cpu_place = platform::CPUPlace(); auto cpu_place = platform::CPUPlace();
auto &cpu_ctx = *pool.Get(cpu_place); auto &cpu_ctx = *pool.Get(cpu_place);
......
...@@ -98,8 +98,6 @@ template <typename T> ...@@ -98,8 +98,6 @@ template <typename T>
void ParameterSend<T>::operator()(const CommContext &rpc_ctx, void ParameterSend<T>::operator()(const CommContext &rpc_ctx,
const framework::Scope &scope, bool sync, const framework::Scope &scope, bool sync,
int multi_parts) { int multi_parts) {
platform::RecordEvent record_event("ParameterSend::operator",
platform::EventRole::kInnerOp);
if (rpc_ctx.var_name == STEP_COUNTER) { if (rpc_ctx.var_name == STEP_COUNTER) {
SendByNotifyRPC(rpc_ctx, scope); SendByNotifyRPC(rpc_ctx, scope);
return; return;
...@@ -117,8 +115,8 @@ void ParameterSend<T>::operator()(const CommContext &rpc_ctx, ...@@ -117,8 +115,8 @@ void ParameterSend<T>::operator()(const CommContext &rpc_ctx,
auto *send_var = scope.FindVar(rpc_ctx.var_name); auto *send_var = scope.FindVar(rpc_ctx.var_name);
if (send_var->IsType<framework::LoDTensor>()) { if (send_var->IsType<framework::LoDTensor>()) {
platform::RecordEvent record_event("ParameterSend::LoDTensor", platform::RecordEvent record_event_grpc("ParameterSend::LoDTensor",
platform::EventRole::kInnerOp); platform::EventRole::kInnerOp);
size_t out_num = rpc_ctx.splited_varnames.size(); size_t out_num = rpc_ctx.splited_varnames.size();
if (out_num > 1) { if (out_num > 1) {
auto &send_tensor = send_var->Get<framework::LoDTensor>(); auto &send_tensor = send_var->Get<framework::LoDTensor>();
...@@ -167,8 +165,8 @@ void ParameterSend<T>::operator()(const CommContext &rpc_ctx, ...@@ -167,8 +165,8 @@ void ParameterSend<T>::operator()(const CommContext &rpc_ctx,
} }
} }
} else if (send_var->IsType<framework::SelectedRows>()) { } else if (send_var->IsType<framework::SelectedRows>()) {
platform::RecordEvent record_event("ParameterSend::SelectedRows", platform::RecordEvent record_event_grpc("ParameterSend::SelectedRows",
platform::EventRole::kInnerOp); platform::EventRole::kInnerOp);
auto &send_slr = send_var->Get<framework::SelectedRows>(); auto &send_slr = send_var->Get<framework::SelectedRows>();
auto &send_rows = send_slr.rows(); auto &send_rows = send_slr.rows();
......
...@@ -694,8 +694,16 @@ Event *CurAnnotation() { ...@@ -694,8 +694,16 @@ Event *CurAnnotation() {
return annotation_stack.back(); return annotation_stack.back();
} }
std::string CurAnnotationName() { std::string CurAnnotationName() {
if (annotation_stack.empty()) return "Unknown"; std::string curr_annotation_name = "Unknown";
return annotation_stack.back()->name(); try {
if (annotation_stack.empty()) {
return curr_annotation_name;
}
return annotation_stack.back()->name();
} catch (...) {
VLOG(1) << "CurAnnotationName Failed";
}
return curr_annotation_name;
} }
void SetCurBlock(int block_id) { block_id_stack.push_back(block_id); } void SetCurBlock(int block_id) { block_id_stack.push_back(block_id); }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册