Hey, all I have a couple of questions:
Question 1)
Is there a way to make a function remote on the fly?
Let’s say I have some given function foo.
I know I can do
@ray.remote
def bar(*args):
return foo(*args)
I was curious if there is a built-in utility for doing:
from ray.util import remotify <=== something like this
remotify(foo).remote(*args)
I know I could write remotify but I want to limit the amount of custom code / I feel like I’ve seen it but I just can’t find it rn.
Question 2)
If I have a remote function that calls out to other remote functions what is the right number of CPU’s to give the first function? Should it requires sum(dependent functions) + self.
For example:
@ray.remote(num_cpus=1)
def bar(arg):
print(“foo” + arg)
return “bar”
@ray.remote(num_cpus=x)
def foo():
bars = ray.get([bar(i) for i in range(100)])
return bars
What should I set x to
101? Or 1?