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

update ckpt conversion flow to use the new sharded ckpt path structure #332

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

5cp
Copy link
Contributor

@5cp 5cp commented Nov 16, 2023

This recent change in neuronx-distributed affected the checkpoint paths/filenames when saving sharded checkpoints.

This PR adjusts Optimum Neuron's checkpoint consolidation code to use the new path/filename structure.

@@ -38,13 +38,11 @@ def consolidate_tensor_parallel_checkpoints(checkpoint_dir: Union[str, Path]) ->

state_dicts = []

for sharded_checkpoint in checkpoint_dir.glob("tp_rank_*"):
for sharded_checkpoint in sorted(checkpoint_dir.glob("tp_rank_*/checkpoint.pt")):
Copy link
Member

Choose a reason for hiding this comment

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

This will only work for TP right?
It will need to be updated for TP + PP. That's not an issue, just checking.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@dacorvo dacorvo merged commit 99f080f into huggingface:main Nov 21, 2023
4 of 8 checks passed
@dacorvo
Copy link
Collaborator

dacorvo commented Nov 21, 2023

Merging it despite CI failure: CI tokens used to push models to the hub are not available for PR from forks.

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.

4 participants