未验证 提交 9d91ae5f 编写于 作者: 武毅 提交者: GitHub

Merge pull request #7669 from putcn/develop

update doc and dist test due to transpiler change
...@@ -101,9 +101,11 @@ t.transpile(optimize_ops, params_grads, pservers=pserver_endpoints, trainers=2) ...@@ -101,9 +101,11 @@ t.transpile(optimize_ops, params_grads, pservers=pserver_endpoints, trainers=2)
... #create executor ... #create executor
# in pserver, run this # in pserver, run this
exe.run(fluid.default_startup_program())
#current_endpoint here means current pserver IP:PORT you wish to run on #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 # in trainer, run this
... # define data reader ... # define data reader
......
...@@ -54,7 +54,8 @@ if training_role == "PSERVER": ...@@ -54,7 +54,8 @@ if training_role == "PSERVER":
print("need env SERVER_ENDPOINT") print("need env SERVER_ENDPOINT")
exit(1) exit(1)
pserver_prog = t.get_pserver_program(current_endpoint) 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) exe.run(pserver_prog)
else: else:
trainer_prog = t.get_trainer_program() trainer_prog = t.get_trainer_program()
......
...@@ -198,7 +198,8 @@ def main(): ...@@ -198,7 +198,8 @@ def main():
print("need env SERVER_ENDPOINT") print("need env SERVER_ENDPOINT")
exit(1) exit(1)
pserver_prog = t.get_pserver_program(current_endpoint) 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) exe.run(pserver_prog)
elif training_role == "TRAINER": elif training_role == "TRAINER":
trainer_prog = t.get_trainer_program() trainer_prog = t.get_trainer_program()
......
...@@ -88,7 +88,8 @@ if training_role == "PSERVER": ...@@ -88,7 +88,8 @@ if training_role == "PSERVER":
print("need env SERVER_ENDPOINT") print("need env SERVER_ENDPOINT")
exit(1) exit(1)
pserver_prog = t.get_pserver_program(current_endpoint) 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) exe.run(pserver_prog)
elif training_role == "TRAINER": elif training_role == "TRAINER":
feeder = fluid.DataFeeder( feeder = fluid.DataFeeder(
......
...@@ -61,7 +61,8 @@ if training_role == "PSERVER": ...@@ -61,7 +61,8 @@ if training_role == "PSERVER":
print("need env SERVER_ENDPOINT") print("need env SERVER_ENDPOINT")
exit(1) exit(1)
pserver_prog = t.get_pserver_program(current_endpoint) 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) exe.run(pserver_prog)
elif training_role == "TRAINER": elif training_role == "TRAINER":
trainer_prog = t.get_trainer_program() trainer_prog = t.get_trainer_program()
......
...@@ -92,15 +92,16 @@ def main(): ...@@ -92,15 +92,16 @@ def main():
t.transpile( t.transpile(
optimize_ops, params_grads, pservers=pserver_endpoints, trainers=2) optimize_ops, params_grads, pservers=pserver_endpoints, trainers=2)
exe.run(fluid.default_startup_program())
if training_role == "PSERVER": if training_role == "PSERVER":
if not current_endpoint: if not current_endpoint:
print("need env SERVER_ENDPOINT") print("need env SERVER_ENDPOINT")
exit(1) exit(1)
pserver_prog = 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) exe.run(pserver_prog)
elif training_role == "TRAINER": elif training_role == "TRAINER":
exe.run(fluid.default_startup_program())
trainer_prog = t.get_trainer_program() trainer_prog = t.get_trainer_program()
feeder = fluid.DataFeeder(feed_list=[data, label], place=place) feeder = fluid.DataFeeder(feed_list=[data, label], place=place)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册