From 727dcbd9f9b48ebaa4ca1bd1443cee2210e2a45e Mon Sep 17 00:00:00 2001 From: chenjian Date: Tue, 12 Apr 2022 10:14:09 +0800 Subject: [PATCH] Fix dygraph record event position (#41445) (#41608) * no * maintain old profiler * fix old dygraph record event --- paddle/fluid/imperative/partial_grad_engine.cc | 3 ++- paddle/fluid/imperative/tracer.cc | 2 +- paddle/fluid/platform/profiler/chrometracing_logger.cc | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/paddle/fluid/imperative/partial_grad_engine.cc b/paddle/fluid/imperative/partial_grad_engine.cc index 56ddbf33861..f2f64d92a23 100644 --- a/paddle/fluid/imperative/partial_grad_engine.cc +++ b/paddle/fluid/imperative/partial_grad_engine.cc @@ -826,6 +826,8 @@ std::vector> PartialGradTask::Run() { } void PartialGradTask::RunEachOp(OpBase *op) { + platform::RecordEvent op_type_record_event( + op->Type() + " grad trace_op", platform::TracerEventType::Operator, 1); // Prepare new inputs NameVarMap tmp_ins; for (auto &input_pair : op->GetInsMap()) { @@ -908,7 +910,6 @@ void PartialGradTask::RunEachOp(OpBase *op) { // Run op OpBase::Run(op->InnerOp(), tmp_ins, tmp_outs, op->Attrs(), op->DefaultAttrsMap(), op->place()); - if (create_graph_) { auto double_grad_node = CreateGradOpNode(op->InnerOp(), tmp_ins, tmp_outs, op->Attrs(), diff --git a/paddle/fluid/imperative/tracer.cc b/paddle/fluid/imperative/tracer.cc index 3d4cfa2df31..6b20b9b3938 100644 --- a/paddle/fluid/imperative/tracer.cc +++ b/paddle/fluid/imperative/tracer.cc @@ -313,7 +313,7 @@ void Tracer::TraceOpImpl(const std::string& type, { platform::RecordEvent node_creation_record_event( - type + " node_creation", platform::TracerEventType::Operator, 1); + type + " node_creation", platform::TracerEventType::OperatorInner, 1); if (ComputeRequiredGrad(new_ins, outs, trace_backward)) { PADDLE_ENFORCE_EQ( diff --git a/paddle/fluid/platform/profiler/chrometracing_logger.cc b/paddle/fluid/platform/profiler/chrometracing_logger.cc index 0c5d90a9277..d7879e7be51 100644 --- a/paddle/fluid/platform/profiler/chrometracing_logger.cc +++ b/paddle/fluid/platform/profiler/chrometracing_logger.cc @@ -325,7 +325,7 @@ void ChromeTracingLogger::HandleTypeKernel( "name": "%s[%s]", "pid": %lld, "tid": %lld, "ts": %lld, "dur": %.3f, "ph": "X", "cat": "%s", - "cname": "rail_animation", + "cname": "cq_build_failed", "args": { "start_time": "%.3f us", "end_time": "%.3f us", @@ -376,7 +376,7 @@ void ChromeTracingLogger::HandleTypeMemcpy( "name": "%s[%s]", "pid": %lld, "tid": %lld, "ts": %lld, "dur": %.3f, "ph": "X", "cat": "%s", - "cname": "rail_animation", + "cname": "cq_build_failed", "args": { "start_time": "%.3f us", "end_time": "%.3f us", @@ -411,7 +411,7 @@ void ChromeTracingLogger::HandleTypeMemset( "name": "%s[%s]", "pid": %lld, "tid": %lld, "ts": %lld, "dur": %.3f, "ph": "X", "cat": "%s", - "cname": "rail_animation", + "cname": "cq_build_failed", "args": { "start_time": "%.3f us", "end_time": "%.3f us", -- GitLab