init_distributed¶ torchtune.training.init_distributed(**kwargs: Dict[str, Any]) → bool[source]¶ 初始化torch.distributed所需的进程组。 Parameters: **kwargs (Dict[str, Any]) – 传递给 torch.distributed.init_process_group 的额外参数。 Returns: 如果torch.distributed已初始化,则为True。 Return type: bool Raises: RuntimeError – 如果 torch.distributed 已经初始化。