Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SwissArmyTransformer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
thukeg
SwissArmyTransformer
Commits
aff0493f
Commit
aff0493f
authored
3 years ago
by
Zhengxiao Du
Browse files
Options
Downloads
Patches
Plain Diff
Fix train_step while gradient accumulation
parent
653ab4db
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SwissArmyTransformer/training/deepspeed_training.py
+3
-1
3 additions, 1 deletion
SwissArmyTransformer/training/deepspeed_training.py
with
3 additions
and
1 deletion
SwissArmyTransformer/training/deepspeed_training.py
+
3
−
1
View file @
aff0493f
...
@@ -386,7 +386,9 @@ def train_step(data_iterator, model, optimizer, lr_scheduler,
...
@@ -386,7 +386,9 @@ def train_step(data_iterator, model, optimizer, lr_scheduler,
timers
(
'
optimizer
'
).
stop
()
timers
(
'
optimizer
'
).
stop
()
if
complete
or
single_step
:
if
complete
or
single_step
:
break
break
return
lm_loss_reduced
,
skipped_iter
,
metrics
lm_loss_total
/=
count
metrics_total
=
{
key
:
value
/
count
for
key
,
value
in
metrics_total
.
items
()}
return
lm_loss_total
,
skipped_iter
,
metrics_total
def
backward_step
(
optimizer
,
model
,
loss
,
args
,
timers
):
def
backward_step
(
optimizer
,
model
,
loss
,
args
,
timers
):
"""
Backward step.
"""
"""
Backward step.
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment