未验证 提交 5574c8cf 编写于 作者: W wanghuancoder 提交者: GitHub

add timeline(recordevent) for new executor, test=develop (#35831)

上级 fab1a029
......@@ -18,6 +18,7 @@
#include <unordered_set>
#include "paddle/fluid/framework/details/share_tensor_buffer_functor.h"
#include "paddle/fluid/platform/profiler.h"
PADDLE_DEFINE_EXPORTED_bool(new_executor_use_inplace, true,
"Use inplace in new executor");
......@@ -304,9 +305,12 @@ void InterpreterCore::RunInstruction(const Instruction& instr_node) {
VLOG(3) << "RunInstruction: "
<< instr_node.kernel_func_.operator_base_->Type();
static_cast<const framework::OperatorWithKernel*>(
instr_node.kernel_func_.operator_base_)
->InferShape(instr_node.infershape_ctx_.get());
{
platform::RecordEvent infershape_event("InferShape");
static_cast<const framework::OperatorWithKernel*>(
instr_node.kernel_func_.operator_base_)
->InferShape(instr_node.infershape_ctx_.get());
}
if (FLAGS_new_executor_use_inplace) {
for (auto& pair : instr_node.vec_inplace_in_to_out_) {
......@@ -318,8 +322,10 @@ void InterpreterCore::RunInstruction(const Instruction& instr_node) {
}
}
}
instr_node.kernel_func_.compute_func_(*instr_node.execution_ctx_.get());
{
platform::RecordEvent compute_event("Compute");
instr_node.kernel_func_.compute_func_(*instr_node.execution_ctx_.get());
}
}
void InterpreterCore::ExecuteInstructionList(
......@@ -350,6 +356,8 @@ void InterpreterCore::RunInstructionAsync(size_t instr_id,
AtomicVectorSizeT* atomic_var_ref,
std::atomic<size_t>* op_run_number) {
auto& instr_node = vec_instruction_[instr_id];
platform::RecordEvent instruction_event(
instr_node.kernel_func_.operator_base_->Type());
event_manager_.WaitEvent(instr_node, place_);
RunInstruction(instr_node);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册