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

Use config_dict_or_path for deepspeed.zero.Init #13614

Merged
merged 1 commit into from
Sep 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Use config_dict_or_path for deepspeed.zero.Init
  • Loading branch information
aphedges committed Sep 16, 2021
commit 2c519c73e448b66c7d9e3d069f5834a0073c6e5a
2 changes: 1 addition & 1 deletion src/transformers/modeling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@ def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union[str, os.P
logger.info("Detected DeepSpeed ZeRO-3: activating zero.init() for this model")
# this immediately partitions the model across all gpus, to avoid the overhead in time
# and memory copying it on CPU or each GPU first
with deepspeed.zero.Init(config=deepspeed_config()):
with deepspeed.zero.Init(config_dict_or_path=deepspeed_config()):
with no_init_weights(_enable=_fast_init):
model = cls(config, *model_args, **model_kwargs)
else:
Expand Down