Skip to content

Commit

Permalink
include ability to do multigpu training
Browse files Browse the repository at this point in the history
  • Loading branch information
svandenhaute committed Jul 20, 2024
1 parent fdf2739 commit b061b87
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions psiflow/models/mace_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,10 +690,12 @@ def main():
type=str,
)
args = parser.parse_args()
if args.distributed:
world_size = torch.cuda.device_count()
world_size = torch.cuda.device_count()
if world_size > 1:
args.distributed = True
import torch.multiprocessing as mp

mp.spawn(run, args=(args, world_size), nprocs=world_size)
else:
args.distributed = False
run(0, args, 1)

0 comments on commit b061b87

Please sign in to comment.