code: def append(self, raw_name, record_name, latency, msg_size):
      import deepspeed.comm as dist
  
      algbw, busbw = calc_bw_log(raw_name, msg_size, latency)
      if record_name in self.comms_dict.keys():
          # If this comm_op has already been logged with this message size, just add to existing record
          if msg_size in self.comms_dict[record_name].keys():
              self.comms_dict[record_name][msg_size][0] += 1
              self.comms_dict[record_name][msg_size][1].append(latency)
              self.comms_dict[record_name][msg_size][2].append(algbw)
              self.comms_dict[record_name][msg_size][3].append(busbw)
          # If this is a new message size for this comm_op, add new record under existing comm_op
          else:
              self.comms_dict[record_name][msg_size] = [
                  1,
                  [latency],
                  [algbw],
                  [busbw],
              ]
      else:
          # Create entirely new record
          self.comms_dict[record_name] = {
              msg_size: [1, [latency], [algbw], [busbw]]
          }
      # If verbose, print every comm op
      # TODO: Add to tensorboard
      if self.verbose:
          n = dist.get_world_size()
          log_str = (
              f"rank={dist.get_rank()} | comm op: "
              + record_name
              + " | time (ms): {:.2f}".format(latency)
          )
          log_str += " | msg size: " + convert_size(msg_size)
          log_str += " | algbw (Gbps): {:.2f} ".format(algbw)
          log_str += " | busbw (Gbps): {:.2f} ".format(busbw)
          log_dist(log_str, [0])
  
file_path: H2O/h2o_flexgen/benchmark/third_party/DeepSpeed/deepspeed/utils/comms_logging.py
imports: import math
  from deepspeed.utils import log_dist
label_desc: Use image node_id 7 for calling the CommsLogger obj's underlying member method code with example usage: obj.append(raw_name, record_name, latency, msg_size) without return types