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

Method init_dist

modelscope/trainers/trainer.py:340–354  ·  view source on GitHub ↗

Init dist and returns the dist information. Args: launcher: The launcher info. Returns: _dist: If world_size is greater than 1.

(self, launcher=None)

Source from the content-addressed store, hash-verified

338 return train_data_collator, eval_data_collator
339
340 def init_dist(self, launcher=None):
341 """Init dist and returns the dist information.
342
343 Args:
344 launcher: The launcher info.
345
346 Returns:
347 _dist: If world_size is greater than 1.
348 """
349 if launcher is not None:
350 init_dist(launcher)
351
352 _, world_size = get_dist_info()
353 _dist = world_size > 1
354 return _dist
355
356 def get_device(self, device=None):
357 """Get the device information.

Callers

nothing calls this directly

Calls 2

init_distFunction · 0.90
get_dist_infoFunction · 0.90

Tested by

no test coverage detected