Skip to content

Commit

Permalink
[PIR]fix SOT new ir name bug (#57361)
Browse files Browse the repository at this point in the history
* fix so new ir name bug

* remov useless code
  • Loading branch information
phlrain authored Sep 15, 2023
1 parent 4290548 commit 3e06282
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions paddle/fluid/eager/to_static/run_program_op_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ inline void RunProgramAPI(
backward_global_block,
output_names,
x,
input_names,
params,
place);
interpreter_core =
Expand Down
6 changes: 4 additions & 2 deletions paddle/fluid/framework/executor_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ std::unique_ptr<::pir::Program> ConstructFowardIrProgram(
const paddle::framework::BlockDesc *backward_global_block,
const std::vector<std::string> output_names,
const std::vector<paddle::Tensor> &x,
const std::vector<std::string> &x_names,
const std::vector<paddle::Tensor> &params,
const phi::Place &place) {
auto ir_ctx = ::pir::IrContext::Instance();
Expand All @@ -378,8 +379,9 @@ std::unique_ptr<::pir::Program> ConstructFowardIrProgram(

// add data op to program
auto *block = local_program.MutableBlock(0);
for (auto &in_t : x) {
auto name = in_t.name();
for (size_t i = 0; i < x.size(); ++i) {
auto &name = x_names[i];
auto &in_t = x[i];
if (block->FindVarRecursive(name) == nullptr) {
continue;
}
Expand Down
1 change: 1 addition & 0 deletions paddle/fluid/framework/executor_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ std::unique_ptr<::pir::Program> ConstructFowardIrProgram(
const paddle::framework::BlockDesc* backward_global_block,
const std::vector<std::string> output_names,
const std::vector<paddle::Tensor>& x,
const std::vector<std::string>& x_names,
const std::vector<paddle::Tensor>& params,
const phi::Place& place);

Expand Down

0 comments on commit 3e06282

Please sign in to comment.