From 4f26fabe4fc14ab9fa607ba6679de5aaab7c3759 Mon Sep 17 00:00:00 2001 From: HELSON <72907851+1SAA@users.noreply.github.com> Date: Mon, 7 Mar 2022 17:08:56 +0800 Subject: [PATCH] fixed strings in profiler outputs (#325) --- colossalai/utils/profiler/comm_profiler.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/colossalai/utils/profiler/comm_profiler.py b/colossalai/utils/profiler/comm_profiler.py index 8413597c3..5ffef66c8 100644 --- a/colossalai/utils/profiler/comm_profiler.py +++ b/colossalai/utils/profiler/comm_profiler.py @@ -38,11 +38,11 @@ def _format_memory(nbytes): MB = 1024 * KB GB = 1024 * MB if (abs(nbytes) >= GB): - return '{:.2f} Gb'.format(nbytes * 1.0 / GB) + return '{:.2f} GB'.format(nbytes * 1.0 / GB) elif (abs(nbytes) >= MB): - return '{:.2f} Mb'.format(nbytes * 1.0 / MB) + return '{:.2f} MB'.format(nbytes * 1.0 / MB) elif (abs(nbytes) >= KB): - return '{:.2f} Kb'.format(nbytes * 1.0 / KB) + return '{:.2f} KB'.format(nbytes * 1.0 / KB) else: return str(nbytes) + ' b' @@ -52,9 +52,9 @@ def _format_bandwith(volme: float, time_us: int): mb_per_sec = volme / time_us * sec_div_mb if mb_per_sec >= 1024.0: - return '{:.3f} Gb/s'.format(mb_per_sec / 1024.0) + return '{:.3f} GB/s'.format(mb_per_sec / 1024.0) else: - return '{:.3f} Mb/s'.format(mb_per_sec) + return '{:.3f} MB/s'.format(mb_per_sec) class CommEvent(object):