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

Function main

distributed/ddp-tutorial-series/multigpu_torchrun.py:94–100  ·  view source on GitHub ↗
(save_every: int, total_epochs: int, batch_size: int, snapshot_path: str = "snapshot.pt")

Source from the content-addressed store, hash-verified

92
93
94def main(save_every: int, total_epochs: int, batch_size: int, snapshot_path: str = "snapshot.pt"):
95 ddp_setup()
96 dataset, model, optimizer = load_train_objs()
97 train_data = prepare_dataloader(dataset, batch_size)
98 trainer = Trainer(model, train_data, optimizer, save_every, snapshot_path)
99 trainer.train(total_epochs)
100 destroy_process_group()
101
102
103if __name__ == "__main__":

Callers 1

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