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
17e1a1f6
"cacheflow/vscode:/vscode.git/clone" did not exist on "c128c2ed0309dd1ff684ac0da2f8fc7ea5994b77"
Unverified
Commit
17e1a1f6
authored
Feb 25, 2022
by
Masaki Kozuki
Committed by
GitHub
Feb 25, 2022
Browse files
[transformer] use logger in microbatches module (#1302)
parent
4506a687
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
apex/transformer/microbatches.py
apex/transformer/microbatches.py
+8
-3
No files found.
apex/transformer/microbatches.py
View file @
17e1a1f6
...
...
@@ -17,6 +17,11 @@ from abc import ABC
from
abc
import
abstractmethod
from
typing
import
Optional
,
List
from
apex.transformer.log_util
import
get_transformer_logger
_logger
=
get_transformer_logger
(
__name__
)
def
build_num_microbatches_calculator
(
rank
:
int
,
...
...
@@ -31,8 +36,8 @@ def build_num_microbatches_calculator(
global_batch_size
,
micro_batch_size
,
data_parallel_size
)
if
rank
==
0
:
print
(
"setting number of micro-batches to constant {}"
.
format
(
num_microbatches_calculator
.
get
())
,
flush
=
True
_logger
.
info
(
"setting number of micro-batches to constant {}"
.
format
(
num_microbatches_calculator
.
get
())
)
else
:
...
...
@@ -45,7 +50,7 @@ def build_num_microbatches_calculator(
batch_size_increment
=
int
(
rampup_batch_size
[
1
])
ramup_samples
=
int
(
rampup_batch_size
[
2
])
if
rank
==
0
:
print
(
_logger
.
info
(
"will use batch size rampup starting from global batch "
"size {} to global batch size {} with batch size increments "
"{} over {} samples."
.
format
(
...
...
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