Skip to content

Commit

Permalink
update doc and dist test due to API change PaddlePaddle#7619 (review)
Browse files Browse the repository at this point in the history
  • Loading branch information
putcn committed Jan 19, 2018
1 parent 7a68787 commit 95d6dce
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 9 deletions.
6 changes: 4 additions & 2 deletions doc/howto/usage/cluster/fluid_cluster_train_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,11 @@ t.transpile(optimize_ops, params_grads, pservers=pserver_endpoints, trainers=2)
... #create executor

# in pserver, run this
exe.run(fluid.default_startup_program())
#current_endpoint here means current pserver IP:PORT you wish to run on
exe.run(t.get_pserver_program(current_endpoint))
pserver_prog = t.get_pserver_program(current_endpoint)
pserver_startup = t.get_startup_program(current_endpoint, pserver_prog)
exe.run(pserver_startup)
exe.run(pserver_prog)

# in trainer, run this
... # define data reader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
print("need env SERVER_ENDPOINT")
exit(1)
pserver_prog = t.get_pserver_program(current_endpoint)
exe.run(fluid.default_startup_program())
pserver_startup = t.get_startup_program(current_endpoint, pserver_prog)
exe.run(pserver_startup)
exe.run(pserver_prog)
else:
trainer_prog = t.get_trainer_program()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ def main():
print("need env SERVER_ENDPOINT")
exit(1)
pserver_prog = t.get_pserver_program(current_endpoint)
exe.run(fluid.default_startup_program())
pserver_startup = t.get_startup_program(current_endpoint, pserver_prog)
exe.run(pserver_startup)
exe.run(pserver_prog)
elif training_role == "TRAINER":
trainer_prog = t.get_trainer_program()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
print("need env SERVER_ENDPOINT")
exit(1)
pserver_prog = t.get_pserver_program(current_endpoint)
exe.run(fluid.default_startup_program())
pserver_startup = t.get_startup_program(current_endpoint, pserver_prog)
exe.run(pserver_startup)
exe.run(pserver_prog)
elif training_role == "TRAINER":
feeder = fluid.DataFeeder(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
print("need env SERVER_ENDPOINT")
exit(1)
pserver_prog = t.get_pserver_program(current_endpoint)
exe.run(fluid.default_startup_program())
pserver_startup = t.get_startup_program(current_endpoint, pserver_prog)
exe.run(pserver_startup)
exe.run(pserver_prog)
elif training_role == "TRAINER":
trainer_prog = t.get_trainer_program()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
print("need env SERVER_ENDPOINT")
exit(1)
pserver_prog = t.get_pserver_program(current_endpoint)
exe.run(fluid.default_startup_program())
pserver_startup = t.get_startup_program(current_endpoint, pserver_prog)
exe.run(pserver_startup)
exe.run(pserver_prog)
elif training_role == "TRAINER":
trainer_prog = t.get_trainer_program()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,16 @@ def main():
t.transpile(
optimize_ops, params_grads, pservers=pserver_endpoints, trainers=2)

exe.run(fluid.default_startup_program())

if training_role == "PSERVER":
if not current_endpoint:
print("need env SERVER_ENDPOINT")
exit(1)
pserver_prog = t.get_pserver_program(current_endpoint)
pserver_startup = t.get_startup_program(current_endpoint, pserver_prog)
exe.run(pserver_startup)
exe.run(pserver_prog)
elif training_role == "TRAINER":
exe.run(fluid.default_startup_program())
trainer_prog = t.get_trainer_program()
feeder = fluid.DataFeeder(feed_list=[data, label], place=place)

Expand Down

0 comments on commit 95d6dce

Please sign in to comment.