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 10 commits into
base: master
Choose a base branch
from
Open

Conversation

zhangsmallshark
Copy link
Contributor

support checkpoint for domino

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?

@GuanhuaWang
Copy link

Looks good to me.

cc @tjruwase

@GuanhuaWang
Copy link

GuanhuaWang commented Jan 28, 2025

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?

@hwchen2017 , this is a good question, if this is standard in pytorch or megatron, we should keep, otherwise we can skip it.

@@ -16,7 +16,7 @@
from megatron import get_tensorboard_writer
from megatron.core import mpu, tensor_parallel
from megatron.arguments import parse_args, validate_args
from megatron.checkpointing import load_args_from_checkpoint
# from megatron.checkpointing import load_args_from_checkpoint
Copy link
Contributor

Choose a reason for hiding this comment

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

Delete instead of comment.

@@ -241,7 +247,7 @@ def save_checkpoint(iteration, model, optimizer, opt_param_scheduler):

# Arguments, iteration, and model.
state_dict = {}
state_dict['args'] = args
# state_dict['args'] = args
Copy link
Contributor

Choose a reason for hiding this comment

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

It is better to preserve args as it stores useful information for restarts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tjruwase thanks for the suggestion. I have fixed it.

@tjruwase
Copy link
Contributor

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?

This is a reason why args is saved as part of checkpoint. I recommend following the pattern in Megatron-DeepSpeed
https://github.com/microsoft/Megatron-DeepSpeed/blob/f4157bea69f3df8c6cb66f2ebcda66ba03d1288e/megatron/checkpointing.py#L602-L611

@GuanhuaWang
Copy link

@zhangsmallshark please address above comments. Thanks!

@zhangsmallshark
Copy link
Contributor Author

@GuanhuaWang I fixed it. Please check it.

@loadams
Copy link
Contributor

loadams commented Feb 10, 2025

@zhangsmallshark - could you sign off with DCO on this PR? It replaces the CLA we had before. To fix it, the steps should be here

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.

5 participants