Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Sebulba Recurrent IPPO #1141

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions .dockerignore

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/tests_linters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
tests-and-linters:
name: "Python ${{ matrix.python-version }} on ubuntu-latest"
runs-on: ubuntu-latest
timeout-minutes: 20
timeout-minutes: 10

strategy:
matrix:
Expand Down
48 changes: 35 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,45 @@
# Stage 1: Build environment
FROM python:3.12-slim AS core
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04

# Add git
RUN apt-get update && apt-get install -y git build-essential pkg-config libhdf5-dev
# Ensure no installs try to launch interactive screen
ARG DEBIAN_FRONTEND=noninteractive

# Add uv and use the system python (no need to make venv)
USER root
COPY --from=ghcr.io/astral-sh/uv:0.4.20 /uv /bin/uv
ENV UV_SYSTEM_PYTHON=1
# Update packages and install python3.9 and other dependencies
RUN apt-get update -y && \
apt-get install -y software-properties-common git && \
add-apt-repository -y ppa:deadsnakes/ppa && \
apt-get install -y python3.12 python3.12-dev python3-pip python3.12-venv && \
update-alternatives --install /usr/bin/python python /usr/bin/python3.12 10 && \
python -m venv mava && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

WORKDIR /home/app/mava
# Setup virtual env and path
ENV VIRTUAL_ENV /mava
ENV PATH /mava/bin:$PATH

COPY . .
# Location of mava folder
ARG folder=/home/app/mava

# Set working directory
WORKDIR ${folder}

# Copy all code needed to install dependencies
COPY ./requirements ./requirements
COPY setup.py .
COPY README.md .
COPY mava/version.py mava/version.py

RUN uv pip install -e .
RUN echo "Installing requirements..."
RUN pip install --quiet --upgrade pip setuptools wheel && \
pip install -e .

ARG USE_CUDA=false
# Need to use specific cuda versions for jax
ARG USE_CUDA=true
RUN if [ "$USE_CUDA" = true ] ; \
then uv pip install jax[cuda12]==0.4.30 ; \
then pip install "jax[cuda12]==0.4.30" ; \
fi

# Copy all code
COPY . .

EXPOSE 6006
17 changes: 14 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
# Check if GPU is available - if `nvidia-smi` works then use GPUs
GPUS := $(shell command -v nvidia-smi > /dev/null && nvidia-smi > /dev/null 2>&1 && echo "--gpus all" || echo "")
# Check if GPU is available
NVCC_RESULT := $(shell which nvcc 2> NULL)
NVCC_TEST := $(notdir $(NVCC_RESULT))
ifeq ($(NVCC_TEST),nvcc)
GPUS=--gpus all
else
GPUS=
endif

# For Windows use CURDIR
ifeq ($(PWD),)
PWD := $(CURDIR)
endif

# Set flag for docker run command
BASE_FLAGS=-it --rm
BASE_FLAGS=-it --rm -v ${PWD}:/home/app/mava -w /home/app/mava
RUN_FLAGS=$(GPUS) $(BASE_FLAGS)

DOCKER_IMAGE_NAME = mava
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ cd mava
pip install -e .
```

We have tested `Mava` on Python 3.11 and 3.12, but earlier versions may also work. Specifically, we use Python 3.10 for the Quickstart notebook on Google Colab since Colab uses Python 3.10 by default. Note that because the installation of JAX differs depending on your hardware accelerator,
We have tested `Mava` on Python 3.11 and 3.12, but earlier versions may also work. Note that because the installation of JAX differs depending on your hardware accelerator,
we advise users to explicitly install the correct JAX version (see the [official installation guide](https://github.com/google/jax#installation)). For more in-depth installation guides including Docker builds and virtual environments, please see our [detailed installation guide](docs/DETAILED_INSTALL.md).

## Quickstart ⚡
Expand Down
Loading
Loading