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
ColossalAI
Commits
4f26fabe
Commit
4f26fabe
authored
Mar 07, 2022
by
HELSON
Committed by
Frank Lee
Mar 11, 2022
Browse files
fixed strings in profiler outputs (#325)
parent
de0468c7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
colossalai/utils/profiler/comm_profiler.py
colossalai/utils/profiler/comm_profiler.py
+5
-5
No files found.
colossalai/utils/profiler/comm_profiler.py
View file @
4f26fabe
...
@@ -38,11 +38,11 @@ def _format_memory(nbytes):
...
@@ -38,11 +38,11 @@ def _format_memory(nbytes):
MB
=
1024
*
KB
MB
=
1024
*
KB
GB
=
1024
*
MB
GB
=
1024
*
MB
if
(
abs
(
nbytes
)
>=
GB
):
if
(
abs
(
nbytes
)
>=
GB
):
return
'{:.2f} G
b
'
.
format
(
nbytes
*
1.0
/
GB
)
return
'{:.2f} G
B
'
.
format
(
nbytes
*
1.0
/
GB
)
elif
(
abs
(
nbytes
)
>=
MB
):
elif
(
abs
(
nbytes
)
>=
MB
):
return
'{:.2f} M
b
'
.
format
(
nbytes
*
1.0
/
MB
)
return
'{:.2f} M
B
'
.
format
(
nbytes
*
1.0
/
MB
)
elif
(
abs
(
nbytes
)
>=
KB
):
elif
(
abs
(
nbytes
)
>=
KB
):
return
'{:.2f} K
b
'
.
format
(
nbytes
*
1.0
/
KB
)
return
'{:.2f} K
B
'
.
format
(
nbytes
*
1.0
/
KB
)
else
:
else
:
return
str
(
nbytes
)
+
' b'
return
str
(
nbytes
)
+
' b'
...
@@ -52,9 +52,9 @@ def _format_bandwith(volme: float, time_us: int):
...
@@ -52,9 +52,9 @@ def _format_bandwith(volme: float, time_us: int):
mb_per_sec
=
volme
/
time_us
*
sec_div_mb
mb_per_sec
=
volme
/
time_us
*
sec_div_mb
if
mb_per_sec
>=
1024.0
:
if
mb_per_sec
>=
1024.0
:
return
'{:.3f} G
b
/s'
.
format
(
mb_per_sec
/
1024.0
)
return
'{:.3f} G
B
/s'
.
format
(
mb_per_sec
/
1024.0
)
else
:
else
:
return
'{:.3f} M
b
/s'
.
format
(
mb_per_sec
)
return
'{:.3f} M
B
/s'
.
format
(
mb_per_sec
)
class
CommEvent
(
object
):
class
CommEvent
(
object
):
...
...
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