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

Function fp16_compress_hook

classification/ddp_hooks.py:43–71  ·  view source on GitHub ↗

This DDP communication hook implements a simple gradient compression approach that casts ``GradBucket`` tensor to half-precision floating-point format (``torch.float16``) and then divides it by the process group size. It allreduces those ``float16`` gradient tensors. Once compressed

(
        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

toMethod · 0.80

Tested by

no test coverage detected