-
Notifications
You must be signed in to change notification settings - Fork 620
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1875 from ChenglongMa/fix-collect-result-from-mul…
…ti-gpu-bug [🐛 BUG] Fix bugs when collecting results from `mp.spawn` in multi-GPU training
- Loading branch information
Showing
6 changed files
with
204 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from recbole.quick_start.quick_start import ( | ||
run, | ||
run_recbole, | ||
objective_function, | ||
load_data_and_model, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,9 +8,8 @@ | |
# @Email : [email protected], [email protected], [email protected] | ||
|
||
import argparse | ||
from ast import arg | ||
|
||
from recbole.quick_start import run_recbole, run_recboles | ||
from recbole.quick_start import run | ||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser() | ||
|
@@ -44,26 +43,13 @@ | |
args.config_files.strip().split(" ") if args.config_files else None | ||
) | ||
|
||
if args.nproc == 1 and args.world_size <= 0: | ||
run_recbole( | ||
model=args.model, dataset=args.dataset, config_file_list=config_file_list | ||
) | ||
else: | ||
if args.world_size == -1: | ||
args.world_size = args.nproc | ||
import torch.multiprocessing as mp | ||
|
||
mp.spawn( | ||
run_recboles, | ||
args=( | ||
args.model, | ||
args.dataset, | ||
config_file_list, | ||
args.ip, | ||
args.port, | ||
args.world_size, | ||
args.nproc, | ||
args.group_offset, | ||
), | ||
nprocs=args.nproc, | ||
) | ||
run( | ||
args.model, | ||
args.dataset, | ||
config_file_list=config_file_list, | ||
nproc=args.nproc, | ||
world_size=args.world_size, | ||
ip=args.ip, | ||
port=args.port, | ||
group_offset=args.group_offset, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.