MCPcopy
hub / github.com/yangchris11/samurai / single_proc_run

Function single_proc_run

sam2/training/train.py:28–41  ·  view source on GitHub ↗

Single GPU process

(local_rank, main_port, cfg, world_size)

Source from the content-addressed store, hash-verified

26
27
28def single_proc_run(local_rank, main_port, cfg, world_size):
29 """Single GPU process"""
30 os.environ["MASTER_ADDR"] = "localhost"
31 os.environ["MASTER_PORT"] = str(main_port)
32 os.environ["RANK"] = str(local_rank)
33 os.environ["LOCAL_RANK"] = str(local_rank)
34 os.environ["WORLD_SIZE"] = str(world_size)
35 try:
36 register_omegaconf_resolvers()
37 except Exception as e:
38 logging.info(e)
39
40 trainer = instantiate(cfg.trainer, _recursive_=False)
41 trainer.run()
42
43
44def single_node_runner(cfg, main_port: int):

Callers 1

single_node_runnerFunction · 0.85

Calls 3

infoMethod · 0.80
runMethod · 0.80

Tested by

no test coverage detected