mirror of
https://github.com/vale981/ray
synced 2025-03-09 04:46:38 -04:00
31 lines
567 B
Python
31 lines
567 B
Python
from __future__ import absolute_import
|
|
from __future__ import division
|
|
from __future__ import print_function
|
|
|
|
import ray
|
|
|
|
|
|
@ray.remote
|
|
def f():
|
|
return 0
|
|
|
|
|
|
@ray.remote
|
|
def g():
|
|
import time
|
|
start = time.time()
|
|
while time.time() < start + 1:
|
|
ray.get([f.remote() for _ in range(10)])
|
|
|
|
|
|
# 10MB -> hangs after ~5 iterations
|
|
# 20MB -> hangs after ~20 iterations
|
|
# 50MB -> hangs after ~50 iterations
|
|
ray.init(redis_max_memory=1024 * 1024 * 50)
|
|
|
|
i = 0
|
|
for i in range(100):
|
|
i += 1
|
|
a = g.remote()
|
|
[ok], _ = ray.wait([a])
|
|
print("iter", i)
|