зеркало из https://github.com/microsoft/msccl.git
name trimming for json file
This commit is contained in:
Родитель
0696e99095
Коммит
d6f8332a4c
|
@ -56,6 +56,16 @@ def parse_cpu_event(event_bytes):
|
|||
'timestamp': int.from_bytes(event_bytes[8:16], byteorder='little', signed=False)
|
||||
}
|
||||
|
||||
def trim_event_name(event_type):
|
||||
list_event_type_name = event_type.split("_")
|
||||
if "NPKIT" in list_event_type_name:
|
||||
list_event_type_name.remove("NPKIT")
|
||||
if "EVENT" in list_event_type_name:
|
||||
list_event_type_name.remove("EVENT")
|
||||
if "ENTRY" in list_event_type_name:
|
||||
list_event_type_name.remove("ENTRY")
|
||||
return "_".join(list_event_type_name)
|
||||
|
||||
def parse_gpu_event_file(npkit_dump_dir, npkit_event_def, rank, buf_idx, gpu_clock_scale, cpu_clock_scale):
|
||||
gpu_event_file_path = os.path.join(npkit_dump_dir, 'gpu_events_rank_%d_buf_%d' % (rank, buf_idx))
|
||||
raw_event_size = 16
|
||||
|
@ -90,7 +100,7 @@ def parse_gpu_event_file(npkit_dump_dir, npkit_event_def, rank, buf_idx, gpu_clo
|
|||
if event_type not in event_type_to_seq:
|
||||
event_type_to_seq[event_type] = 0
|
||||
gpu_events[-1].update({
|
||||
'name': event_type,
|
||||
'name': trim_event_name(event_type),
|
||||
'cat': 'GPU',
|
||||
'args': {
|
||||
'rank': rank,
|
||||
|
|
Загрузка…
Ссылка в новой задаче