MCPcopy
hub / github.com/PaddlePaddle/PaddleFormers / init_dist_env

Method init_dist_env

tests/testing_utils.py:496–509  ·  view source on GitHub ↗
(self, config: dict = {})

Source from the content-addressed store, hash-verified

494
495class GPUsTesting(unittest.TestCase):
496 def init_dist_env(self, config: dict = {}):
497 world_size = paddle.distributed.get_world_size()
498 strategy = fleet.DistributedStrategy()
499 hybrid_configs = {
500 "dp_degree": 1,
501 "mp_degree": world_size,
502 "pp_degree": 1,
503 "sharding_degree": 1,
504 }
505 hybrid_configs.update(config)
506 strategy.hybrid_configs = hybrid_configs
507
508 fleet.init(is_collective=True, strategy=strategy)
509 fleet.get_hybrid_communicate_group()
510
511
512def set_proxy(download_hub: DownloadSource = None):

Callers

nothing calls this directly

Calls 3

get_world_sizeMethod · 0.80
updateMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected