Skip to content

Instantly share code, notes, and snippets.

@looselycoupled
Created April 16, 2020 23:11
Show Gist options
  • Save looselycoupled/b257eba6b656209f98d4302ecbeffd3d to your computer and use it in GitHub Desktop.
Save looselycoupled/b257eba6b656209f98d4302ecbeffd3d to your computer and use it in GitHub Desktop.
Simple Ray demo
import ray
from collections import Counter
import socket
from pprint import pprint
ray.init("auto")
@ray.remote
def f(x):
return x + (socket.gethostname(), )
cc = Counter(ray.get([f.remote(f.remote(())) for _ in range(100)]))
pprint(cc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment