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

Final singlefile checkpoint saves one folder up #127

Merged
merged 3 commits into from
Jan 14, 2025
Merged

Conversation

daviswer
Copy link
Collaborator

Addresses #126

Adjusts the save location of final single-file checkpoint to be one folder up (directly in the specified ckp directory, rather than under the 'checkpoints' subfolder). That way the dataloader checkpointer only has to deal with distributed checkpoint folders.

@daviswer daviswer requested a review from lchu6 January 14, 2025 21:12
@lchu6
Copy link
Contributor

lchu6 commented Jan 14, 2025

@daviswer one convention I have been using is:

ckpt_root_folder/checkpoints/step_xxx: for dcp
ckpt_root_folder/pth/step_xxx: for pth
ckpt_root_folder/hf/step_xxx: for converted hf format

would using this convention fit the need here as well? if so, we can use this convention.

@daviswer
Copy link
Collaborator Author

oh yeah that's a good idea, I'll set that up

Signed-off-by: Davis Wertheimer <[email protected]>
@lchu6
Copy link
Contributor

lchu6 commented Jan 14, 2025

@daviswer is the final pth file a single file or multiple?

@lchu6
Copy link
Contributor

lchu6 commented Jan 14, 2025

I think we should make it ckpt_root_folder/pth/step_xxx/consolidated.00.pth.

This will make it easier for future consumption/conversion, e.g. https://github.com/huggingface/transformers/blob/main/src/transformers/models/llama/convert_llama_weights_to_hf.py#L231

to summarize, our folders should look like:
ckpt_root_folder/checkpoints/step_xxx/: many dcp files
ckpt_root_folder/pth/step_xxx/: single consolidated.00.pth file
ckpt_root_folder/hf/step_xxx/: many safetensor files

@daviswer
Copy link
Collaborator Author

Sure I can do that. It is always a single file.

@lchu6 lchu6 merged commit 0fdb43d into main Jan 14, 2025
3 of 4 checks passed
@lchu6 lchu6 deleted the ckp-path-handling branch January 14, 2025 23:59
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