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 a callback to write huggingface checkpoints during the training run #594

Merged
merged 30 commits into from
Sep 14, 2023

Conversation

dakinggg
Copy link
Collaborator

@dakinggg dakinggg commented Sep 12, 2023

This adds a callback that does the huggingface checkpoint conversion during the training job to avoid further difficulty after the job is complete, and take advantage of backgrounded uploads while training is happening.

  • add precision
  • manual mpt test (7b-mpt-hf-ckpt-4-jc3uSG)
  • manual llama2 test (l7b-hf-ckpt-4-HpZUAg)

@dakinggg dakinggg marked this pull request as ready for review September 12, 2023 08:37
Copy link
Collaborator

@mvpatel2000 mvpatel2000 left a comment

Choose a reason for hiding this comment

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

Should this be in Composer?

@mvpatel2000 mvpatel2000 self-requested a review September 12, 2023 16:38
Copy link
Collaborator

@mvpatel2000 mvpatel2000 left a comment

Choose a reason for hiding this comment

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

Will defer to Evan on this one

llmfoundry/callbacks/hf_checkpointer.py Outdated Show resolved Hide resolved
Copy link
Contributor

@eracah eracah left a comment

Choose a reason for hiding this comment

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

Nice looks pretty good. Def doable to make a SaveForInferenceCallback I think in the future. Also some good nuggets here for refactoring CheckpointSaver

llmfoundry/callbacks/hf_checkpointer.py Show resolved Hide resolved
llmfoundry/callbacks/hf_checkpointer.py Show resolved Hide resolved
llmfoundry/callbacks/hf_checkpointer.py Show resolved Hide resolved
@eracah
Copy link
Contributor

eracah commented Sep 12, 2023

Should this be in Composer?

At some point yes

Copy link
Collaborator

@mvpatel2000 mvpatel2000 left a comment

Choose a reason for hiding this comment

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

Can we add a flag to only save at end? I imagine the most common use case is I just want to convert to HF once im done training

@dakinggg
Copy link
Collaborator Author

@mvpatel2000 can't you just specify 1dur as the save interval?

@mvpatel2000
Copy link
Collaborator

@mvpatel2000 can't you just specify 1dur as the save interval?

🤯 ur so big brained

Copy link
Contributor

@eracah eracah left a comment

Choose a reason for hiding this comment

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

Aight LGTM

@dakinggg dakinggg enabled auto-merge (squash) September 14, 2023 18:38
@dakinggg dakinggg merged commit 30544f0 into mosaicml:main Sep 14, 2023
8 checks passed
@germanjke
Copy link

@eracah @dakinggg hi guys! This thing supports no-MPT models, like LLaMA?

@dakinggg
Copy link
Collaborator Author

dakinggg commented Oct 3, 2023

yes

@dakinggg dakinggg deleted the hf-checkpointer branch October 11, 2023 23:05
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.

None yet

5 participants