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
OpenDAS
apex
Commits
8b9ce244
Unverified
Commit
8b9ce244
authored
Jan 28, 2019
by
mcarilli
Committed by
GitHub
Jan 28, 2019
Browse files
Update two_gpu_unit_test.py
parent
878ba512
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
tests/synced_batchnorm/two_gpu_unit_test.py
tests/synced_batchnorm/two_gpu_unit_test.py
+1
-0
No files found.
tests/synced_batchnorm/two_gpu_unit_test.py
View file @
8b9ce244
...
@@ -94,6 +94,7 @@ out_bn = bn(inp_bn)
...
@@ -94,6 +94,7 @@ out_bn = bn(inp_bn)
out_bn
.
backward
(
grad_bn
)
out_bn
.
backward
(
grad_bn
)
# compensating the averaging over processes done by DDP
# compensating the averaging over processes done by DDP
# in order to produce mathematically equivalent result
# in order to produce mathematically equivalent result
# https://github.com/NVIDIA/apex/issues/134#issuecomment-458307368
for
param
in
bn
.
parameters
():
for
param
in
bn
.
parameters
():
param
.
grad
=
param
.
grad
/
args
.
world_size
param
.
grad
=
param
.
grad
/
args
.
world_size
bn_opt
=
optim
.
SGD
(
bn
.
parameters
(),
lr
=
1.0
)
bn_opt
=
optim
.
SGD
(
bn
.
parameters
(),
lr
=
1.0
)
...
...
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