Distrbuted computing on public infrastructure
Ray.io is an open source framework to easily build distributed computing applications in Python.
ResearchCloud is a cloud platform offering compute resources on SURF infra, commercial cloud, or even your own OpenStack environment.
Ray provides:
Best suited to workloads that are:
Examples:
import gymnasium as gym
from ray.rllib.env.multi_agent_env import MultiAgentEnv
class RockPaperScissors(MultiAgentEnv):
def __init__(self, config=None):
...
def reset(self, *, seed=None, options=None):
...
def step(self, action_dict):
...
config = (
PPOConfig()
.environment(RockPaperScissors, env_config={"max_steps": 10})
# 1. Hardware Resource Specs Allocation
.resources(
num_cpus_for_main_process=1, # Dedicates 1 CPU core to the coordinator/driver process
num_gpus_for_main_process=0, # Keeps the driver on the CPU
)
.env_runners(
num_env_runners=2,
num_cpus_per_env_runner=1,
num_gpus_per_env_runner=0,
)
.learners(
num_learners=1,
num_cpus_per_learner=1,
num_gpus_per_learner=0,
)
# 2. Multi-agent configuration mapping
.multi_agent(
policies={"p1": PolicySpec(), "p2": PolicySpec()},
policy_mapping_fn=lambda agent_id, *a, **kw: "p1" if agent_id == "agent_1" else "p2",
)
)Ray already works out of the box on AWS, k8s, etc.
UU ITS are developing a Ray auto-scaler and catalog items for ResearchCloud.
Benefits:
Steps:
pip install "ray[default]" git+https://github.com/UtrechtUniversity/src-ray-provider.gitexport RESEARCH_CLOUD_TOKEN="..."cluster.yaml to specify your ResearchCloud CO/wallet.ray up cluster.yaml: cluster will be created on SRC.ray dashboard cluster.yaml: ssh-tunnel cluster to your local machine.Now you are ready to run an application on the cluster, e.g.:
ray job submit --address http://localhost:8265 -- python3 test.py
Links
Contact

Slides: https://edu.nl/ydcc7