Skip to content

[XRay] GPU label support #1870

Closed
Closed
@pcmoritz

Description

@pcmoritz

Start two raylets:

ray start --head --use-raylet --num-gpus 1
ray start --redis-address 172.31.23.99:28629 --use-raylet --num-gpus 1

Execute this script:

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import ray

@ray.remote(num_gpus=1)
class Worker(object):

    def __init__(self):
        pass

    def get_node_ip(self):
        return ray.services.get_node_ip_address()

ray.init(redis_address="172.31.23.99:28629", use_raylet=True)
ws = [Worker.remote() for i in range(10)]

print("XXX", [ray.get(w.get_node_ip.remote()) for w in ws])

Output:

XXX ['172.31.23.99', '172.31.23.99', '172.31.23.99', '172.31.23.99', '172.31.23.99', '172.31.23.99', '172.31.23.99', '172.31.23.99', '172.31.23.99', '172.31.23.99']

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions