[DDP] Fixes flaky tests caused by incorrect floating-point comparison (#56192)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/50699.
The root cause was that some floating-point assertions had a "greater than or **equal to**" condition. The "equal to" part was causing flakiness due to strict equality check (`==`) in `TestCase.assertGreaterEqual()`. This PR introduces a new assertion method called `assertGreaterAlmostEqual()` in `common_utils.py` that mitigates the problem by behaving similar to `TestCase.assertAlmostEqual()`.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/56192
Reviewed By: zhaojuanmao
Differential Revision: D27804724
Pulled By: cbalioglu
fbshipit-source-id: bc44a41ca4ce45dfee62fb3769fb47bfd9028831