Skip to content
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 checkpoint #945

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

zhangsmallshark
Copy link
Contributor

support checkpoint for domino

args.iteration = load_checkpoint(model, optimizer, opt_param_scheduler)
else:
args.iteration = 0

args.iteration = 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete this line. Otherwise, the args.iteration is wrong if the checkpoint is successfully loaded.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, do we need to change args.train_iters? args.iteration may be larger than args.train_iters if there is a checkpoint.

@@ -503,6 +509,8 @@ def load_checkpoint(model, optimizer, opt_param_scheduler, load_arg='load', stri
load_dir = getattr(args, load_arg)

model = unwrap_model(model)
model_module = model.module
model = [model_module]

state_dict, checkpoint_name, release = _load_base_checkpoint(load_dir, rank0=False)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no exit_on_missing_checkpoint argument now. It will produce the following error if one has argument load but no checkpoint.

[rank1]:     if not args.exit_on_missing_checkpoint:
[rank1]: AttributeError: 'Namespace' object has no attribute 'exit_on_missing_checkpoint'

Copy link

@hwchen2017 hwchen2017 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected. I have one question I'd like to confirm. Do we need to save the status of data loader to avoid reusing data samples?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants