-
-
Notifications
You must be signed in to change notification settings - Fork 645
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 rank param to Checkpoint #2633
Add rank param to Checkpoint #2633
Conversation
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.
Thanks for the PR @sadra-barikbin !
I haven't checked everything and will continue the review later
ignite/handlers/checkpoint.py
Outdated
# all tpu procs should enter here as internally performs sync across device | ||
self._save_func(checkpoint, path, xm.save) |
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.
For XLA all procs should enter xm.save, but now you added if self.save_on_rank == idist.get_rank():
on the top, so only one proc will enter this function. Am I missing something?
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 corrected it
ignite/handlers/checkpoint.py
Outdated
When running on XLA devices or using :class:`~torch.distributed.optim.ZeroRedundancyOptimizer`, it | ||
should be run in all processes, otherwise application can get stuck on saving the checkpoint. |
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.
We may need to rephrase this sentence...
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.
How exactly do you mean?
|
||
import torch | ||
import torch.nn as nn | ||
from torch.distributed.optim import ZeroRedundancyOptimizer |
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.
Ignite is supposed to work with pytorch 1.3.1 where ZeroRedundancyOptimizer
is absent. We have to deal with this import differently.
Fixes #2623
Description:
Check list: