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.
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
add support for distributed data parallel training #116
add support for distributed data parallel training #116
Changes from 4 commits
51ea2cd
71122c9
d0b0da2
333d73f
707dfbe
eb90f19
f2586ce
443b000
f8bc646
c929434
0389ea4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
hum. I am rather unsure about this. where do you shuffle the data then?
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.
Fair point. I found this warning in the PyTorch docs:
So in my current implementation,
train_sampler.set_epoch(epoch)
is missing, which I will add now.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.
Perfect. Once you have finished your change, I will run the code myself. Once I get it working, I will merge the PR.
Final question, can you try to load and run the existing checkpoints? I just want to be sure that people can reproduce our results. Thx.
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.
Ok, I refactored the training loop to use
num_epochs
instead ofFLAGS.total_steps
, sincesampler.set_epoch(epoch)
uses an epoch count. However, I think we need to change more than this. The PyTorch warning I pasted above mentions that we need to usesampler.set_epoch(epoch)
"before creating theDataLoader
iterator", but right now, the data loader iterator is created once before the training loop:The way I would change this is by having a training loop like this:
Is this fine by you? IMO, what is a bit tricky is to handle the
step
counter correctly (based on which checkpoints are saved and some samples during training are generated). In a distributed setup, we'll have several processes running in parallel, and thus, we would probably save checkpoints and images multiple times (once per process/GPU). However, since the filenames do not reflect the process ID, one process would also overwrite the files of the other. What do you think?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.
About your question: When you say "existing checkpoints", which ones do you mean? I had once run the training and generation of samples on one GPU and gotten an FID of
3.8
(which is only slightly worse than the3.5
you report).