Repository navigation
Fix all reduce precision in TP Newton Schulz - #304
Conversation
Signed-off-by: Hao Wu <skyw@nvidia.com>
33aeac3 to
5cf479e
Compare
|
| """ | ||
| A = X @ X.mT | ||
| if tp_group is not None: | ||
| A = A.to(torch.float32) |
There was a problem hiding this comment.
Precision fix lacks regression coverage
The new FP32 all-reduce path has no numerical test for BF16 tensor-parallel shards. The distributed step tests use FP32 inputs, where these casts are no-ops, while the medium-precision test checks only argument forwarding. A test with values sensitive to reduction rounding would help catch regressions in the behavior this change fixes.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
/ok to test 5cf479e |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
When fp32 matmul precision is set to medium, we explicitly cast tensor to bfloat16 because PyTorch lack of bfloat16 I/O kernels and will fallback to TF32. However, that has introduced unintentional behavior that all-reduce in TP happens in bf16.