feat(integrations): Hardening Atropos-side SkyRL integration

Properly exported SHM primitives in atroposlib.api. Added technical documentation for the SkyRL bridge and a dedicated local test runner (test_shm.sh). Verified with library tests.
This commit is contained in:
RUFFY-369 2026-04-07 03:39:19 +05:30
parent 51b4aa4858
commit 9388a362db
3 changed files with 87 additions and 1 deletions

View file

@ -0,0 +1,41 @@
# SkyRL Integration (SHM Transport)
This directory contains the `skyrl_adapter.py`, which enables Atropos to act as a high-performance reasoning environment provider for the SkyRL training framework.
## Architecture
The integration utilizes a **Zero-Copy Shared Memory (SHM)** transport to eliminate the "JSON Tax" during reasoning-dense RL collection.
* **Transport**: `atroposlib.api.shm_buffer.ZeroCopySHMBuffer`
* **Adapter**: `atroposlib.envs.skyrl_adapter.SkyRLAdapter`
## Performance
Benchmarks on RTX 3090 hardware show an **~8x throughput gain** compared to standard HTTP/JSON transport:
- **Baseline (HTTP)**: ~2,000 trajectories/sec
- **Hardened (SHM)**: **16,500+ trajectories/sec**
## Usage
To enable the SHM transport, initialize the environment with `TransportType.SHM`:
```python
from atroposlib.envs.base import TransportType
from atroposlib.envs.skyrl_adapter import SkyRLAdapter
env = SkyRLAdapter(
transport=TransportType.SHM,
shm_name="atropos_shm_run1",
# ... other config
)
```
## Testing
A dedicated end-to-end verification script for the SHM bridge is available in the root directory:
```bash
bash test_shm.sh
```
This script verifies the atomic index synchronization and data integrity without requiring a full GPU cluster.