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
f84226b7
Unverified
Commit
f84226b7
authored
Jul 30, 2021
by
harshithapv
Committed by
GitHub
Jul 30, 2021
Browse files
Log Azure ML metrics only for rank 0 (#12766)
* minor change to log azureml only for rank 0 * fix typo
parent
5c673efa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/integrations.py
src/transformers/integrations.py
+1
-1
No files found.
src/transformers/integrations.py
View file @
f84226b7
...
@@ -600,7 +600,7 @@ class AzureMLCallback(TrainerCallback):
...
@@ -600,7 +600,7 @@ class AzureMLCallback(TrainerCallback):
self
.
azureml_run
=
Run
.
get_context
()
self
.
azureml_run
=
Run
.
get_context
()
def
on_log
(
self
,
args
,
state
,
control
,
logs
=
None
,
**
kwargs
):
def
on_log
(
self
,
args
,
state
,
control
,
logs
=
None
,
**
kwargs
):
if
self
.
azureml_run
:
if
self
.
azureml_run
and
state
.
is_world_process_zero
:
for
k
,
v
in
logs
.
items
():
for
k
,
v
in
logs
.
items
():
if
isinstance
(
v
,
(
int
,
float
)):
if
isinstance
(
v
,
(
int
,
float
)):
self
.
azureml_run
.
log
(
k
,
v
,
description
=
k
)
self
.
azureml_run
.
log
(
k
,
v
,
description
=
k
)
...
...
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