Fix the resetting of reusable variables on the driver and cache functions to run on all workers. (#446)

* Properly reset reusable variables on the driver when remote functions are run locally on the driver.

* Cache functions to run on all workers that occur before ray.init is called.
This commit is contained in:
Robert Nishihara
2016-10-12 22:17:22 -07:00
committed by Philipp Moritz
parent 1c3aaf7189
commit 0a44145906
4 changed files with 245 additions and 32 deletions
-2
View File
@@ -47,7 +47,6 @@ class DistributedArrayTest(unittest.TestCase):
for module in [ra.core, ra.random, ra.linalg, da.core, da.random, da.linalg]:
reload(module)
ray.init(start_ray_local=True, num_workers=1)
ray.register_class(da.DistArray)
a = ra.ones.remote([da.BLOCK_SIZE, da.BLOCK_SIZE])
b = ra.zeros.remote([da.BLOCK_SIZE, da.BLOCK_SIZE])
@@ -60,7 +59,6 @@ class DistributedArrayTest(unittest.TestCase):
for module in [ra.core, ra.random, ra.linalg, da.core, da.random, da.linalg]:
reload(module)
ray.init(start_ray_local=True, num_objstores=2, num_workers=10)
ray.register_class(da.DistArray)
x = da.zeros.remote([9, 25, 51], "float")
assert_equal(ray.get(da.assemble.remote(x)), np.zeros([9, 25, 51]))