PaddleCloudRoleMaker¶
- class paddle.distributed.fleet. PaddleCloudRoleMaker ( is_collective=False, **kwargs ) [source]
-
PaddleCloudRoleMaker is an interface for distributed configuration initialization based on obtaining distributed related information from environment variables.
Examples
>>> import os >>> import paddle.distributed.fleet as fleet >>> os.environ["PADDLE_PSERVER_NUMS"] = "2" >>> os.environ["PADDLE_TRAINERS_NUM"] = "2" >>> os.environ["POD_IP"] = "127.0.0.1" >>> os.environ["PADDLE_PORT"] = "36001" >>> os.environ["TRAINING_ROLE"] = "PSERVER" >>> os.environ["PADDLE_PSERVERS_IP_PORT_LIST"] = "127.0.0.1:36001,127.0.0.2:36001" >>> os.environ["PADDLE_TRAINER_ID"] = "0" >>> fleet.PaddleCloudRoleMaker(is_collective=False)