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
82dac9c9
Commit
82dac9c9
authored
Nov 22, 2019
by
Roshan Rao
Committed by
mcarilli
Nov 22, 2019
Browse files
update _amp_state to check distributed on maybe_print (#620)
parent
37cdaf4a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
apex/amp/_amp_state.py
apex/amp/_amp_state.py
+3
-6
No files found.
apex/amp/_amp_state.py
View file @
82dac9c9
...
@@ -35,12 +35,9 @@ def warn_or_err(msg):
...
@@ -35,12 +35,9 @@ def warn_or_err(msg):
# "hard_override=True to amp.initialize.")
# "hard_override=True to amp.initialize.")
distributed
=
False
if
'WORLD_SIZE'
in
os
.
environ
:
distributed
=
int
(
os
.
environ
[
'WORLD_SIZE'
])
>
1
def
maybe_print
(
msg
,
rank0
=
False
):
def
maybe_print
(
msg
,
rank0
=
False
):
distributed
=
torch
.
distributed
.
is_initialized
()
and
\
torch
.
distributed
.
get_world_size
()
>
1
if
_amp_state
.
verbosity
>
0
:
if
_amp_state
.
verbosity
>
0
:
if
rank0
:
if
rank0
:
if
distributed
:
if
distributed
:
...
...
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