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

Lasertag self play #26

Open
wants to merge 57 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
6209199
added lasertag parallel wrapper
RPegoud Mar 22, 2024
dd40390
running lasertag selfplay (not learning)
RPegoud Mar 25, 2024
36c5ea9
added opponent update
RPegoud Mar 25, 2024
39d4d43
reverted commit
RPegoud Mar 25, 2024
1676dc7
added recording code, run from colab ?
RPegoud Mar 26, 2024
f0ea3f9
working selfplay lasertag script
RPegoud Mar 28, 2024
8134546
updated lasertag script
RPegoud Mar 28, 2024
1d293d4
added device selection for selfplay agent storage
RPegoud Mar 28, 2024
7abf246
added fsp v0
RPegoud Mar 28, 2024
e7a6ab8
added prioritized fictitious self-play
RPegoud Mar 29, 2024
990e719
added win rate and n_games plots for pfsp
RPegoud Mar 29, 2024
bcc3d1e
added wandb integration
RPegoud Apr 2, 2024
bd12c98
added adversarial sp script
RPegoud Apr 3, 2024
09a34de
replaced pettingzoo ppo code with cleanrl base ppo.py
RPegoud Apr 3, 2024
e7a1bd3
Added DualCurriculumWrapper and baselines for SP+DR, FSP+DR, PFSP+DR
RPegoud Apr 5, 2024
4f42f3a
added dual curriculum wrapper and selfplay variations to syllabus cor…
RPegoud Apr 18, 2024
1a5a131
resolved circular import, integrated PR suggestions, dual curriculum …
RPegoud Apr 20, 2024
3e43732
added get_opp and update_agent to base curriculum class
RPegoud Apr 22, 2024
7d4a2d8
.
RPegoud Apr 22, 2024
82de680
Merge branch 'main' of https://github.com/RyanNavillus/Syllabus into …
RPegoud Apr 22, 2024
d636b28
added pfsp_dr training script with checkpoints, resolved circular imp…
RPegoud Apr 22, 2024
b79e844
added seeding
RPegoud Apr 23, 2024
54f1fc4
added single script to run lasertag DR + {SP/FSP/PFSP} and shell scri…
RPegoud Apr 23, 2024
49ed44b
added plotly, tqdm, joblib, griddly to setup test dependencies
RPegoud Apr 24, 2024
9131e5c
refactored typing annotation for python 3.8 compatibility
RPegoud Apr 24, 2024
088784c
fixed tensor.cpu() error
RPegoud Apr 24, 2024
898c966
corrected wandb logging dir
RPegoud Apr 24, 2024
a44eca0
Round robin v0
RPegoud Apr 24, 2024
d3cd470
improved round robin iteration and results logging
RPegoud Apr 25, 2024
1c5b051
fixed pytorch error when running with cuda enabled
RPegoud Apr 26, 2024
e61a779
fixed checkpointing
RPegoud Apr 26, 2024
cd9599f
adapted training script to run for N updates, added command line argu…
RPegoud Apr 29, 2024
b38f37e
added agent checkpoints based on update steps
RPegoud Apr 29, 2024
6b5534d
updated round robin result format, added wandb model storage
RPegoud May 1, 2024
a35ebcb
PLR + selfplay v0
RPegoud May 2, 2024
3c30ccf
fixed wandb model logging errors
RPegoud May 3, 2024
552dbfc
added seed to selfplay checkpoints
RPegoud May 4, 2024
226c491
added round robin results parsing script
RPegoud May 6, 2024
24beb7f
Add chaecks for missing files
RyanNavillus May 7, 2024
69cc927
Fix num_steps
RyanNavillus May 7, 2024
f81db5b
lasertag vecenv attempt
RPegoud May 7, 2024
feebb4b
Merge branch 'lasertag_self_play' of https://github.com/RPegoud/Sylla…
RPegoud May 7, 2024
4d0938c
lasertag CNN/LSTM v0
RPegoud May 13, 2024
a4cea85
lstm fixes, selfplay changes (+ to cpu before save)
RPegoud May 20, 2024
348453f
rnn lstm fixes, selfplay => agent to gpu after save
RPegoud May 20, 2024
ae74fa5
improved round-robin parsing
RPegoud May 21, 2024
b991f8b
corrected round robin script for lstm
RPegoud May 21, 2024
ba3349c
vecenv progress
RPegoud Jun 11, 2024
ef35582
functional vecenv / LSTM code, next-steps: add curriculum wrapper
RPegoud Jul 22, 2024
9dfaf8d
Curriculum setup, requires vectorization of env curriculum
RPegoud Jul 24, 2024
24799ac
added comments
RPegoud Jul 24, 2024
a8a3ec5
Update to use syllabus infra
RyanNavillus Jul 24, 2024
e7070f0
Merge branch 'main' of https://github.com/RyanNavillus/Syllabus into …
RyanNavillus Jul 24, 2024
6c0ad7c
Fix bad merge
RyanNavillus Jul 24, 2024
df762f8
Add syllabus infrastructure and batched sampling to agent curriculum
RyanNavillus Jul 24, 2024
0bc7a04
Set workers back to 8
RyanNavillus Jul 24, 2024
035c6dc
working vectorized agent selection with queue storage
RPegoud Aug 22, 2024
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
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
*.pkl
*.env
agents_buffer
syllabus/examples/experimental/round_robin/DR_SP_DR_FSP/*.json
syllabus/examples/experimental/round_robin/DR_SP_DR_PFSP/*.json
syllabus/examples/experimental/round_robin/DR_FSP_DR_PFSP/*.json
.neptune

wandb
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
46 changes: 46 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FROM nvcr.io/nvidia/pytorch:23.06-py3

# Ensure no installs try to launch interactive screen
ARG DEBIAN_FRONTEND=noninteractive

# Update packages and install dependencies
RUN apt-get update -y && \
apt-get install -y software-properties-common git && \
# CMake, Zlib development files, and build-essential
apt-get install -y cmake zlib1g-dev build-essential && \
# adds the DeadSnakes PPA, which provides newer Python versions
add-apt-repository -y ppa:deadsnakes/ppa && \
# python 3.10, development headers, pip, and python virtual environment package
apt-get install -y python3.10 python3.10-dev python3-pip python3.10-venv && \
# use Python 3.10 as the default python command
update-alternatives --install /usr/bin/python python /usr/bin/python3.10 10 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Setup virtual env and path
ENV VIRTUAL_ENV=/syllabus
ENV PATH=/syllabus/bin:$PATH

# Set working directory
WORKDIR /home/app/syllabus

# Copy requirements file first to leverage Docker cache
COPY requirements.txt .

# Install requirements
RUN pip install --quiet --upgrade pip setuptools wheel && \
pip install -r requirements.txt

# Copy all code to the container
COPY . .

RUN echo "Installing additional libraries ..."
RUN pip install multi-agent-ale-py griddly pettingzoo pufferlib \
tensorboard pygame tqdm tyro colorama neptune python-dotenv && \
pip install "autorom[accept-rom-license]" && \
pip install jupyter ipykernel
RUN AutoROM --accept-license

# expose the Jupyter notebook port
EXPOSE 8888

33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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 --shm-size=1g -v ${PWD}:/home/app/syllabus -w /home/app/syllabus
RUN_FLAGS=$(GPUS) $(BASE_FLAGS)

DOCKER_RUN=docker run $(RUN_FLAGS) syllabus:latest
USE_CUDA = $(if $(GPUS),true,false)

# make file commands
build:
DOCKER_BUILDKIT=1 docker build --build-arg USE_CUDA=$(USE_CUDA) --tag $(IMAGE) .

run:
$(DOCKER_RUN) python $(example)

bash:
$(DOCKER_RUN) bash

jupyter:
$(DOCKER_RUN) jupyter notebook --ip=0.0.0.0 --port=8888 --no-browser --allow-root
3 changes: 3 additions & 0 deletions lasertag/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .generator import *
from .custom_test import *
from .lasertag import *
Loading