RLink is a lightweight, high-performance communication layer specifically designed for distributed reinforcement learning systems.
Project description
RLink
RLink is a lightweight, high-performance communication layer specifically designed for distributed reinforcement learning systems. It enables seamless data exchange between actors (environment interaction) and learners (model training), decoupling sampling from training to scale your RL experiments efficiently.
โจ Key Features
๐ Low-Latency Communication โ Optimized for fast transfer of trajectories, actions, observations, and model parameters
๐ Scalability โ Supports many-to-one and one-to-many communication patterns for flexible scaling
๐ Easy Integration โ Simple API to connect existing RL frameworks and training pipelines
๐ Language-Agnostic Design โ Currently supports Python with plans for C++/Rust backends
๐ก๏ธ Fault-Tolerant โ Optional reliability features to handle intermittent connection drops
๐ฏ Why RLink?
Building distributed RL systems often involves complex communication infrastructure. RLink simplifies this by providing a dedicated, optimized layer that:
-
Decouples sampling and training processes
-
Accelerates experimentation across multiple processes or machines
-
Reduces infrastructure overhead
-
Enables seamless scaling of actors and learners
๐ Architecture Overview
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ โ โ | |
โ RL Actors โโโโโโถโ RLink โโโโโโถโ RL Learners โ
โ (Sampling) โโโโโโโ Communication โโโโโโโ (Training) โ
โ โ โ Layer โ โ โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
๐ Quick Start
Installation
pip install rlinks
Basic Usage
As a actor
from rlinks.actor import RLinkActor
actor = RLinkActor("http://learner-ip:8443")
# Send data to learner.
data = {
"image_0": np.random.randint(0, 255, (480, 640, 3), dtype=np.uint8),
"action": np.random.randint((50, 14)).astype(np.float32),
"index": 0,
}
for i in range(4):
data["index"] = i
actor.put(data)
# Get model from learner.
models = actor.get_remote_model()
As as Learner
# To start the leaner, you can either run it directly in a terminal or daemonize it to run in the background.
rlinks learner --gpu-num 8 --port 8443
rlinks learner --help
from rlinks.dataset import RLinkDataset
class YourDataset:
def __init__(self):
self._rl_dataset = RLinkDataset(gpu_id=torch.cuda.current_device())
def __getitem__(self,idx):
data = self._rl_dataset.__getitem__(idx)
from rlinks.learner import RLinkSyncModel
RLinkSyncModel.sync("your model path")
๐ Use Cases
Distributed RL Training โ Scale to hundreds of parallel environments
Multi-Agent Systems โ Coordinate communication between agents
Federated RL โ Train across distributed data sources
Hybrid Cloud/Edge Training โ Deploy actors and learners across different infrastructure
๐ Communication Patterns
| Pattern | Description | Use Case |
|---|---|---|
| Many-to-One | Multiple actors โ Single learner | Centralized training |
| One-to-Many | Single learner โ Multiple actors | Parameter distribution |
| Bidirectional | Two-way communication | Advanced coordination |
๐ ๏ธ Integration with Popular Frameworks
๐ Performance Benchmarks
๐ฎ Roadmap
๐ค Contributing
We welcome contributions! Please see our Contributing Guidelines for details. CONTRIBUTING
๐ License
RLink is released under the MIT License. See LICENSE for details LICENSE.
๐ Support & Community
๐ Documentation
๐ Issue Tracker
๐ฌ Discord Community
๐ฆ Twitter Updates
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rlinks-1.0.3.tar.gz.
File metadata
- Download URL: rlinks-1.0.3.tar.gz
- Upload date:
- Size: 342.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76d16e309a43a7be5213df1c3ef7ff0b95553ec216ab7edaee5c64bc1ff183d1
|
|
| MD5 |
edcbb8c0388f6101ad2622cb4e847167
|
|
| BLAKE2b-256 |
d0d075bc28992f0c72a7da3ff35501ada75b8499f95bd4e96813b8e8ffaa7ddc
|
File details
Details for the file rlinks-1.0.3-py3-none-any.whl.
File metadata
- Download URL: rlinks-1.0.3-py3-none-any.whl
- Upload date:
- Size: 20.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a66802b525c69bbe868a9a1f52217435aaca9464944d599576e780d6d874399
|
|
| MD5 |
7883e765730b0ca9958985ae6b79b22b
|
|
| BLAKE2b-256 |
1257b1e4b33b0f565e608fca4beca5a45d3b11ecb1a611aa5c4af834e4453060
|