mirror of
https://github.com/vale981/ray
synced 2025-03-06 02:21:39 -05:00
Merge pull request #165 from amplab/sudo
Get rid of numbuf sudo command
This commit is contained in:
commit
28747d3c5e
3 changed files with 4 additions and 7 deletions
|
@ -47,6 +47,9 @@ def from_primitive(primitive_obj):
|
||||||
obj.deserialize(primitive_obj[1])
|
obj.deserialize(primitive_obj[1])
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
|
def is_arrow_serializable(value):
|
||||||
|
return type(value) == np.ndarray and value.dtype.name in ["int8", "int16", "int32", "int64", "uint8", "uint16", "uint32", "uint64", "float32", "float64"]
|
||||||
|
|
||||||
def serialize(worker_capsule, obj):
|
def serialize(worker_capsule, obj):
|
||||||
primitive_obj = to_primitive(obj)
|
primitive_obj = to_primitive(obj)
|
||||||
obj_capsule, contained_objrefs = ray.lib.serialize_object(worker_capsule, primitive_obj) # contained_objrefs is a list of the objrefs contained in obj
|
obj_capsule, contained_objrefs = ray.lib.serialize_object(worker_capsule, primitive_obj) # contained_objrefs is a list of the objrefs contained in obj
|
||||||
|
|
|
@ -6,7 +6,6 @@ from types import ModuleType
|
||||||
import typing
|
import typing
|
||||||
import funcsigs
|
import funcsigs
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pynumbuf
|
|
||||||
import colorama
|
import colorama
|
||||||
|
|
||||||
import ray
|
import ray
|
||||||
|
@ -46,7 +45,7 @@ class Worker(object):
|
||||||
|
|
||||||
def put_object(self, objref, value):
|
def put_object(self, objref, value):
|
||||||
"""Put `value` in the local object store with objref `objref`. This assumes that the value for `objref` has not yet been placed in the local object store."""
|
"""Put `value` in the local object store with objref `objref`. This assumes that the value for `objref` has not yet been placed in the local object store."""
|
||||||
if pynumbuf.serializable(value):
|
if serialization.is_arrow_serializable(value):
|
||||||
ray.lib.put_arrow(self.handle, objref, value)
|
ray.lib.put_arrow(self.handle, objref, value)
|
||||||
else:
|
else:
|
||||||
object_capsule, contained_objrefs = serialization.serialize(self.handle, value) # contained_objrefs is a list of the objrefs contained in object_capsule
|
object_capsule, contained_objrefs = serialization.serialize(self.handle, value) # contained_objrefs is a list of the objrefs contained in object_capsule
|
||||||
|
|
5
setup.sh
5
setup.sh
|
@ -41,9 +41,4 @@ fi
|
||||||
pushd "$ROOT_DIR/thirdparty"
|
pushd "$ROOT_DIR/thirdparty"
|
||||||
./download_thirdparty.sh
|
./download_thirdparty.sh
|
||||||
./build_thirdparty.sh
|
./build_thirdparty.sh
|
||||||
pushd numbuf
|
|
||||||
pushd python
|
|
||||||
sudo python setup.py install
|
|
||||||
popd
|
|
||||||
popd
|
|
||||||
popd
|
popd
|
||||||
|
|
Loading…
Add table
Reference in a new issue