MCPcopy Create free account
hub / github.com/pytorch/examples / main

Function main

distributed/ddp-tutorial-series/multigpu.py:86–92  ·  view source on GitHub ↗
(rank: int, world_size: int, save_every: int, total_epochs: int, batch_size: int)

Source from the content-addressed store, hash-verified

84
85
86def main(rank: int, world_size: int, save_every: int, total_epochs: int, batch_size: int):
87 ddp_setup(rank, world_size)
88 dataset, model, optimizer = load_train_objs()
89 train_data = prepare_dataloader(dataset, batch_size)
90 trainer = Trainer(model, train_data, optimizer, rank, save_every)
91 trainer.train(total_epochs)
92 destroy_process_group()
93
94
95if __name__ == "__main__":

Callers

nothing calls this directly

Calls 5

trainMethod · 0.95
ddp_setupFunction · 0.70
load_train_objsFunction · 0.70
prepare_dataloaderFunction · 0.70
TrainerClass · 0.70

Tested by

no test coverage detected