Overview
NRL is a lightweight reinforcement learning framework built directly on PyTorch primitives. It focuses on being modular, easy to extend, and suitable for research and engineering workflows without depending on large external infra.
Main features
- Native PyTorch implementation (no heavy external infra).
- Common algorithms implemented (PPO, DPO, GRPO, ...).
- Distributed support using PyTorch primitives and DTensor (data/model/tensor parallelism).
- Support for running training and inference within the same process for easy online evaluation.
- Modular design — easy to replace or extend algorithms, policies and backends.
Repository layout
nrl/
— core package (entry, algorithms, training, distributed utilities)examples/
— runnable examples and configs (e.g.,examples/ardf
)scripts/
,tests/
— helper scripts and tests
Installation
Prerequisites: Python and a matching PyTorch build (install a CUDA-enabled PyTorch for GPU usage).
# create a virtualenv
pip install -r requirements.txt
Quick start — run the ardf example
Run the repository entry with the example config:
python3 nrl/entry.py examples/ardf/config.py
Distributed example
python -m torch.distributed.run --nproc_per_node=<N> nrl/entry.py examples/ardf/config.py
Contributing
- Open an Issue to discuss large changes before implementation.
- Provide or update examples and tests when adding features.
- Include benchmarks for performance-sensitive changes.
Running tests
Use the helper script in the repository root to run tests (it sets PYTHONPATH
so the local package is loaded):
bash scripts/run_tests.sh
See CONTRIBUTING.md for more details.
License & Contact
See the LICENSE file in the repository root. Use Issues for questions or contact the maintainers.