|
|
|
|
|
by cwp
238 days ago
|
|
The code example is very similar to Ray. Monarch: class Example(Actor):
@endpoint
def say_hello(self, txt):
return f"hello {txt}"
procs = this_host().spawn_procs({"gpus": 8})
actors = procs.spawn("actors", Example)
hello_future = actors.say_hello.call("world")
hello_future.get()
Ray: @ray.remote(num_gpus=1)
class Example:
def say_hello(self, txt):
return f"hello {txt}"
actors = [Example.remote() for _ in range(8)]
hello_object_refs = [a.say_hello.remote("world") for a in actors]
ray.get(hello_object_refs)
|
|