Let actors use GPUs. (#302)

* Add num_cpus and num_gpus to actor decorator.

* Assign GPU IDs to actors.

* Add additional actor test.

* Remove duplicated line.

* Factor out local scheduler selection method.

* Add test and simplify local scheduler selection.
This commit is contained in:
Robert Nishihara
2017-02-21 01:13:04 -08:00
committed by Philipp Moritz
parent 3e67d28922
commit e399f57e6b
5 changed files with 357 additions and 64 deletions
+5 -7
View File
@@ -2,12 +2,10 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import ray.worker
def get_local_schedulers():
def get_local_schedulers(worker):
local_schedulers = []
for client in ray.worker.global_worker.redis_client.keys("CL:*"):
client_type, ray_client_id = ray.worker.global_worker.redis_client.hmget(client, "client_type", "ray_client_id")
if client_type == b"photon":
local_schedulers.append(ray_client_id)
for client in worker.redis_client.keys("CL:*"):
client_info = worker.redis_client.hgetall(client)
if client_info[b"client_type"] == b"photon":
local_schedulers.append(client_info)
return local_schedulers