Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions paddle/fluid/eager/to_static/run_program_op_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ inline void NewIRRunProgramAPI(
// Step 2. create new interpretercore
auto kernel_forward_program =
paddle::dialect::PdOpLowerToKernelPass(forward_program, place);
interpreter_core = paddle::framework::CreateNewIRInterpreterCoreInfoToCache(
interpreter_core = paddle::framework::CreatePirInterpreterCoreInfoToCache(
std::move(kernel_forward_program),
place,
/*is_grad=*/false,
Expand Down Expand Up @@ -708,13 +708,12 @@ inline void RunProgramAPI(
input_names,
params,
place);
interpreter_core =
paddle::framework::CreateNewIRInterpreterCoreInfoToCache(
std::move(ir_program),
place,
/*is_grad=*/false,
program_id,
global_inner_scope);
interpreter_core = paddle::framework::CreatePirInterpreterCoreInfoToCache(
std::move(ir_program),
place,
/*is_grad=*/false,
program_id,
global_inner_scope);
} else {
interpreter_core =
paddle::framework::CreateProgramInterpreterCoreInfoToCache(
Expand Down Expand Up @@ -865,13 +864,12 @@ inline void RunProgramGradAPI(
global_inner_scope,
place);

interpreter_core =
paddle::framework::CreateNewIRInterpreterCoreInfoToCache(
std::move(res),
place,
/*is_grad=*/true,
program_id,
global_inner_scope);
interpreter_core = paddle::framework::CreatePirInterpreterCoreInfoToCache(
std::move(res),
place,
/*is_grad=*/true,
program_id,
global_inner_scope);
} else {
interpreter_core =
paddle::framework::CreateProgramInterpreterCoreInfoToCache(
Expand Down Expand Up @@ -1041,7 +1039,7 @@ inline void NewIRRunProgramGradAPI(
// Step 1. share input_vars & parameters into scope
auto kernel_backward_program =
paddle::dialect::PdOpLowerToKernelPass(backward_program, place);
interpreter_core = paddle::framework::CreateNewIRInterpreterCoreInfoToCache(
interpreter_core = paddle::framework::CreatePirInterpreterCoreInfoToCache(
std::move(kernel_backward_program),
place,
/*is_grad=*/true,
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/framework/executor_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ std::shared_ptr<InterpreterCore> CreateProgramInterpreterCoreInfoToCache(
return core;
}

std::shared_ptr<InterpreterCore> CreateNewIRInterpreterCoreInfoToCache(
std::shared_ptr<InterpreterCore> CreatePirInterpreterCoreInfoToCache(
std::unique_ptr<::pir::Program> ir_program,
const platform::Place &place,
bool is_grad,
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/framework/executor_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ std::shared_ptr<InterpreterCore> CreateProgramInterpreterCoreInfoToCache(
int64_t program_id,
framework::Scope* scope);

std::shared_ptr<InterpreterCore> CreateNewIRInterpreterCoreInfoToCache(
std::shared_ptr<InterpreterCore> CreatePirInterpreterCoreInfoToCache(
std::unique_ptr<::pir::Program> ir_prog,
const platform::Place& place,
bool is_grad,
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/framework/new_executor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ add_subdirectory(pir_adaptor)

set(STANDALONE_EXECUTOR_SRCS
feed_fetch_utils.cc interpretercore.cc new_executor_defs.cc
standalone_executor.cc program_interpreter.cc new_ir_interpreter.cc)
standalone_executor.cc program_interpreter.cc pir_interpreter.cc)

set(STANDALONE_EXECUTOR_DEPS
interpreter
Expand Down
29 changes: 14 additions & 15 deletions paddle/fluid/framework/new_executor/instruction/cond_instruction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

#include "paddle/fluid/framework/new_executor/interpreter/interpreter_util.h"
#include "paddle/fluid/framework/new_executor/interpreter/stream_analyzer.h"
#include "paddle/fluid/framework/new_executor/new_ir_interpreter.h"
#include "paddle/fluid/framework/new_executor/pir_adaptor/pir_adaptor_util.h"
#include "paddle/fluid/framework/new_executor/pir_interpreter.h"
#include "paddle/fluid/framework/scope.h"
#include "paddle/fluid/pir/dialect/operator/interface/infermeta.h"
#include "paddle/fluid/pir/dialect/operator/interface/op_yaml_info.h"
Expand Down Expand Up @@ -93,13 +93,12 @@ CondInstruction::CondInstruction(size_t id,
VLOG(6) << "finish process inputs outputs index";

Scope* true_scope = &(value_exec_info->GetScope()->NewScope());
true_branch_inter_ =
new NewIRInterpreter(place,
{},
true_branch_block,
true_scope,
value_exec_info->NewChild(true_scope),
{});
true_branch_inter_ = new PirInterpreter(place,
{},
true_branch_block,
true_scope,
value_exec_info->NewChild(true_scope),
{});

std::set<std::string> true_skip_gc_names_set;
for (auto value : GetYiedOpInputs(true_branch_block)) {
Expand All @@ -118,12 +117,12 @@ CondInstruction::CondInstruction(size_t id,

Scope* false_scope = &(value_exec_info->GetScope()->NewScope());
false_branch_inter_ =
new NewIRInterpreter(place,
{},
false_branch_block,
false_scope,
value_exec_info->NewChild(false_scope),
{});
new PirInterpreter(place,
{},
false_branch_block,
false_scope,
value_exec_info->NewChild(false_scope),
{});

std::set<std::string> false_skip_gc_names_set;
for (auto value : GetYiedOpInputs(false_branch_block)) {
Expand All @@ -149,7 +148,7 @@ CondInstruction::~CondInstruction() {
}

void CondInstruction::CopyBranchOutput(
const std::vector<std::string>& var_names, const NewIRInterpreter* inter) {
const std::vector<std::string>& var_names, const PirInterpreter* inter) {
for (size_t i = 0; i < var_names.size(); ++i) {
auto* inner_var = inter->InnerScope()->GetVar(var_names[i]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace paddle {
namespace framework {
class Scope;
class Value;
class NewIRInterpreter;
class PirInterpreter;
class ValueExecutionInfo;

class CondInstruction : public InstructionBase {
Expand All @@ -44,7 +44,7 @@ class CondInstruction : public InstructionBase {

private:
void CopyBranchOutput(const std::vector<std::string>& var_names,
const NewIRInterpreter* inter);
const PirInterpreter* inter);

::pir::Operation* op_;

Expand All @@ -54,9 +54,9 @@ class CondInstruction : public InstructionBase {

std::vector<Variable*> output_vars_;

NewIRInterpreter* true_branch_inter_;
PirInterpreter* true_branch_inter_;

NewIRInterpreter* false_branch_inter_;
PirInterpreter* false_branch_inter_;

std::vector<std::string> true_branch_outputs_;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

#include "paddle/fluid/framework/new_executor/interpreter/interpreter_util.h"
#include "paddle/fluid/framework/new_executor/interpreter/stream_analyzer.h"
#include "paddle/fluid/framework/new_executor/new_ir_interpreter.h"
#include "paddle/fluid/framework/new_executor/pir_adaptor/pir_adaptor_util.h"
#include "paddle/fluid/framework/new_executor/pir_interpreter.h"
#include "paddle/fluid/framework/scope.h"
#include "paddle/fluid/pir/dialect/operator/interface/infermeta.h"
#include "paddle/fluid/pir/dialect/operator/interface/op_yaml_info.h"
Expand Down Expand Up @@ -85,7 +85,7 @@ WhileInstruction::WhileInstruction(size_t id,
body_scope->Var(var_name);
body_exe_info->Add(body_block_->argument(i), var_name);
}
body_inter_ = std::unique_ptr<NewIRInterpreter>(new NewIRInterpreter(
body_inter_ = std::unique_ptr<PirInterpreter>(new PirInterpreter(
place, {}, body_block_, body_scope, body_exe_info, {}));

std::set<std::string> body_skip_gc_names_set;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace paddle {
namespace framework {
class Scope;
class Value;
class NewIRInterpreter;
class PirInterpreter;
class ValueExecutionInfo;

/// The execute semantics of while op ['output' = while_op('cond', 'intput')]
Expand Down Expand Up @@ -65,7 +65,7 @@ class WhileInstruction : public InstructionBase {
std::vector<Variable*> inputs_;
std::vector<Variable*> outputs_;

std::unique_ptr<NewIRInterpreter> body_inter_;
std::unique_ptr<PirInterpreter> body_inter_;
std::vector<std::string> body_skip_gc_names_;

::pir::Block* body_block_;
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/framework/new_executor/interpretercore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include "paddle/fluid/framework/new_executor/interpretercore.h"

#include "paddle/fluid/framework/new_executor/new_ir_interpreter.h"
#include "paddle/fluid/framework/new_executor/pir_interpreter.h"
#include "paddle/fluid/framework/new_executor/program_interpreter.h"
#include "paddle/pir/core/program.h"
#include "paddle/pir/core/value.h"
Expand Down Expand Up @@ -54,7 +54,7 @@ InterpreterCore::InterpreterCore(
framework::Scope* scope,
const ExecutionConfig& execution_config) {
VLOG(4) << "InterpreterCore(): " << this << " on " << place;
impl_ = std::make_unique<NewIRInterpreter>(
impl_ = std::make_unique<PirInterpreter>(
place, fetch_var_names, ir_block, scope, execution_config);
}

Expand Down
Loading