diff --git a/benchmark/fluid/fluid_benchmark.py b/benchmark/fluid/fluid_benchmark.py index d0a72b92d9d8b35c5087f44947505e83d55e6cf5..5f3ce300acc44ad8d2898c27296b866c403f3cc8 100644 --- a/benchmark/fluid/fluid_benchmark.py +++ b/benchmark/fluid/fluid_benchmark.py @@ -168,7 +168,7 @@ def train_parallel(train_args, test_args, args, train_prog, test_prog, startup_exe = fluid.Executor(place) startup_exe.run(startup_prog) strategy = fluid.ExecutionStrategy() - strategy.num_threads = 0 #args.cpus + strategy.num_threads = args.cpus strategy.allow_op_delay = False build_strategy = fluid.BuildStrategy() if args.reduce_strategy == "reduce": @@ -188,8 +188,6 @@ def train_parallel(train_args, test_args, args, train_prog, test_prog, num_trainers = 1 trainer_id = 0 - print('Use parallel_executor') - strategy.type = 2 exe = fluid.ParallelExecutor( True, avg_loss.name, diff --git a/benchmark/fluid/models/resnet.py b/benchmark/fluid/models/resnet.py index 947c497ce2b9becd1282b62187f743008985a17f..f692e7722a1c9a54a4509ce7c78cc68e1f28da74 100644 --- a/benchmark/fluid/models/resnet.py +++ b/benchmark/fluid/models/resnet.py @@ -172,7 +172,7 @@ def get_model(args, is_train, main_prog, startup_prog): reader, dshape, class_dim = _model_reader_dshape_classdim(args, is_train) pyreader = None - trainer_count = int(os.getenv("PADDLE_TRAINERS", 1)) + trainer_count = int(os.getenv("PADDLE_TRAINERS")) with fluid.program_guard(main_prog, startup_prog): with fluid.unique_name.guard(): if args.use_reader_op: