latest (dev)
Copy
Latest development documentation · Updated 2026-10-08
tensorplay.distributed.algorithms.ddp_comm_hooks.default_hooks.bf16_compress_hook
- tensorplay.distributed.algorithms.ddp_comm_hooks.default_hooks.bf16_compress_hook(process_group, bucket)[source]
Warning: This API is experimental, and it requires NCCL version later than 2.9.6.
This DDP communication hook implements a simple gradient compression approach that casts
GradBuckettensor to half-precision Brain floating point format (tensorplay.bfloat16) and then divides it by the process group size. It allreduces thosebfloat16gradient 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, bf16_compress_hook)
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

