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

DeepSpeed Zero3 is Incompatible with Freeze Range Code #1687

Open
7 of 8 tasks
josharian opened this issue Jun 6, 2024 · 0 comments
Open
7 of 8 tasks

DeepSpeed Zero3 is Incompatible with Freeze Range Code #1687

josharian opened this issue Jun 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@josharian
Copy link
Contributor

Please check that this issue hasn't been reported before.

  • I searched previous Bug Reports didn't find any similar reports.

Expected Behavior

Set up a config like:

unfrozen_parameters:
 - ^model.embed_tokens.weight$[128256:] # only train the new tokens

deepspeed: deepspeed_configs/zero3.json

Train.

Expect something like:

Unfrozen model.embed_tokens.weight with ranges [(128256, 130304)]

Got:

Unfrozen model.embed_tokens.weight with ranges [(128256, 0)]

This leads to things...not working as intended.

#1686 will make diagnosis/recognition of this easier. But it doesn't fix the root problem.

AFAICT, the root problem is that deepspeed/zero3.json changes model loading such that the parameters no longer have their original shapes, like this:

>>> print(model.state_dict()["model.embed_tokens.weight"].shape)
torch.Size([0])

As a result, when range end is None, it gets set to 0.

(It also appears that this may mess with model saving as well. My saved models with deepspeed/zero3.json are way too small, possible because they have shape torch.Size([0]) for almost all layers.)

Current behaviour

see above

Steps to reproduce

see above

Config yaml

No response

Possible solution

No response

Which Operating Systems are you using?

  • Linux
  • macOS
  • Windows

Python Version

3.11

axolotl branch-commit

whatever docker image has (how do i get this from the docker image?)

Acknowledgements

  • My issue title is concise, descriptive, and in title casing.
  • I have searched the existing issues to make sure this bug has not been reported yet.
  • I am using the latest version of axolotl.
  • I have provided enough information for the maintainers to reproduce and diagnose the issue.
@josharian josharian added the bug Something isn't working label Jun 6, 2024
@josharian josharian changed the title deepspeed zero3 is incompatible with range code DeepSpeed Zero3 is Incompatible with Freeze Range Code Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant