-
Notifications
You must be signed in to change notification settings - Fork 620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementing multi-GPUs Training for RecBole #961
Open
juyongjiang
wants to merge
1
commit into
RUCAIBox:master
Choose a base branch
from
juyongjiang:fix_multi_gpus
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not understand this loop, it seems
batch_data
will be the last 'data' ofdis_loader
, could you please explain it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And did you test your code in some datasets like ml-100k? Could you provide us the performance results of models? I want to know if the model performance will change a lot compared with single-GPU training.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, Xingyu! Yeah, my pleasure! In our
DataLoader
class, I assignbatch_size=dataset.shape[0]
that means it extracts all data in currentbatch_size
. So the length ofdis_loader
will be only one, i.e. like thisfor data in range(1)
.https://github.com/juyongjiang/RecBole/blob/0d35771629f65a9a06ad7e66dd11bfbe06091971/recbole/trainer/trainer.py#L173-L180
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, of course! Please wait for a moment! I will provide a table to illustrate the performance compared with single GPU training.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@2017pxy Hi, Xingyu! I have got the experimental results. It seems that it doesn't decrease the performance a lot but significantly reduces the training time by about 3.78 times. BTW, I just run the experiment only one time. So I think this performance drift can be ignored. : )
Note that the original item means I got the result through running your original RecBole code. And multi-GPUs item result is produced by 3 multi-GPUs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@2017pxy Any further questions and or comments? Thanks in advance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @juyongjiang @hunkim, sorry for late reply.
Following your implementation, our team modified the
trainer
and made some tests. We find your implementation works well for model training. Thanks for your contribution!However, since the time cost of
run_recbole
is mainly from model evaluation, we want to implement the multi-GPUs evaluation as well and release together with the multi-GPUs training. Unfortunately, we face some problems when we apply your implementations to evaluation since the data organization for evaluation is different. Thus, I am sorry to tell you that it still takes some time to release this new feature, and even this new feature might not be added in next version.Thanks again for your implementation, and if you have any idea or suggestions about multi-GPUs evaluation, please let us know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@2017pxy Okay, got it! Thanks for your reply. I will implement the multi-GPUs evaluation as well and pull a new request. : )