(self,
func,
num_gpus,
assert_callback=None,
save_all_ranks=False,
*args,
**kwargs)
| 365 | return script_res |
| 366 | |
| 367 | def start(self, |
| 368 | func, |
| 369 | num_gpus, |
| 370 | assert_callback=None, |
| 371 | save_all_ranks=False, |
| 372 | *args, |
| 373 | **kwargs): |
| 374 | from .torch_utils import _find_free_port |
| 375 | ip = socket.gethostbyname(socket.gethostname()) |
| 376 | if 'dist_start_cmd' in kwargs: |
| 377 | dist_start_cmd = kwargs.pop('dist_start_cmd') |
| 378 | else: |
| 379 | dist_start_cmd = '%s -m torch.distributed.launch --nproc_per_node=%d ' \ |
| 380 | '--master_addr=\'%s\' --master_port=%s' % (sys.executable, num_gpus, ip, _find_free_port()) |
| 381 | |
| 382 | return self._start( |
| 383 | dist_start_cmd=dist_start_cmd, |
| 384 | func=func, |
| 385 | num_gpus=num_gpus, |
| 386 | assert_callback=assert_callback, |
| 387 | save_all_ranks=save_all_ranks, |
| 388 | *args, |
| 389 | **kwargs) |
| 390 | |
| 391 | def clean_tmp(self, tmp_file_list): |
| 392 | for file in tmp_file_list: |
no test coverage detected