From 8c7355e1dc8266ef5f1c4bf51c5e71f808f484fa Mon Sep 17 00:00:00 2001 From: Phuc Nguyen Date: Sat, 10 Feb 2024 10:04:53 +0000 Subject: [PATCH] refactor --- tests/test_clip_grads.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/test_clip_grads.py b/tests/test_clip_grads.py index 17d5bbc7..558b24a0 100644 --- a/tests/test_clip_grads.py +++ b/tests/test_clip_grads.py @@ -427,12 +427,6 @@ def _test_clip_grads_tied_weights(parallel_context: ParallelContext, norm_type: assert not torch.allclose(old_grad, weight.grad), "Gradients should have changed after clipping" # Test that we get the same gradient after clipping - # torch.testing.assert_close(weight.grad, ref_weight.grad, rtol=1e-7, atol=1e-6) - # torch.testing.assert_close(bias.grad, ref_bias.grad, rtol=1e-7, atol=1e-6) - # torch.testing.assert_close( - # total_norm.cpu(), ref_total_norm.cpu(), rtol=0, atol=0, msg=lambda msg: f"{msg}\n" f"Got {total_norm} and {ref_total_norm}" - # ) - assert torch.allclose(weight.grad, ref_weight.grad, rtol=1e-7, atol=1e-6) assert torch.allclose(bias.grad, ref_bias.grad, rtol=1e-7, atol=1e-6) assert torch.allclose(total_norm, ref_total_norm, rtol=0, atol=0), f"Got {total_norm} and {ref_total_norm}"