Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
bec2e3f5
Unverified
Commit
bec2e3f5
authored
Sep 16, 2021
by
Stas Bekman
Committed by
GitHub
Sep 16, 2021
Browse files
[deepspeed] replaced deprecated init arg (#13587)
* [deepspeed] replaced deprecated init arg * Trigger CI
parent
4d5b4c78
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
setup.py
setup.py
+1
-1
src/transformers/dependency_versions_table.py
src/transformers/dependency_versions_table.py
+1
-1
src/transformers/modeling_utils.py
src/transformers/modeling_utils.py
+1
-1
No files found.
setup.py
View file @
bec2e3f5
...
...
@@ -90,7 +90,7 @@ _deps = [
"cookiecutter==1.7.2"
,
"dataclasses"
,
"datasets"
,
"deepspeed>=0.5.
1
"
,
"deepspeed>=0.5.
3
"
,
"docutils==0.16.0"
,
"fairscale>0.3"
,
"faiss-cpu"
,
...
...
src/transformers/dependency_versions_table.py
View file @
bec2e3f5
...
...
@@ -8,7 +8,7 @@ deps = {
"cookiecutter"
:
"cookiecutter==1.7.2"
,
"dataclasses"
:
"dataclasses"
,
"datasets"
:
"datasets"
,
"deepspeed"
:
"deepspeed>=0.5.
1
"
,
"deepspeed"
:
"deepspeed>=0.5.
3
"
,
"docutils"
:
"docutils==0.16.0"
,
"fairscale"
:
"fairscale>0.3"
,
"faiss-cpu"
:
"faiss-cpu"
,
...
...
src/transformers/modeling_utils.py
View file @
bec2e3f5
...
...
@@ -492,7 +492,7 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix
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
()):
model
=
cls
(
config
,
**
kwargs
)
else
:
model
=
cls
(
config
,
**
kwargs
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment