ray
Skill8 starsChanged 8 months agoMITView on GitHub
Provides Ray distributed computing framework for scaling Python applications. Covers Ray Core (tasks, actors, objects), Ray Data (data processing), Ray Train (distributed training), Ray Serve (model serving), Ray Tune (hyperparameter tuning), and Ray RLlib (reinforcement learning).
- Installs packages
4 other projects use a version of this.
Adopted by
Most recently taken up by
- imraywang/rayskillstheir own version, first seen Nov 2, 2026
- G1Joshi/Agent-Skillstheir own version, first seen Oct 13, 2026
- Railly/tintetheir own version, first seen Oct 8, 2026
- spatie/ray-skillstheir own version, first seen Jan 28, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- Railly/tinte★ 624same name
- imraywang/rayskills★ 385same name
- G1Joshi/Agent-Skills★ 15same name
- spatie/ray-skills★ 6same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository23 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- validate-skillsSkill
- alchemi-toolkit-opsSkill
- autoresearch-setupSkill
- bionemoSkill
- biosimspaceSkill
- cuda-quantumSkill
- cutileSkill
- daskSkill
- flashinferSkill
- materials-projectSkill
- mpiSkill
- nemotronSkill
- omniverse-simreadySkill
- physicsnemoSkill
- polarsSkill
- prime-verifiersSkill
- qiskitSkill
- rdkitSkill
- slurmSkill
- tinkerSkill
- tritonSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 6 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 488
Use tasks for stateless operations: Prefer tasks over actors when state not needed
- Distinctive: line 489
Batch operations: Use Ray Data for efficient batch processing
- Distinctive: line 490
Resource specification: Always specify CPU/GPU requirements
- Distinctive: line 491
Object store management: Use ray.put() for large objects shared across tasks
- Distinctive: line 495
Scaling: Start local, scale to cluster without code changes
- Distinctive: line 497
Profile first: Use Ray dashboard to identify bottlenecks
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Ray Agent Skill
Agent-optimized skill for Ray distributed computing framework.
Quick Reference
Ray Core - Tasks and Actors
import ray
ray.init()
# Task (remote function)
@ray.remote
def square(x):
return x ** 2
future = square.remote(4)
result = ray.get(future) # 16
# Parallel tasks
futures = [square.remote(i) for i in range(100)]
results = ray.get(futures)
# Actor (remote class)
@ray.remote
class Counter:
def __init__(self):
self.count = 0
def increment(self):
self.count += 1
return self.count
counter = Counter.remote()
result = ray.get(counter.increment.remote())Ray Data - Distributed Data Processing
import ray
# Read data
ds = ray.data.read_parquet("s3://bucket/data/*.parquet")
ds = ray.data.read_csv("data/*.csv")
ds = ray.data.read_json("data/*.json")
# Transform data
def preprocess(batch):
batch["new_col"] = batch["col1"] * 2
return batch
ds = ds.map_batches(preprocess, batch_format="pandas")
# Filter
ds = ds.filter(lambda row: row["value"] > 10)
# Write results
ds.write_parquet("output/")
ds.write_csv("output/")
# Batch inference
def predict(batch):
# Model inference
return {"predictions": model.predict(batch["features"])}
predictions = ds.map_batches(predict, batch_size=32)Ray Train - Distributed Training
import ray
from ray import train
from ray.train import ScalingConfig
from ray.train.torch import TorchTrainer
def train_func(config):
# Your training code
model = create_model()
train_dataset = train.get_dataset_shard("train")
for epoch in range(config["num_epochs"]):
# Training loop
loss = train_epoch(model, train_dataset)
train.report({"loss": loss})
# Configure distributed training
trainer = TorchTrainer(
train_func,
train_loop_config={"num_epochs": 10, "lr": 0.001},
scaling_config=ScalingConfig(
num_workers=4,
use_gpu=True,
resources_per_worker={"CPU": 2, "GPU": 1}
),
datasets={"train": train_dataset}
)
result = trainer.fit()Ray Serve - Model Serving
from ray import serve
import ray
ray.init()
serve.start()
# Simple deployment
@serve.deployment
class Predictor:
def __init__(self, model_path):
self.model = load_model(model_path)
async def __call__(self, request):
data = await request.json()
prediction = self.model.predict(data["input"])
return {"prediction": prediction}
# Deploy
serve.run(Predictor.bind("model.pkl"), route_prefix="/predict")
# FastAPI integration
from fastapi import FastAPI
app = FastAPI()
@serve.deployment
@serve.ingress(app)
class FastAPIDeployment:
@app.post("/predict")
async def predict(self, data: dict):
return {"result": model.predict(data["input"])}
serve.run(FastAPIDeployment.bind())Ray Tune - Hyperparameter Tuning
from ray import tune
from ray.tune import Tuner
from ray.tune.search.optuna import OptunaSearch
def objective(config):
# Training function
for epoch in range(10):
loss = train_step(config["lr"], config["batch_size"])
tune.report(loss=loss)
# Define search space
param_space = {
"lr": tune.loguniform(1e-4, 1e-1),
"batch_size": tune.choice([16, 32, 64, 128]),
"hidden_units": tune.randint(32, 512)
}
# Run tuning
tuner = Tuner(
objective,
param_space=param_space,
tune_config=tune.TuneConfig(
num_samples=100,
search_alg=OptunaSearch()
)
)
results = tuner.fit()
best_config = results.get_best_result().configCommon Patterns
Distributed Data Processing
import ray
# Load and process large dataset
ds = ray.data.read_parquet("s3://bucket/data/*.parquet")
# Parallel preprocessing
ds = ds.map_batches(
lambda batch: preprocess(batch),
batch_format="pandas",
num_cpus=1
)
# Repartition for better parallelism
ds = ds.repartition(100)
# Aggregate
stats = ds.aggregate(
count=ray.data.aggregate.Count(),
mean=ray.data.aggregate.Mean("value"),
std=ray.data.aggregate.Std("value")
)
# Write output
ds.write_parquet("output/", num_rows_per_file=10000)Task Dependencies and Actor Pools
# Task graph
@ray.remote
def fetch(src):
return load_data(src)
@ray.remote
def process(data):
return transform(data)
data = [fetch.remote(s) for s in sources]
results = ray.get([process.remote(d) for d in data])
# Actor pool
@ray.remote
class Worker:
def process(self, data):
return computation(data)
pool = [Worker.remote() for _ in range(10)]
futures = [pool[i % len(pool)].process.remote(d) for i, d in enumerate(dataset)]
results = ray.get(futures)Multi-GPU Training
from ray.train.torch import TorchTrainer
from ray.train import ScalingConfig
def train_func(config):
import torch.distributed as dist
# Automatic distributed setup
model = create_model()
model = ray.train.torch.prepare_model(model)
train_loader = ray.train.torch.prepare_data_loader(train_loader)
for epoch in range(config["epochs"]):
for batch in train_loader:
loss = train_step(model, batch)
ray.train.report({"loss": loss})
trainer = TorchTrainer(
train_func,
train_loop_config={"epochs": 10},
scaling_config=ScalingConfig(
num_workers=4,
use_gpu=True,
resources_per_worker={"GPU": 1}
)
)
result = trainer.fit()Batch Inference Pipeline
import ray
# Load data
ds = ray.data.read_parquet("data/*.parquet")
# Load model in actors for efficient batching
class ModelInference:
def __init__(self):
self.model = load_model()
def __call__(self, batch):
predictions = self.model.predict(batch["features"])
return {"predictions": predictions}
# Run batch inference
predictions = ds.map_batches(
ModelInference,
batch_size=32,
num_gpus=1,
concurrency=4
)
predictions.write_parquet("predictions/")Cluster Management
Local Cluster
import ray
# Auto-detect resources
ray.init()
# Manual configuration
ray.init(num_cpus=8, num_gpus=2)
# Connect to existing cluster
ray.init(address="ray://cluster-address:10001")Cloud Deployment
# AWS/GCP/Azure cluster
pip install -U "ray[default]"
ray up cluster.yaml # See references/cluster-deployment.md for configKubernetes Deployment
# KubeRay cluster - see references/cluster-deployment.md for full spec
apiVersion: ray.io/v1
kind: RayCluster
spec:
rayVersion: '2.53.0'
headGroupSpec:
replicas: 1
workerGroupSpecs:
- replicas: 3
resources:
nvidia.com/gpu: "1"Resource Management
Specifying Resources
# Task resources
@ray.remote(num_cpus=2, num_gpus=1, memory=1024*1024*1024)
def gpu_task(data):
return process_on_gpu(data)
# Actor resources
@ray.remote(num_cpus=4, num_gpus=2)
class GPUActor:
def process(self, data):
return gpu_computation(data)
# Custom resources
ray.init(resources={"custom_resource": 4})
@ray.remote(resources={"custom_resource": 1})
def custom_task():
return work()Object Store
# Put objects explicitly
large_data = load_large_dataset()
obj_ref = ray.put(large_data)
# Pass to tasks
@ray.remote
def process(data_ref):
data = ray.get(data_ref)
return transform(data)
result = process.remote(obj_ref)Performance Optimization
Batching
# Ray Data batching
ds = ray.data.read_parquet("data.parquet")
ds = ds.map_batches(
process_function,
batch_size=1000, # Process 1000 rows at a time
num_cpus=2
)Pipelining
# Pipeline stages
stage1 = ray.data.read_parquet("input.parquet")
stage2 = stage1.map_batches(preprocess)
stage3 = stage2.map_batches(feature_engineering)
# Execution is pipelined automatically
stage3.write_parquet("output/")Placement Groups
from ray.util.placement_group import placement_group
# Co-locate tasks
pg = placement_group([
{"CPU": 2, "GPU": 1},
{"CPU": 2, "GPU": 1},
{"CPU": 2, "GPU": 1}
], strategy="STRICT_PACK")
@ray.remote(num_cpus=2, num_gpus=1)
def task():
return work()
# Submit to placement group
futures = [task.options(placement_group=pg).remote() for _ in range(3)]Monitoring and Debugging
Ray Dashboard
import ray
# Dashboard available at http://localhost:8265
ray.init()Logging
import ray
import logging
logger = logging.getLogger(__name__)
@ray.remote
def task_with_logging():
logger.info("Task started")
result = work()
logger.info(f"Task completed: {result}")
return resultProfiling
# Enable profiling
ray.init(runtime_env={"env_vars": {"RAY_PROFILING": "1"}})
# View timeline in dashboardReferences
Detailed documentation in references/:
- core-tasks-actors.md: Ray Core primitives, tasks, actors, objects
- data-processing.md: Ray Data API, transformations, batch operations
- train-serve.md: Ray Train distributed training, Ray Serve model serving
- tune-rllib.md: Ray Tune hyperparameter tuning, Ray RLlib reinforcement learning
- cluster-deployment.md: Cluster setup, cloud deployment, Kubernetes, resource management
Official Documentation
Best Practices
- Use tasks for stateless operations: Prefer tasks over actors when state not needed
- Batch operations: Use Ray Data for efficient batch processing
- Resource specification: Always specify CPU/GPU requirements
- Object store management: Use ray.put() for large objects shared across tasks
- Monitor dashboard: Track resource usage and task execution
- Placement groups: Co-locate related tasks for better performance
- Fault tolerance: Ray automatically retries failed tasks
- Scaling: Start local, scale to cluster without code changes
- Data locality: Process data where it lives to minimize transfers
- Profile first: Use Ray dashboard to identify bottlenecks
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

