Skip to content

add parameter server launch#18687

Merged
guru4elephant merged 1 commit intoPaddlePaddle:developfrom
guru4elephant:add_ps_launch
Jul 22, 2019
Merged

add parameter server launch#18687
guru4elephant merged 1 commit intoPaddlePaddle:developfrom
guru4elephant:add_ps_launch

Conversation

@guru4elephant
Copy link
Member

@guru4elephant guru4elephant commented Jul 18, 2019

test=develop

python -m distributed.launch_ps --worker_num 2 --server_num 2 trainer.py

When a user uses Paddle, he or she may use PaddleCloudRoleMaker which is very easy to local current processes' role. This pr mainly focuses on launch a parameter server job with worker_num and server_num configuration.
Example code is as follows:

import paddle.fluid.incubate.fleet.base.role_maker as role_maker
from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import fleet

role = role_maker.PaddleCloudRoleMaker()
fleet.init(role)

if fleet.is_server():
    fleet.init_server()
    fleet.run_server()

elif fleet.is_worker():
    fleet.init_worker()
    exe.run(fleet.startup_program)

"--cluster_node_ips",
type=str,
default="127.0.0.1",
help="Paddle cluster nodes ips, such as 192.168.0.16,192.168.0.17..")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete ..

server_num = args.server_num
start_port = args.start_port
default_env = os.environ.copy()
current_env = copy.copy(default_env)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why copy twice

Copy link
Collaborator

@seiriosPlus seiriosPlus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@guru4elephant guru4elephant merged commit 70b0376 into PaddlePaddle:develop Jul 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants