PA1 Discussion
An Introduction to Ray and Modin
Revisiting the Why
Why learn Ray?
Why learn Ray?
Why learn Ray?
What is Ray?
Ray Libraries
Ray Cluster
Ray Core
Ray Core- Tasks
@ray.remote
def square(x):
return x * x
# Launch four parallel square tasks.
futures = [square.remote(i) for i in range(4)]
# .remote() returns an ObjectRef
# Retrieve results.
print(ray.get(futures))
Ray Core - Actors
# Define the Counter actor.
@ray.remote
class Counter:
def __init__(self):
self.i = 0
def get(self):
return self.i
def incr(self, value):
self.i += value
# Create a Counter actor.
c = Counter.remote()
for _ in range(10):
c.incr.remote(1)
# Retrieve final actor state.
print(ray.get(c.get.remote()))
Ray Core - Objects & Object Store
Ray AI Runtime (AIR)
Modin- Multi-Core Pandas
References