MCPcopy Create free account
hub / github.com/ml-explore/mlx / test_groups

Method test_groups

python/tests/ring_test_distributed.py:15–25  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

13 cls.rtol = 1e-4
14
15 def test_groups(self):
16 world = mx.distributed.init()
17 self.assertEqual(world.size(), 8)
18 self.assertTrue(0 <= world.rank() < 8)
19
20 world2 = mx.distributed.init()
21 self.assertEqual(world.size(), world2.size())
22 self.assertEqual(world.rank(), world2.rank())
23
24 with self.assertRaises(RuntimeError):
25 sub = world.split(world.rank() % 2)
26
27 def test_all_reduce_extra(self):
28 world = mx.distributed.init()

Callers

nothing calls this directly

Calls 4

initMethod · 0.45
sizeMethod · 0.45
rankMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected