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
cd5565be
"docs/source/vscode:/vscode.git/clone" did not exist on "4c2b4c4c3c79b8d1250efe95daf3682fbcdbaa39"
Unverified
Commit
cd5565be
authored
Jan 20, 2021
by
Stas Bekman
Committed by
GitHub
Jan 20, 2021
Browse files
fix the backward for deepspeed (#9705)
parent
538245b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
src/transformers/trainer.py
src/transformers/trainer.py
+1
-2
No files found.
src/transformers/trainer.py
View file @
cd5565be
...
...
@@ -1282,8 +1282,7 @@ class Trainer:
with
amp
.
scale_loss
(
loss
,
self
.
optimizer
)
as
scaled_loss
:
scaled_loss
.
backward
()
elif
self
.
deepspeed
:
# calling on DS engine (model_wrapped == DDP(Deepspeed(PretrainedModule)))
self
.
model_wrapped
.
module
.
backward
(
loss
)
self
.
deepspeed
.
backward
(
loss
)
else
:
loss
.
backward
()
...
...
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