-
-
Notifications
You must be signed in to change notification settings - Fork 780
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
Fix Deepspeed loading #950
Conversation
@@ -285,6 +286,9 @@ def load_model( | |||
model_kwargs["max_memory"] = cfg.max_memory | |||
model_kwargs["torch_dtype"] = cfg.torch_dtype | |||
|
|||
if is_deepspeed_zero3_enabled(): | |||
del model_kwargs["device_map"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you have to delete this key?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deepspeed maps the weights on its own and doesn't want device_map set
unfrozen_parameters: | ||
# - lm_head.* | ||
# - model.embed_tokens.* | ||
# - model.layers.2[0-9]+.block_sparse_moe.gate.* | ||
# - model.layers.2[0-9]+.block_sparse_moe.experts.* | ||
# - model.layers.3[0-9]+.block_sparse_moe.gate.* | ||
# - model.layers.3[0-9]+.block_sparse_moe.experts.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@winglian this example is good but perhaps can you add this new unfrozen_parameters
to the top level README ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also add a comment about how the regex works in the docs so people know?
@winglian Really excited that you got this in so fast! Just have a suggestion about docs. I'm happy to add it too for you in a follow on PR |
thanks for the review. I'll get this added to the docs later tonight or tomorrow. |
deepspeed wasn't loading properly to shard the model weights when loading them.
This PR fixes
example that freezes everything except layers 20-31