MCPcopy Create free account
hub / github.com/OpenGVLab/InternImage / allreduce_hook

Function allreduce_hook

classification/ddp_hooks.py:25–40  ·  view source on GitHub ↗

This DDP communication hook just calls ``allreduce`` using ``GradBucket`` tensors. Once gradient tensors are aggregated across all workers, its ``then`` callback takes the mean and returns the result. If user registers this hook, DDP results is expected to be same as the case where

(
        process_group: dist.ProcessGroup,
        bucket: dist.GradBucket)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls 1

_allreduce_futFunction · 0.85

Tested by

no test coverage detected