MCPcopy Create free account
hub / github.com/apache/singa / test_dist_opt_fp16_fused

Method test_dist_opt_fp16_fused

test/python/test_dist.py:80–93  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

78 decimal=5)
79
80 def test_dist_opt_fp16_fused(self):
81 # Test the C++ all reduce operation in fp16
82
83 param.set_value(10)
84 grad.set_value(1)
85
86 sgd.fused_all_reduce_half([grad.data], send=False)
87 sgd.fused_all_reduce_half([grad.data])
88 sgd.wait()
89 sgd.update(param, grad)
90
91 np.testing.assert_array_almost_equal(tensor.to_numpy(param),
92 expected,
93 decimal=5)
94
95 def test_dist_opt_spars_value(self):
96 # Test the C++ value based sparsification operation for all reduce

Callers

nothing calls this directly

Calls 4

fused_all_reduce_halfMethod · 0.80
set_valueMethod · 0.45
waitMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected