未验证 提交 6d4ae007 编写于 作者: R Ruibiao Chen 提交者: GitHub

Fix random op dependency and lr_shedule bugs for standalone executor (#45265)

* Fix random op depenency and lr_shedule bugs for standalone executor

* Fix CI errors

* Fix CI errors

* Fix CI errors
上级 68c01ac2
...@@ -273,20 +273,18 @@ void DependencyBuilder::AddDependencyForCommunicationOp() { ...@@ -273,20 +273,18 @@ void DependencyBuilder::AddDependencyForCommunicationOp() {
// make sure that the random op is scheduled sequentially // make sure that the random op is scheduled sequentially
void DependencyBuilder::AddDependencyForRandomOp() { void DependencyBuilder::AddDependencyForRandomOp() {
const std::set<std::string> random_op_set = { const std::set<std::string> random_op_set = {"bernoulli",
"bernoulli", "poisson",
"poisson", "multinomial",
"multinomial", "gaussian_random",
"gaussian_random", "truncated_gaussian_random",
"truncated_gaussian_random", "uniform_random",
"uniform_random", "randint",
"randint", "randperm",
"randperm", "exponential",
"exponential", "sampling_id",
"sampling_id" "dropout",
"dropout", "class_center_sample"};
"class_center_sample",
};
int dependence_op_idx = -1; int dependence_op_idx = -1;
for (size_t op_idx = 0; op_idx < op_num_; ++op_idx) { for (size_t op_idx = 0; op_idx < op_num_; ++op_idx) {
......
...@@ -1516,6 +1516,8 @@ class Executor(object): ...@@ -1516,6 +1516,8 @@ class Executor(object):
program._compile(scope, self.place) program._compile(scope, self.place)
ir_graph = framework.IrGraph(program._graph) ir_graph = framework.IrGraph(program._graph)
inner_program = ir_graph.to_program() inner_program = ir_graph.to_program()
if hasattr(program._program, 'lr_sheduler'):
inner_program.lr_sheduler = program._program.lr_sheduler
# print(f"Program after convert:\n {inner_program}", flush=True) # print(f"Program after convert:\n {inner_program}", flush=True)
logging.warning( logging.warning(
"FLAGS_USE_STANDALONE_EXECUTOR and FLAGS_CONVERT_GRAPH_TO_PROGRAM is set to 1. Graph will be converted to Program and executed using new executor." "FLAGS_USE_STANDALONE_EXECUTOR and FLAGS_CONVERT_GRAPH_TO_PROGRAM is set to 1. Graph will be converted to Program and executed using new executor."
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册