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

Create callback to load checkpoint #3641

Merged
merged 19 commits into from
Oct 7, 2024

Conversation

irenedea
Copy link
Contributor

@irenedea irenedea commented Oct 1, 2024

What does this PR do?

Adds a new callback to load a checkpoint at a specified event. This enables use cases like loading model base weights with peft.

Manual Test

Ran two lora finetuning runs.
test-load-checkpoint-callback-baseline-K0m4fq: Initialized from Huggingface checkpoint and ran for 100 batches
test-load-checkpoint-callback-resume-GS8oWj: Initialized using this callback and the baseline checkpoint at ba50.

We see that the losses match up.
image

Also confirmed that the adapter-only checkpoint is smaller than a full checkpoint as expected.

What issue(s) does this change relate to?

Before submitting

  • Have you read the contributor guidelines?
  • Is this change a documentation change or typo fix? If so, skip the rest of this checklist.
  • Was this change discussed/approved in a GitHub issue first? It is much more likely to be merged if so.
  • Did you update any related docs and document your change?
  • Did you update any related tests and add any new tests related to your change? (see testing)
  • Did you run the tests locally to make sure they pass?
  • Did you run pre-commit on your change? (see the pre-commit section of prerequisites)

@irenedea irenedea force-pushed the load-checkpoint-callback branch from 00682c7 to 758314d Compare October 1, 2024 07:19
@irenedea irenedea force-pushed the load-checkpoint-callback branch from 8624131 to 71976bf Compare October 3, 2024 21:13
@irenedea irenedea force-pushed the load-checkpoint-callback branch from 71976bf to c40e7cc Compare October 3, 2024 22:42
@irenedea irenedea force-pushed the load-checkpoint-callback branch from a3a8dd9 to 9eb9c50 Compare October 4, 2024 22:52
@irenedea irenedea marked this pull request as ready for review October 5, 2024 00:17
@irenedea irenedea requested a review from a team as a code owner October 5, 2024 00:17
Copy link
Contributor

@dakinggg dakinggg left a comment

Choose a reason for hiding this comment

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

looks right to me

pyproject.toml Outdated Show resolved Hide resolved
composer/callbacks/load_checkpoint.py Show resolved Hide resolved
@irenedea irenedea enabled auto-merge (squash) October 7, 2024 18:20
@irenedea irenedea merged commit bb7ea43 into mosaicml:main Oct 7, 2024
14 checks passed
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.

3 participants