MCPcopy
hub / github.com/deepspeedai/DeepSpeed / append

Method append

deepspeed/utils/comms_logging.py:104–123  ·  view source on GitHub ↗
(self, raw_name, record_name, latency, msg_size)

Source from the content-addressed store, hash-verified

102
103 # Add log entry
104 def append(self, raw_name, record_name, latency, msg_size):
105 algbw, busbw = calc_bw_log(raw_name, msg_size, latency)
106 if record_name in self.comms_dict.keys():
107 # If this comm_op has already been logged with this message size, just add to existing record
108 if msg_size in self.comms_dict[record_name].keys():
109 self.comms_dict[record_name][msg_size][0] += 1
110 self.comms_dict[record_name][msg_size][1].append(latency)
111 self.comms_dict[record_name][msg_size][2].append(algbw)
112 self.comms_dict[record_name][msg_size][3].append(busbw)
113 # If this is a new message size for this comm_op, add new record under existing comm_op
114 else:
115 self.comms_dict[record_name][msg_size] = [1, [latency], [algbw], [busbw]]
116 else:
117 # Create entirely new record
118 self.comms_dict[record_name] = {msg_size: [1, [latency], [algbw], [busbw]]}
119 # If verbose, print every comm op
120 # TODO: Add to tensorboard
121 if self.verbose:
122 log_str = f"comm op: {record_name} | time (ms): {latency:.2f} | msg size: {convert_size(msg_size)} | algbw (Gbps): {algbw:.2f} | busbw (Gbps): {busbw:.2f}"
123 log_dist(log_str, [0])
124
125 def get_raw_data(self):
126 """

Callers 15

setup.pyFile · 0.80
get_header_pyFunction · 0.80
get_header_cFunction · 0.80
get_header_bashFunction · 0.80
check-torchcuda.pyFile · 0.80
check-license.pyFile · 0.80
test_e2e_squad.pyFile · 0.80
forwardMethod · 0.80
get_modulesMethod · 0.80
forwardMethod · 0.80
__init__Method · 0.80

Calls 3

log_distFunction · 0.90
calc_bw_logFunction · 0.85
convert_sizeFunction · 0.85

Tested by 15

forwardMethod · 0.64
create_modelsFunction · 0.64
forwardMethod · 0.64
create_modelsFunction · 0.64
test_readMethod · 0.64
test_writeMethod · 0.64
test_offset_writeMethod · 0.64
test_offset_readMethod · 0.64
test_readMethod · 0.64
test_writeMethod · 0.64
test_offset_writeMethod · 0.64
test_offset_readMethod · 0.64