-
-
Save concreted/37d039f6184add94e912a08322140cc3 to your computer and use it in GitHub Desktop.
Ray Crash Test - No Prefect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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