mirror of
https://github.com/wassname/ray.git
synced 2026-07-13 09:37:51 +08:00
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:
committed by
Philipp Moritz
parent
3e67d28922
commit
e399f57e6b
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user