(self)
| 49 | decimal=5) |
| 50 | |
| 51 | def test_dist_opt_fp32_fused(self): |
| 52 | # Test the C++ all reduce operation in fp32 |
| 53 | |
| 54 | param.set_value(10) |
| 55 | grad.set_value(1) |
| 56 | |
| 57 | sgd.fused_all_reduce([grad.data], send=False) |
| 58 | sgd.fused_all_reduce([grad.data]) |
| 59 | sgd.wait() |
| 60 | sgd.update(param, grad) |
| 61 | |
| 62 | np.testing.assert_array_almost_equal(tensor.to_numpy(param), |
| 63 | expected, |
| 64 | decimal=5) |
| 65 | |
| 66 | def test_dist_opt_fp16(self): |
| 67 | # Test the C++ all reduce operation in fp16 |
nothing calls this directly
no test coverage detected