Skip to main content

Utilities for Ray RLlib and related workflows. Includes experiment setup, callbacks, and JAX model utilities.

Project description

test workflow badge ReadtheDocs Badge Ruff Ruff

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 OptunaSearch to 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.tune by using a more sophisticated seeding mechanism.
  • Dynamic Parameter Tuning (WIP): Support for dynamic tuning of parameters during experiments. ray.tune.grid_search and Optuna pruners can work as a Stopper.

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__":
    setup = PPOSetup()  # Replace with your own setup class
    results = run_tune(setup)

Run the experiment:

python run_experiment.py -a MLP

[!NOTE]
It is recommended to subclass AlgorithmSetup or ExperimentSetupBase to define your own setup. Extend DefaultArgumentParser to add custom CLI arguments. Above's PPOSetup is 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

ray_utilities-0.3.0.tar.gz (204.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ray_utilities-0.3.0-py3-none-any.whl (255.2 kB view details)

Uploaded Python 3

File details

Details for the file ray_utilities-0.3.0.tar.gz.

File metadata

  • Download URL: ray_utilities-0.3.0.tar.gz
  • Upload date:
  • Size: 204.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ray_utilities-0.3.0.tar.gz
Algorithm Hash digest
SHA256 df24035bb2b798de96197d4e79f02456195827ffd7791bd5cfa8a7cccba3e1bf
MD5 70475a1b6c3bf95f4683dce4204e5fab
BLAKE2b-256 4ccfa4eb12472c777b03b7346f8f0408140354ed7301ecbe599084422e523cfa

See more details on using hashes here.

Provenance

The following attestation bundles were made for ray_utilities-0.3.0.tar.gz:

Publisher: publish.yml on Daraan/ray_utilities

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ray_utilities-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: ray_utilities-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 255.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ray_utilities-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a31342fd129075d4155e0e3b9182919b5f079d784b26095859e15b45216db822
MD5 6dc32b207f0ede8e2433865ec73d72d8
BLAKE2b-256 1c647b6dbdab4872763e177602c9bfedbd05c003e9273ac796cb29f41bd7f470

See more details on using hashes here.

Provenance

The following attestation bundles were made for ray_utilities-0.3.0-py3-none-any.whl:

Publisher: publish.yml on Daraan/ray_utilities

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page