composer
composer copied to clipboard
[ckpt-rewr] Generate Metadata State Dict API
trafficstars
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.