Fix distributed Newton-Schulz correctness - #3541
vcherepanov-nv wants to merge 3 commits into
Conversation
- Explicitly enable cuSOLVERMp input normalization and compute-type Gram reduction. - Validate distributed dimensions and reject unsupported tall low-level inputs. - Reduce device workspace requirements to the grid-wide maximum. - Synchronize workspace cleanup and retain host workspace for asynchronous operations. - Normalize the test reference and evaluate Gram and reference errors in FP32. - Use rank-independent aligned test shapes and strict absolute tolerances. Tests: - pytest -q tests/pytorch/distributed/test_newton_schulz.py - torchrun workers with 1, 2, 4, and 8 processes Signed-off-by: Vladimir Cherepanov <vcherepanov@nvidia.com>
|
There was a problem hiding this comment.
It generally looks good to me. Did this PR fix the two bugs we have on L40s then?
Could you address the first P2 comment from Greptile? I feel the second P2 can be explained by the new n <= m requirement. Does the requirement come from cusolvermp? Should we note it somewhere in the docstring?
Also, do we need to apply these same fixes on the Jax side? (Not for this PR, but as a followup if necessary.)
Please run all the necessary CI as well (especially L1). Thanks!
Cache cuSOLVERMp workspace configurations and retain the NCCL reduction scalar so repeated optimizer steps avoid redundant workspace queries, allocations, collectives, and stream synchronization. Restore tall tensor-parallel coverage for supported layouts and reject distributed partitions along the smaller matrix dimension with a clear error. Tests: - ninja -C build/cmake transformer_engine - pytest -q tests/pytorch/distributed/test_newton_schulz.py (2 passed) Signed-off-by: Vladimir Cherepanov <vcherepanov@nvidia.com>
for more information, see https://pre-commit.ci
Description
Fix a number of numerical correctness issues in Newton-Schulz
Fixes # (issue)
Type of change
Changes
Please list the changes introduced in this PR:
Checklist: