Access Remote Devices

How severe does this issue affect your experience of using Ray?

  • None: Just asking a question to see possible options for my implementation

Hi, Ray community!

Is it possible to access clusters’ local resources, such as USB devices from ray tasks or actors? If so, is it a good idea to do so?

An example use case is a cluster of raspberry pi each one connected with a camera.
The main ships out an actor to the remote raspberry pi which detects a certain object using its camera.

The benefits are:

  • We can use raspberry pi CPU to do image capture and classifications
  • We don’t need to ssh to all the raspberry pi to update detection codes

The potential issues are:

  • Significant overhead upon creating the actor if it is complicated
  • The main cannot tell if the destination has proper devices (unless the actor is designed to do so)

I know there are several python libraries that allow us to do this kind of implementation with low security, such as RPyC. However, since I’m already using ray for parallel computing, it will be more convenient and clean to use ray if possible.

I appreciate all of your answers and thoughts!

Yep I think using actors is a pretty reasonable way to provide access to per-machine resources. The main trick would probably be assigning actors to specific nodes. In master (soon 1.13 release), you can schedule actors to particular nodes with scheduling_strategies.NodeAffinitySchedulingStrategy: Scheduling — Ray 2.0.0.dev0

That will allow you to create actors on specific machines. Or, you could create a lot of actors, and after the fact figure out what nodes they landed on and what devices they have access to, etc.

Hi ericl, thanks for your thoughts and information about node scheduling! It sounds like it makes sense to give it a try and I’ll update here if I have any results!