Skip to main content

No project description provided

Project description

🦬 MultiBeast

license version pyversion tests docs

A research codebase for asynchronous RL.


Quickstart

pip install multibeast provides:

🐄 Asynchronous, distributed RL algorithms based on the IMPALA implementation in moolib, the successor to torchbeast.

🐂 Training results tracked and available on wandb, with hydra config files, for reproducibility.

🐃 An avoidance of inheritance & complexity, to facilitate fast research iteration. Core implementation details are kept as simple and self-contained as possible, in one folder.

See examples/ on how to use multibeast in your code.

Setup from source

[optional] Install moolib manually

# Setup conda env
conda create --name mb python=3.7
conda activate mb
pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 -f https://download.pytorch.org/whl/torch_stable.html

# install moolib
conda install -c conda-forge cmake==3.14.5  # need cmake>=3.14 for moolib
cd third_party/moolib/
USE_CUDA=1 python setup.py build --debug install  # or pip install -e .

Compiling in Docker

If you are having issues building moolib, then try compiling inside a Docker container.

export CONDA_PATH=~/miniconda3
export REPO_PATH=$PWD

docker pull nvidia/cuda:11.1.1-cudnn8-devel-ubuntu18.04
docker run -it \
  -v $REPO_PATH:$REPO_PATH \
  -v $CONDA_PATH:$CONDA_PATH \
  -e REPO_PATH=${REPO_PATH} \
  -e CONDA_PATH=${CONDA_PATH} \
  --gpus all \
  --name mb \
  nvidia/cuda:11.1.1-cudnn8-devel-ubuntu18.04 bash

# inside container
export PATH=${CONDA_PATH}/bin:$PATH
cd $REPO_PATH

# then go back and install moolib

If you run into the following error, then try cloning moolib/third_party/ submodule repos first by running git submodule update --init --recursive:

CMake Error at CMakeLists.txt:51 (pybind11_add_module):
  Unknown CMake command "pybind11_add_module".

If cudnn is missing then just try reinstalling cuda:

apt-get update \
  && apt-get install -y -qq --no-install-recommends \
    git \
    vim \
    wget \
    pkg-config \
    software-properties-common \
  && rm -rf /var/lib/apt/lists/*

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin \
  && mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600 \
  && apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub \
  && add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /"
apt-get update \
  && apt-get -y install cuda-toolkit-11-4 \
  && apt-get clean && rm -rf /var/lib/apt/lists/* 
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

Verify moolib:

pip install autorom[accept-rom-license]
pip install gym[atari]

python -m moolib.broker  # Note that a **single broker is enough** for all your experiments.
export BROKER_PORT=4431  # Should match `Broker listening at 0.0.0.0:4431`
export BROKER_IP=$(echo $SSH_CONNECTION | cut -d' ' -f3)  # Should give your machine's IP.
export BROKER_IP=0.0.0.0  # can also use local IP address if broker if on same machine

python -m examples.vtrace.experiment connect=$BROKER_IP:$BROKER_PORT \
    wandb=0 \
    savedir=outputs/moolib-atari/savedir \
    project=moolib-atari \
    group=Zaxxon-Breakout \
    env.name=ALE/Breakout-v5

# To add more peers to this experiment, start more processes with the
# same `project` and `group` settings, using a different setting for
# `device` (default: `'cuda:0'`).

Try pip uninstall gym atari-py ale-py && pip install gym[atari] if you run into the following error:

Error in env: ModuleNotFoundError: No module named 'gym.envs.atari'

[link]

If you run into the following error, then try using the local IP address (0.0.0.0 or 127.0.0.1):

terminate called after throwing an instance of 'std::runtime_error'
  what():  In connectFromLoop at .../moolib/src/tensorpipe/tensorpipe/transport/uv/uv.h:313 "rv < 0: network is unreachable"
Aborted (core dumped)

[link]

Install multibeast

git clone https://github.com/etaoxing/multibeast.git
git submodule update --init --recursive  # can skip if moolib is installed manually
pip install -e .

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

multibeast-0.0.1a1.tar.gz (44.1 kB view details)

Uploaded Source

Built Distribution

multibeast-0.0.1a1-py3-none-any.whl (39.2 kB view details)

Uploaded Python 3

File details

Details for the file multibeast-0.0.1a1.tar.gz.

File metadata

  • Download URL: multibeast-0.0.1a1.tar.gz
  • Upload date:
  • Size: 44.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.13

File hashes

Hashes for multibeast-0.0.1a1.tar.gz
Algorithm Hash digest
SHA256 36d8e48e457586930df3a688ba41aee706302aeec606ac1deef2a9ed491d4b03
MD5 7cb2346933aa72a86d5b1202e2a707f9
BLAKE2b-256 d5939f5364ee4b4784a7aa2c10589956399b98a0591bc291df9d9619a93549b9

See more details on using hashes here.

File details

Details for the file multibeast-0.0.1a1-py3-none-any.whl.

File metadata

  • Download URL: multibeast-0.0.1a1-py3-none-any.whl
  • Upload date:
  • Size: 39.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.13

File hashes

Hashes for multibeast-0.0.1a1-py3-none-any.whl
Algorithm Hash digest
SHA256 328a24a028d8aec9137c792d3b25a48f9d568691b5f53db792efba801b110240
MD5 02849c31b6648a995b351243d203a033
BLAKE2b-256 ce2da2ff459fc8be1ea4dd966997de530807c92d232ff671e5116acc11fd362d

See more details on using hashes here.

Supported by

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