Skip to content

Instantly share code, notes, and snippets.

@concreted
Created May 3, 2023 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save concreted/37d039f6184add94e912a08322140cc3 to your computer and use it in GitHub Desktop.
Save concreted/37d039f6184add94e912a08322140cc3 to your computer and use it in GitHub Desktop.
Ray Crash Test - No Prefect
import ray
import time
class foo:
def __init__(self):
pass
def run(self, i):
return f"hi {i}"
def test():
f = ray.remote(num_gpus=0)(foo)
pool = ray.util.ActorPool([f.remote()])
print(pool)
results = pool.map(lambda a, i: a.run.remote(i), [1])
print(list(results))
print("done")
def sleep():
time.sleep(60 * 10)
def ray_test():
test()
sleep()
if __name__ == "__main__":
ray_test()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment