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
01c7fb04
Unverified
Commit
01c7fb04
authored
Mar 17, 2021
by
Stas Bekman
Committed by
GitHub
Mar 17, 2021
Browse files
[DeepSpeed] simplify init (#10762)
parent
0486ccdd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
5 deletions
+0
-5
src/transformers/integrations.py
src/transformers/integrations.py
+0
-5
No files found.
src/transformers/integrations.py
View file @
01c7fb04
...
...
@@ -22,7 +22,6 @@ import os
import
re
import
tempfile
from
pathlib
import
Path
from
types
import
SimpleNamespace
from
.utils
import
logging
from
.utils.versions
import
require_version
...
...
@@ -430,16 +429,12 @@ def init_deepspeed(trainer, num_training_steps):
"enabled"
:
True
,
}
# for clarity extract the specific cl args that are being passed to deepspeed
ds_args
=
dict
(
local_rank
=
args
.
local_rank
)
# keep for quick debug:
# from pprint import pprint; pprint(config)
# init that takes part of the config via `args`, and the bulk of it via `config_params`
model_parameters
=
filter
(
lambda
p
:
p
.
requires_grad
,
model
.
parameters
())
model
,
optimizer
,
_
,
lr_scheduler
=
deepspeed
.
initialize
(
args
=
SimpleNamespace
(
**
ds_args
),
# expects an obj
model
=
model
,
model_parameters
=
model_parameters
,
config_params
=
config
,
...
...
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