MCPcopy Create free account
hub / github.com/modelscope/modelscope / start

Method start

modelscope/utils/test_utils.py:367–389  ·  view source on GitHub ↗
(self,
              func,
              num_gpus,
              assert_callback=None,
              save_all_ranks=False,
              *args,
              **kwargs)

Source from the content-addressed store, hash-verified

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:

Callers 1

_get_file_hash_asyncFunction · 0.45

Calls 2

_startMethod · 0.95
_find_free_portFunction · 0.85

Tested by

no test coverage detected