8000 [logging][ez] Add timer logging for pickling and unpickle for object … · pytorch/pytorch@41e4d88 · GitHub
[go: up one dir, main page]

Skip to content

Commit 41e4d88

Browse files
fduwjjpytorchmergebot
authored andcommitted
[logging][ez] Add timer logging for pickling and unpickle for object based collective (#139757)
Summary: As discussed, we want to measure the time spent during pickling and unpickle. Test Plan: CI Reviewed By: wz337 Differential Revision: D65462767 Pull Request resolved: #139757 Approved by: https://github.com/awgu, https://github.com/Skylion007, https://github.com/fegin, https://github.com/c-p-i-o
1 parent 5860c8e commit 41e4d88

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

torch/distributed/distributed_c10d.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2812,6 +2812,7 @@ def reduce(tensor, dst, op=ReduceOp.SUM, group=None, async_op=False):
28122812
work.wait()
28132813

28142814

2815+
@_time_logger
28152816
def _object_to_tensor(obj, device, group):
28162817
f = io.BytesIO()
28172818
_pickler(f).dump(obj)
@@ -2831,6 +2832,7 @@ def _object_to_tensor(obj, device, group):
28312832
return byte_tensor, local_size
28322833

28332834

2835+
@_time_logger
28342836
def _tensor_to_object(tensor, tensor_size, group):
28352837
if get_debug_level() == DebugLevel.DETAIL and is_nccl_available():
28362838
backend = get_backend(group)

0 commit comments

Comments
 (0)
0