Esempio n. 1
0
def _test__native_dist_model_spawn(backend, num_workers_per_machine, device):
    _NativeDistModel.spawn(
        _test_dist_spawn_fn,
        args=(backend, num_workers_per_machine, device),
        kwargs_dict={},
        backend=backend,
        nproc_per_node=num_workers_per_machine,
    )
Esempio n. 2
0
def _test__native_dist_model_spawn(backend,
                                   num_workers_per_machine,
                                   device,
                                   init_method=None,
                                   **spawn_kwargs):
    kwargs_dict = {}
    for key in ["master_addr", "master_port"]:
        if key in spawn_kwargs:
            kwargs_dict[key] = spawn_kwargs[key]

    _NativeDistModel.spawn(
        _test_dist_spawn_fn,
        args=(backend, num_workers_per_machine, device),
        kwargs_dict=kwargs_dict,
        backend=backend,
        nproc_per_node=num_workers_per_machine,
        init_method=init_method,
        **spawn_kwargs,
    )