mirror of
https://github.com/wassname/ray.git
synced 2026-08-12 12:20:11 +08:00
Fix large memory tests. (#632)
* Log the driver ID in hex instead of binary. * Fix large memory test and add more tests to it. * Remove tests that are too stressful.
This commit is contained in:
committed by
Philipp Moritz
parent
23b0c80967
commit
2694337c0f
@@ -225,7 +225,7 @@ class Monitor(object):
|
||||
"""
|
||||
message = DriverTableMessage.GetRootAsDriverTableMessage(data, 0)
|
||||
driver_id = message.DriverId()
|
||||
log.info("Driver {} has been removed.".format(driver_id))
|
||||
log.info("Driver {} has been removed.".format(binary_to_hex(driver_id)))
|
||||
|
||||
# Get a list of the local schedulers.
|
||||
client_table = ray.global_state.client_table()
|
||||
|
||||
@@ -3,48 +3,33 @@ from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
import numpy as np
|
||||
from numpy.testing import assert_almost_equal
|
||||
|
||||
import ray
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
ray.init()
|
||||
ray.init(num_workers=0)
|
||||
|
||||
A = np.zeros(2 ** 31 + 1, dtype="int8")
|
||||
A = np.ones(2 ** 31 + 1, dtype="int8")
|
||||
a = ray.put(A)
|
||||
assert_almost_equal(ray.get(a), A)
|
||||
assert np.sum(ray.get(a)) == np.sum(A)
|
||||
del A
|
||||
del a
|
||||
print("Successfully put A.")
|
||||
|
||||
# B = {"hello": np.zeros(2 ** 30 + 1),
|
||||
# "world": np.ones(2 ** 30 + 1)}
|
||||
# b = ray.put(B)
|
||||
# assert_almost_equal(ray.get(b)["hello"], B["hello"])
|
||||
# assert_almost_equal(ray.get(b)["world"], B["world"])
|
||||
# del B
|
||||
# del b
|
||||
# print("Successfully put B.")
|
||||
B = {"hello": np.zeros(2 ** 30 + 1),
|
||||
"world": np.ones(2 ** 30 + 1)}
|
||||
b = ray.put(B)
|
||||
assert np.sum(ray.get(b)["hello"]) == np.sum(B["hello"])
|
||||
assert np.sum(ray.get(b)["world"]) == np.sum(B["world"])
|
||||
del B
|
||||
del b
|
||||
print("Successfully put B.")
|
||||
|
||||
# C = [np.ones(2 ** 30 + 1), 42.0 * np.ones(2 ** 30 + 1)]
|
||||
# c = ray.put(C)
|
||||
# assert_almost_equal(ray.get(c)[0], C[0])
|
||||
# assert_almost_equal(ray.get(c)[1], C[1])
|
||||
# del C
|
||||
# del c
|
||||
# print("Successfully put C.")
|
||||
|
||||
# D = (2 ** 30 + 1) * ["h"]
|
||||
# d = ray.put(D)
|
||||
# assert ray.get(d) == D
|
||||
# del D
|
||||
# del d
|
||||
# print("Successfully put D.")
|
||||
|
||||
# E = (2 ** 30 + 1) * ("i",)
|
||||
# e = ray.put(E)
|
||||
# assert ray.get(e) == E
|
||||
# del E
|
||||
# del e
|
||||
# print("Successfully put E.")
|
||||
C = [np.ones(2 ** 30 + 1), 42.0 * np.ones(2 ** 30 + 1)]
|
||||
c = ray.put(C)
|
||||
assert np.sum(ray.get(c)[0]) == np.sum(C[0])
|
||||
assert np.sum(ray.get(c)[1]) == np.sum(C[1])
|
||||
del C
|
||||
del c
|
||||
print("Successfully put C.")
|
||||
|
||||
Reference in New Issue
Block a user