[ allennlp.common.testing.distributed_test ]
def init_process( process_rank: int, distributed_device_ids: List[int] = None, world_size: int = 1, func: Callable = None, func_args: Tuple = None, func_kwargs: Dict[str, Any] = None, master_addr: str = "127.0.0.1", master_port: int = 29500 )
def run_distributed_test( device_ids: List[int] = [-1, -1], func: Callable = None, *args, **kwargs )
This runs the
func in a simulated distributed environment.
List of devices. There need to be at least 2 devices. Default is [-1, -1].
funcneeds to be global for spawning the processes, so that it can be pickled.