Skip to content

[REQUEST] split zero3 checkpoint files into optim states and master weights #4029

Description

@stas00

Currently, if one wants to pull out fp32 weights from the zero-3 checkpoint they have to load the full checkpoints that contain 3x of data that the user needs. And for huge models this can take hours.

I have already created a PR to drop the optim states here #4025 since otherwise the user needs 3x cpu memory, but the fix can only discard that unneeded data after loading it, so it's still very slow.

One of the solutions I proposed is to split each of the fp32+state1+state2 shard files into 2 files:

  1. fp32
  2. state1+state2

that way a user not caring about optim states and just wants to retrieve weights will be able to perform the extraction much much faster.

as I mentioned in the PR, the other option is to switch to https://github.com/huggingface/safetensors/ which allows selective loading of tensors, rather than all-in-one loading.

@tjruwase

Activity

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions