未验证 提交 14fe4b54 编写于 作者: K kangguangli 提交者: GitHub

[StandaloneExe] improving sequentialRun mode of standaloneExecutor (#52111)

* Verify SequentialRun Model of StandaloneExecutor

* fix

* fix

* fix

* remove redundant code

* fix CI

* fix CI

* recover multi-step dependency
上级 058ca61d
...@@ -297,12 +297,10 @@ void DependencyBuilder::AddDependencyForReadOp() { ...@@ -297,12 +297,10 @@ void DependencyBuilder::AddDependencyForReadOp() {
void DependencyBuilder::AddDependencyForSequentialRun() { void DependencyBuilder::AddDependencyForSequentialRun() {
size_t dependence_op_idx = ULLONG_MAX; size_t dependence_op_idx = ULLONG_MAX;
for (size_t op_idx = 0; op_idx < op_num_; ++op_idx) { for (size_t op_idx = 0; op_idx < op_num_; ++op_idx) {
if (!IsCpuOp(instructions_->at(op_idx))) { if (dependence_op_idx != ULLONG_MAX) {
if (dependence_op_idx != ULLONG_MAX) { AddDownstreamOp(dependence_op_idx, op_idx);
AddDownstreamOp(dependence_op_idx, op_idx);
}
dependence_op_idx = op_idx;
} }
dependence_op_idx = op_idx;
} }
} }
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#include "paddle/fluid/framework/new_executor/new_executor_defs.h" #include "paddle/fluid/framework/new_executor/new_executor_defs.h"
DECLARE_bool(new_executor_sequential_run);
namespace paddle { namespace paddle {
namespace framework { namespace framework {
namespace interpreter { namespace interpreter {
......
...@@ -360,8 +360,8 @@ void InterpreterCore::reset_scope(Scope* new_scope) { ...@@ -360,8 +360,8 @@ void InterpreterCore::reset_scope(Scope* new_scope) {
const auto& var_name = var_scope_.GetNameById(i); const auto& var_name = var_scope_.GetNameById(i);
var_list[i] = new_scope->FindVar(var_name); var_list[i] = new_scope->FindVar(var_name);
} }
// The index should assured valid, cause the InterpreterCore may not be fully // The index should be assured valid, cause the InterpreterCore may not be
// built, but was still cached and used. For example, see unit test // fully built, but was still cached and used. For example, see unit test
// `test_assert.py`, it may exit before `InterpreterCore::Convert`, but still // `test_assert.py`, it may exit before `InterpreterCore::Convert`, but still
// was cached and used by later tests. // was cached and used by later tests.
for (size_t i = 0; i < std::min(refs_.size(), var_list.size()); i++) { for (size_t i = 0; i < std::min(refs_.size(), var_list.size()); i++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册