e7b34962326713aa65383c509c7939f2a007211b,torch/distributed/algorithms/ddp_comm_hooks/default_hooks.py,,allreduce_hook,#Any#Any#,5

Before Change


    world_size = group_to_use.size()

    tensor = bucket.get_tensors()[0]
    fut = dist.all_reduce(tensor, group=group_to_use, async_op=True).get_future()

    def then_callback(fut):
        return [fut.value()[0].div_(world_size)]

    return fut.then(then_callback)


def fp16_compress_hook(
    process_group: dist.ProcessGroup, bucket: dist._GradBucket

After Change


    Example::
        >>> ddp_model.register_comm_hook(process_group, allreduce_hook)
    
    return allreduce_fut(process_group, bucket.get_tensors()[0])


def fp16_compress_hook(
    process_group: dist.ProcessGroup, bucket: dist._GradBucket
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 8

Instances


Project Name: pytorch/pytorch
Commit Name: e7b34962326713aa65383c509c7939f2a007211b
Time: 2021-01-28
Author: wayi@fb.com
File Name: torch/distributed/algorithms/ddp_comm_hooks/default_hooks.py
Class Name:
Method Name: allreduce_hook


Project Name: pytorch/pytorch
Commit Name: e7b34962326713aa65383c509c7939f2a007211b
Time: 2021-01-28
Author: wayi@fb.com
File Name: torch/distributed/algorithms/ddp_comm_hooks/powerSGD_hook.py
Class Name:
Method Name: powerSGD_hook


Project Name: pytorch/pytorch
Commit Name: 0831984ed5d7d5fff4dda8d77139360b1b58bbc0
Time: 2021-02-01
Author: wayi@fb.com
File Name: torch/distributed/algorithms/ddp_comm_hooks/powerSGD_hook.py
Class Name:
Method Name: powerSGD_hook


Project Name: pytorch/pytorch
Commit Name: 0831984ed5d7d5fff4dda8d77139360b1b58bbc0
Time: 2021-02-01
Author: wayi@fb.com
File Name: torch/distributed/algorithms/ddp_comm_hooks/default_hooks.py
Class Name:
Method Name: allreduce_hook