Skip to content

[request] new method to save the fp32 model #800

Closed

Description

@stas00

Currently checkpoint saves the original fp32 weights in zero_pp_rank_* files, which makes it inaccessible to users who may need the final result to be used elsewhere w/o Deepspeed (e.g. inference or a different system).

So we need deepspeed.save_model() which will reconstruct the master weights and save them as model.bin.

For context for this need please see: #797

Thank you.

Activity

  1. stas00 commented on Feb 27, 2021

    @stas00
    CollaboratorAuthor

    @ShadenSmith shared elsewhere that

    each fp32 param group is stored in a flattened buffer in the fp16 optimizer here and needs to be exposed as a method. The key is to unflatten each buffer into an fp32 copy of the model params (this would be looped over each param group)

  2. stas00 commented on Mar 18, 2021

    @stas00
    CollaboratorAuthor

    Any chances this new method to save the fp32 model can be added?

    Users are reporting struggles when they customize their saving/loading of the checkpoints
    huggingface/transformers#10789

    I think there is also a problem to switch from zero2 checkpoint to zero3, correct? Which means that we really need to salvage the fp32 model weights from the zero2 checkpoint before it can be loaded in zero3.

    Thank you!

    @ShadenSmith, @jeffra

  3. stas00 commented on Mar 26, 2021

    @stas00
    CollaboratorAuthor

    PR with solution: #892

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions