Utilities for Ray RLlib and related workflows. Includes experiment setup, callbacks, and JAX model utilities.
Project description
Ray Utilities
Features
Many Features are stand-alone and can be used independently. The main features include:
- JAX PPO for RLlib: A JAX-based implementation of the Proximal Policy Optimization (PPO) algorithm compatible with RLlib Algorithm.
- Ray + Optuna Grid Search + Optuna Pruners: Extends ray's
OptunaSearchto be compatible with - Experiment Framework: A base class for setting up experiments with dynamic parameters and parameter spaces, easily run via CLI and
ray.tune.Tuner. - Reproducible Environments: Reproducible environments for experiments using
ray.tuneby using a more sophisticated seeding mechanism. - Dynamic Parameter Tuning (WIP): Support for dynamic tuning of parameters during experiments.
ray.tune.grid_searchand Optuna pruners can work as aStopper.
Furthermore smaller features:
- Exact Environment Step Sampling: RLlib sampling is slightly off and contains masked samples. A callback and connector piece correct this.
- Improved Logger Callbacks: Improved csv, Tensorboard, Wandb, Comet logger callbacks. Cleaner logs and better video handling.
- PPO Torch Learner with Gradient Accumulation: A PPO learner that supports gradient accumulation, useful for training with large batch sizes.
Installation
Install from PyPI
pip install ray_utilities
Install latest version
Clone the repository and install the package using pip:
git clone https://github.com/Daraan/ray_utilities.git
cd ray_utilities
pip install .
Documentation (Work in Progress)
Hosted on Read the Docs: https://ray-utilities.readthedocs.io/
Run Experiments via CLI
Simple entry point:
# File: run_experiment.py
from ray_utilities import run_tune
from ray_utilities.setup import PPOSetup
if __name__ == "__main__":
with PPOSetup() as setup: # Replace with your own setup class
# The setup takes care of many settings passed in via the CLI
# but the config (an rllib.AlgorithmConfig) can be adjusted
# inside the code as well.
# Changes made in this with block are tracked for checkpoint reloads
setup.config.training(num_epochs=10)
results = run_tune(setup)
Run the experiment:
python run_experiment.py -a MLP
[!NOTE]
It is recommended to subclassAlgorithmSetuporExperimentSetupBaseto define your own setup. ExtendDefaultArgumentParserto add custom CLI arguments. Above'sPPOSetupis a very minimalistic example.
Project details
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 ray_utilities-0.3.1.tar.gz.
File metadata
- Download URL: ray_utilities-0.3.1.tar.gz
- Upload date:
- Size: 204.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10aad7aa30af22e9dd07c4c79a1eaea26ab04dbc6e3e8a27a04d47935fa0436e
|
|
| MD5 |
f6f38a947ab051806acc635ea08d1aa5
|
|
| BLAKE2b-256 |
41d89a8f7cd483dd255186de2e33006b069ddb808746f71a886a76ed8f401ee5
|
Provenance
The following attestation bundles were made for ray_utilities-0.3.1.tar.gz:
Publisher:
publish.yml on Daraan/ray_utilities
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ray_utilities-0.3.1.tar.gz -
Subject digest:
10aad7aa30af22e9dd07c4c79a1eaea26ab04dbc6e3e8a27a04d47935fa0436e - Sigstore transparency entry: 465409915
- Sigstore integration time:
-
Permalink:
Daraan/ray_utilities@754039ff34d85aba824f84495ebe314dbee3f1be -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/Daraan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@754039ff34d85aba824f84495ebe314dbee3f1be -
Trigger Event:
release
-
Statement type:
File details
Details for the file ray_utilities-0.3.1-py3-none-any.whl.
File metadata
- Download URL: ray_utilities-0.3.1-py3-none-any.whl
- Upload date:
- Size: 255.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
333e9375ea8e389551d81016c9bd6899c318bb12575139fc05496a2d419014f3
|
|
| MD5 |
c09a10acc0ff88b7c2ef300f66929764
|
|
| BLAKE2b-256 |
03e1017f5273a9dc7d504ce02da1f0f245e28a90bddbb617499bd3199ed976c5
|
Provenance
The following attestation bundles were made for ray_utilities-0.3.1-py3-none-any.whl:
Publisher:
publish.yml on Daraan/ray_utilities
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ray_utilities-0.3.1-py3-none-any.whl -
Subject digest:
333e9375ea8e389551d81016c9bd6899c318bb12575139fc05496a2d419014f3 - Sigstore transparency entry: 465409964
- Sigstore integration time:
-
Permalink:
Daraan/ray_utilities@754039ff34d85aba824f84495ebe314dbee3f1be -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/Daraan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@754039ff34d85aba824f84495ebe314dbee3f1be -
Trigger Event:
release
-
Statement type: