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
e49dca6e
Commit
e49dca6e
authored
Feb 16, 2019
by
root
Browse files
fixing it to work properly in multi-node environment
parent
598fbc88
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
tests/synced_batchnorm/test_groups.py
tests/synced_batchnorm/test_groups.py
+1
-1
No files found.
tests/synced_batchnorm/test_groups.py
View file @
e49dca6e
...
...
@@ -120,7 +120,7 @@ bn_opt = optim.SGD(bn.parameters(), lr=1.0)
for
group_num
in
(
range
(
args
.
world_size
//
args
.
group_size
)):
group_ids
=
range
(
group_num
*
args
.
group_size
,
(
group_num
+
1
)
*
args
.
group_size
)
cur_group
=
torch
.
distributed
.
new_group
(
ranks
=
group_ids
)
if
(
args
.
local
_rank
//
args
.
group_size
==
group_num
):
if
(
torch
.
distributed
.
get
_rank
()
//
args
.
group_size
==
group_num
):
group
=
cur_group
sbn
=
apex
.
parallel
.
SyncBatchNorm
(
feature_size
,
process_group
=
group
).
cuda
()
...
...
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