未验证 提交 8fba68d3 编写于 作者: C chenjian 提交者: GitHub

Fix dygraph record event position (#41445)

* no

* maintain old profiler

* fix old dygraph record event
上级 dfa63126
...@@ -826,6 +826,8 @@ std::vector<std::shared_ptr<VarBase>> PartialGradTask::Run() { ...@@ -826,6 +826,8 @@ std::vector<std::shared_ptr<VarBase>> PartialGradTask::Run() {
} }
void PartialGradTask::RunEachOp(OpBase *op) { void PartialGradTask::RunEachOp(OpBase *op) {
platform::RecordEvent op_type_record_event(
op->Type() + " grad trace_op", platform::TracerEventType::Operator, 1);
// Prepare new inputs // Prepare new inputs
NameVarMap<VarBase> tmp_ins; NameVarMap<VarBase> tmp_ins;
for (auto &input_pair : op->GetInsMap()) { for (auto &input_pair : op->GetInsMap()) {
...@@ -908,7 +910,6 @@ void PartialGradTask::RunEachOp(OpBase *op) { ...@@ -908,7 +910,6 @@ void PartialGradTask::RunEachOp(OpBase *op) {
// Run op // Run op
OpBase::Run(op->InnerOp(), tmp_ins, tmp_outs, op->Attrs(), OpBase::Run(op->InnerOp(), tmp_ins, tmp_outs, op->Attrs(),
op->DefaultAttrsMap(), op->place()); op->DefaultAttrsMap(), op->place());
if (create_graph_) { if (create_graph_) {
auto double_grad_node = auto double_grad_node =
CreateGradOpNode(op->InnerOp(), tmp_ins, tmp_outs, op->Attrs(), CreateGradOpNode(op->InnerOp(), tmp_ins, tmp_outs, op->Attrs(),
......
...@@ -313,7 +313,7 @@ void Tracer::TraceOpImpl(const std::string& type, ...@@ -313,7 +313,7 @@ void Tracer::TraceOpImpl(const std::string& type,
{ {
platform::RecordEvent node_creation_record_event( 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)) { if (ComputeRequiredGrad(new_ins, outs, trace_backward)) {
PADDLE_ENFORCE_EQ( PADDLE_ENFORCE_EQ(
......
...@@ -325,7 +325,7 @@ void ChromeTracingLogger::HandleTypeKernel( ...@@ -325,7 +325,7 @@ void ChromeTracingLogger::HandleTypeKernel(
"name": "%s[%s]", "pid": %lld, "tid": %lld, "name": "%s[%s]", "pid": %lld, "tid": %lld,
"ts": %lld, "dur": %.3f, "ts": %lld, "dur": %.3f,
"ph": "X", "cat": "%s", "ph": "X", "cat": "%s",
"cname": "rail_animation", "cname": "cq_build_failed",
"args": { "args": {
"start_time": "%.3f us", "start_time": "%.3f us",
"end_time": "%.3f us", "end_time": "%.3f us",
...@@ -376,7 +376,7 @@ void ChromeTracingLogger::HandleTypeMemcpy( ...@@ -376,7 +376,7 @@ void ChromeTracingLogger::HandleTypeMemcpy(
"name": "%s[%s]", "pid": %lld, "tid": %lld, "name": "%s[%s]", "pid": %lld, "tid": %lld,
"ts": %lld, "dur": %.3f, "ts": %lld, "dur": %.3f,
"ph": "X", "cat": "%s", "ph": "X", "cat": "%s",
"cname": "rail_animation", "cname": "cq_build_failed",
"args": { "args": {
"start_time": "%.3f us", "start_time": "%.3f us",
"end_time": "%.3f us", "end_time": "%.3f us",
...@@ -411,7 +411,7 @@ void ChromeTracingLogger::HandleTypeMemset( ...@@ -411,7 +411,7 @@ void ChromeTracingLogger::HandleTypeMemset(
"name": "%s[%s]", "pid": %lld, "tid": %lld, "name": "%s[%s]", "pid": %lld, "tid": %lld,
"ts": %lld, "dur": %.3f, "ts": %lld, "dur": %.3f,
"ph": "X", "cat": "%s", "ph": "X", "cat": "%s",
"cname": "rail_animation", "cname": "cq_build_failed",
"args": { "args": {
"start_time": "%.3f us", "start_time": "%.3f us",
"end_time": "%.3f us", "end_time": "%.3f us",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册