in sample_workloads/lit-gpt-demo/utilities/monitor_collectives.py [0:0]
def __init__(
self, name, message_size, group=None, peer_rank=None, root_rank=None, correlation_id=None):
self.name = name
self.rank = torch.distributed.get_rank()
self.source_line = _get_call_source_line()
self.message_size = message_size
self.device = torch.cuda.current_device()
self.timestamp = calendar.timegm(datetime.utcnow().utctimetuple())
self.gpu_serial = _GPU_SERIAL
self.vm_id = _VM_ID
if group is not None:
self.group_ranks = torch.distributed.get_process_group_ranks(group=group)
if peer_rank is not None:
self.peer_rank = peer_rank
if root_rank is not None:
self.root_rank = root_rank
if correlation_id is not None:
self.correlation_id = correlation_id