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

[ckpt-rewr] Generate Metadata State Dict API #3311

Merged
merged 15 commits into from
May 29, 2024
Merged

Conversation

eracah
Copy link
Contributor

@eracah eracah commented May 21, 2024

What does this PR do?

State dict generation currently in composer is coupled with the State, and not very readable, hard to extend, hard to test, and hard for users to harness to do custom things. As such, we present a set of functions to generate state_dict for metadata decoupled from State as a standalone function. By making an explicit function for metadata, it’s easier to test because we have a standalone function (we don’t have to make a dummy State function). Moreover, it’s easier to save each state dict as a separate file Also, an advanced user can just call these functions themselves if they have a custom, advanced script or callback.

@eracah eracah marked this pull request as draft May 21, 2024 00:27
@eracah eracah changed the title [ckpt-rewr] Generate Metadata State Dict [ckpt-rewr] Generate Metadata State Dict API May 21, 2024
@eracah eracah marked this pull request as ready for review May 24, 2024 19:27
composer/checkpoint/state_dict.py Show resolved Hide resolved
composer/checkpoint/state_dict.py Outdated Show resolved Hide resolved
composer/checkpoint/state_dict.py Outdated Show resolved Hide resolved
composer/checkpoint/state_dict.py Outdated Show resolved Hide resolved
composer/checkpoint/state_dict.py Outdated Show resolved Hide resolved
@mvpatel2000
Copy link
Contributor

Can we add a test?

@eracah
Copy link
Contributor Author

eracah commented May 29, 2024

Can we add a test?

added!

Copy link
Contributor

@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.

LGTM!

@eracah eracah merged commit 54c2f88 into mosaicml:dev May 29, 2024
15 checks passed
@mvpatel2000 mvpatel2000 mentioned this pull request Jun 3, 2024
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