latest (dev)
Copy
Latest development documentation · Updated 2026-10-08
tensorplay.distributed.algorithms.ddp_comm_hooks.default_hooks.fp16_compress_hook
- tensorplay.distributed.algorithms.ddp_comm_hooks.default_hooks.fp16_compress_hook(process_group, bucket)[source]
Compress by casting
GradBucketto float16 divided by process group size.This DDP communication hook implements a simple gradient compression approach that casts
GradBuckettensor to half-precision floating-point format (tensorplay.float16) and then divides it by the process group size. It allreduces thosefloat16gradient tensors. Once compressed gradient tensors are allreduced, the chained callbackdecompresscasts it back to the input data type (such asfloat32).- Example::
>>> # xdoctest: +SKIP >>> ddp_model.register_comm_hook(process_group, fp16_compress_hook)
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

