[Core] put small objects in memory store (#8972)

* remove the put in memory store

* put small objects directly in memory store

* cast data type

* fix another place that uses Put to spill to plasma store

* fix multiple tests related to memory limits

* partially fix test_metrics

* remove not functioning codes

* fix core_worker_test

* refactor put to plasma codes

* add a flag for the new feature

* add flag to more places

* do a warmup round for the plasma store

* lint

* lint again

* fix warmup store

* Update _raylet.pyx

Co-authored-by: Eric Liang <ekhliang@gmail.com>
This commit is contained in:
Zhuohan Li
2020-07-09 15:39:40 -07:00
committed by GitHub
parent 34b85659d4
commit 8a76f4cbb5
18 changed files with 132 additions and 51 deletions
+4 -4
View File
@@ -4,6 +4,7 @@ import grpc
import pytest
import requests
import time
import numpy as np
import ray
from ray.core.generated import node_manager_pb2
@@ -180,7 +181,7 @@ def test_raylet_info_endpoint(shutdown_only):
self.local_storage = [f.remote() for _ in range(10)]
def remote_store(self):
self.remote_storage = ray.put("test")
self.remote_storage = ray.put(np.zeros(200 * 1024, dtype=np.uint8))
def getpid(self):
return os.getpid()
@@ -443,9 +444,8 @@ def test_memory_dashboard(shutdown_only):
return True
def test_object_pineed_in_memory():
import numpy as np
a = ray.put(np.zeros(1))
a = ray.put(np.zeros(200 * 1024, dtype=np.uint8))
b = ray.get(a) # Noqa F841
del a
@@ -469,7 +469,7 @@ def test_memory_dashboard(shutdown_only):
def f(arg):
time.sleep(1)
a = ray.put(None) # Noqa F841
a = ray.put(np.zeros(200 * 1024, dtype=np.uint8)) # Noqa F841
b = f.remote(a) # Noqa F841
wait_for_condition(memory_table_ready)