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

Human experiments #29

Open
wants to merge 75 commits into
base: comm_state
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
3aa5a9e
Update README.md
wwongkamjan Mar 1, 2023
b3676cc
fix two engines phase inconsistency
May 9, 2023
9832e21
fix arg for dipcc R phase
May 15, 2023
f8668a2
math.ceil
May 18, 2023
988177d
silent cicero
Jun 4, 2023
cf3368e
set wait and end phase for human games
Jul 11, 2023
9439d75
fairdiplomacy_external/mila_api.py
Jul 18, 2023
a07831f
update daide2eng
Jul 19, 2023
0e6a1a8
stop comm using remaining time
Aug 1, 2023
0e59aff
fix calling remaining time
Aug 3, 2023
2d42d7f
update should_stop
Aug 3, 2023
65eddb8
presubmit order
Aug 4, 2023
d98070d
fix deadline=0 case
Aug 7, 2023
507b095
fix inconsistent in phase when calling game.schedule
Aug 8, 2023
034d06e
track time_sent of prev message
Sep 20, 2023
587694c
remove internal response
Sep 28, 2023
73a0e87
Update requirements.txt
wwongkamjan Sep 28, 2023
9aecdfe
remove daide2eng for human games
Sep 29, 2023
03bd537
get back daide2eng
Sep 29, 2023
5687751
add cicero intent experiment
Oct 20, 2023
493b155
fix update press: most recent time
Oct 23, 2023
3962137
update: test intent and test value table
Oct 24, 2023
a2424ea
add human AI game
Oct 24, 2023
a5c76aa
fix json error
Oct 25, 2023
ec520b8
update time to submit
Oct 29, 2023
c578b8a
remove deceptive log
Oct 30, 2023
09c18c7
remove deception part in message_edit.py
Oct 30, 2023
64ae378
add view from power to dipcc
Oct 31, 2023
9d64140
remove view from power to dipcc (bug)
Oct 31, 2023
95be77a
re-add view from power to dipcc
Oct 31, 2023
cee5411
fix update press: most recent time
Oct 23, 2023
5855d02
re-add view from power to dipcc
Oct 31, 2023
3dfa915
Merge remote-tracking branch 'refs/remotes/origin/human_experiments' …
Oct 31, 2023
f981374
add sleeptime after msg and set input validation to default
Oct 31, 2023
ec2091b
remove throw error input validation
Oct 31, 2023
e1d4de0
add cicero msg timesent in log
Nov 1, 2023
d3b2a8d
update cicero msg timesent in log
Nov 1, 2023
f4187ef
sleeptime 20 -> 10 and update (mila->dipcc) message with timestamp now
Nov 3, 2023
0bd12b1
fix timesent in cicero log
Nov 5, 2023
f5eddf5
fix mila_msg
Nov 18, 2023
4e6eb11
update game_type and eng-daide-eng for in and out message
Feb 20, 2024
72757b4
update daide to latest and ede_msg from mila to dipcc
Feb 21, 2024
ef514dd
fix errors
Mar 2, 2024
0c14b7c
update AMR folder and mila check_PRP
Mar 5, 2024
1261731
test best DAIDE-ENG format
Mar 15, 2024
d632494
test english-daide proposal reply
Mar 20, 2024
6228fec
update eng2daide and daide2eng
Jun 17, 2024
e2d39ee
add print to track AMR
Jun 20, 2024
3f829a7
update rerun
Jul 14, 2024
7673e68
fix discord error post
Jul 19, 2024
0592406
Fix failing unit tests
aphedges Sep 15, 2023
e70ce83
Re-enable `throw_on_failure` parameter
aphedges Jul 31, 2024
5007d53
Do not run tests for AMR code
aphedges Jul 31, 2024
407b418
Dockerize CICERO
aphedges Oct 15, 2024
e6ba8bb
Connect to `diplomacy` using TLS
aphedges Sep 18, 2024
bd09056
Add basic `BaselineBot` subclass to `milaWrapper`
aphedges Oct 15, 2024
3d38f25
Handle games without deadlines better
aphedges Sep 24, 2024
da2861a
Remove `--game-type` argument
aphedges Sep 20, 2024
840285b
Remove unused functions
aphedges Sep 21, 2024
e1b6ea7
Remove unused imports
aphedges Sep 21, 2024
da712c8
Remove unused constants
aphedges Sep 21, 2024
a8bcf8b
Remove unused attributes
aphedges Sep 21, 2024
8140fa7
Remove more imports
aphedges Sep 21, 2024
53c8cf1
Remove more DAIDE-specific logic
aphedges Sep 21, 2024
09126a8
Remove `--deceptive` argument
aphedges Sep 21, 2024
bbcd34c
Remove other dead code
aphedges Sep 27, 2024
024ef2a
Use `BaselineBot.send_intent_log()`
aphedges Sep 24, 2024
dcc091d
Replace `print()` with `logging`
aphedges Sep 24, 2024
069aca9
Log exception with `logging.exception()`
aphedges Oct 8, 2024
f594b1b
Add message to note bot is still waiting
aphedges Sep 24, 2024
55fbdf0
Use `BaselineBot.wait_for_comm_stage()`
aphedges Sep 24, 2024
904d284
Set `player_type` when joining game
aphedges Sep 24, 2024
f39cfd6
Use `BaselineBot.send_orders()`
aphedges Sep 27, 2024
6c5f0e0
Use `BaselineBot.send_message()`
aphedges Sep 27, 2024
2abaa58
Merge pull request #30 from ALLAN-DIP/human_experiments-chiron-utils
aphedges Oct 31, 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
80 changes: 80 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
FROM nvidia/cuda:11.1.1-cudnn8-devel-ubuntu20.04

# Use default answer for any questions asked by Debian tools
ENV DEBIAN_FRONTEND=noninteractive

# Update and install OS packages
RUN apt-get -y update \
&& apt-get -y upgrade \
&& apt-get -y install --no-install-recommends \
autoconf=2.69-* \
clang-format-8=1:8.0.1-* \
cmake=3.16.3-* \
curl=7.68.0-* \
git=1:2.25.1-* \
libgoogle-glog-dev=0.4.0-* \
libtool=2.4.6-* \
pkg-config=0.29.1-* \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Install conda
# `-b`: run install in batch mode (without manual intervention)
# `-u`: update an existing installation
# `-p PREFIX`: install prefix
RUN curl https://repo.anaconda.com/miniconda/Miniconda3-4.7.10-Linux-x86_64.sh >~/miniconda.sh \
&& /bin/bash ~/miniconda.sh -b -u -p /usr/local \
&& rm ~/miniconda.sh

# Switch to application directory
WORKDIR /diplomacy_cicero

# Update existing environment
# `pip` needs to be updated separately to prevent version conflict
COPY environment-lock.yaml .
RUN conda env update --file environment-lock.yaml --prune \
&& pip install --no-cache-dir pip==24.0

# Install local pip packages
COPY thirdparty/ thirdparty/
# NOTE: Postman here links against pytorch for tensors, for this to work you may
# need to separately have installed cuda 11 on your own.
ENV Torch_DIR=/usr/local/lib/python3.7/site-packages/torch/share/cmake/Torch
RUN pip install --no-cache-dir -e ./thirdparty/github/fairinternal/postman/nest/ \
&& ln -s /usr/local/cuda /usr/local/nvidia \
&& pip install --no-cache-dir -e ./thirdparty/github/fairinternal/postman/postman/

# Install application requirements
COPY requirements-lock.txt .
RUN pip install --no-cache-dir -r requirements-lock.txt \
&& spacy download en_core_web_sm

# Install application itself
COPY conf/ conf/
COPY fairdiplomacy/ fairdiplomacy/
COPY fairdiplomacy_external/ fairdiplomacy_external/
COPY heyhi/ heyhi/
COPY parlai_diplomacy/ parlai_diplomacy/
COPY pyproject.toml .
COPY requirements.txt .
COPY setup.py .
COPY unit_tests/ unit_tests/
RUN pip install --no-cache-dir -e .

# Build application
COPY Makefile .
COPY dipcc/ dipcc/
RUN make

# Run unit tests
COPY slurm/ slurm/
RUN make test_fast

# Copy remaining files
COPY LICENSE.md .
COPY LICENSE_FOR_MODEL_WEIGHTS.txt .
COPY README.md .
COPY bin/ bin/
COPY run.py .

LABEL org.opencontainers.image.source=https://github.com/ALLAN-DIP/diplomacy_cicero
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ test: | test_fast test_cc

test_fast: | compile
@echo "Running fast (unit) tests"
python -m pytest heyhi/ fairdiplomacy/ parlai_diplomacy/ unit_tests/
python -m pytest heyhi/ fairdiplomacy/ parlai_diplomacy/ unit_tests/ --ignore=fairdiplomacy/AMR/

test_cc: | compile
@echo "Running c++ tests"
Expand All @@ -40,3 +40,11 @@ pyright:
clean:
-make -C dipcc/build clean
rm -rf build

TAG ?= latest

.PHONY: build
build:
docker build \
--tag ghcr.io/allan-dip/diplomacy_cicero:$(TAG) \
.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ After each pull it's recommended to run `make` to re-compile internal C++ and pr
module load tacc-singularity
git clone --recursive https://github.com/ALLAN-DIP/diplomacy_cicero.git

cp -r /corral/projects/DARPA-SHADE/Shared/cicero "$WORK"
cp -r /corral/projects/DARPA-SHADE/Shared/cicero $WORK
cp /corral/projects/DARPA-SHADE/Shared/UMD/pytorch_model.bin "$WORK"/diplomacy_cicero/fairdiplomacy/AMR/amrlib/amrlib/data/model_parse_xfm/checkpoint-9920/
export CICERO=$WORK/cicero

cd "$CICERO"
cd $CICERO
singularity run --nv \
--bind "$WORK"/diplomacy_cicero/fairdiplomacy/agents/:/diplomacy_cicero/fairdiplomacy/agent \
--bind "$WORK"/diplomacy_cicero/fairdiplomacy_external:/diplomacy_cicero/fairdiplomacy_external \
Expand Down
73 changes: 73 additions & 0 deletions environment-lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: base
prefix: /usr/local
channels:
- pytorch
- defaults
dependencies:
- _go_select=2.2.0=nocgo
- _libgcc_mutex=0.1=main
- blas=1.0=mkl
- brotlipy=0.7.0=py37h27cfd23_1003
- ca-certificates=2024.7.2=h06a4308_0
- certifi=2022.12.7=py37h06a4308_0
- cffi=1.15.0=py37h7f8727e_0
- charset-normalizer=2.0.4=pyhd3eb1b0_0
- conda=4.7.10=py37_0
- conda-package-handling=2.0.2=py37h06a4308_0
- conda-package-streaming=0.7.0=py37h06a4308_0
- cryptography=39.0.1=py37h9ce1e76_0
- cudatoolkit=11.0.221=h6bb024c_0
- flit-core=3.6.0=pyhd3eb1b0_0
- freetype=2.11.0=h70c0345_0
- giflib=5.2.1=h7b6447c_0
- go=1.21.5=hb589e2e_0
- idna=3.4=py37h06a4308_0
- intel-openmp=2021.4.0=h06a4308_3561
- jpeg=9b=h024ee3a_2
- lcms2=2.12=h3be6417_0
- libedit=3.1.20210910=h7f8727e_0
- libffi=3.2.1=hf484d3e_1007
- libgcc-ng=9.1.0=hdf63c60_0
- libpng=1.6.37=hbc83047_0
- libprotobuf=3.19.1=h4ff587b_0
- libstdcxx-ng=9.1.0=hdf63c60_0
- libtiff=4.1.0=h2733197_1
- libuv=1.40.0=h7b6447c_0
- libwebp=1.2.0=h89dd481_0
- lz4-c=1.9.3=h295c915_1
- mkl=2021.4.0=h06a4308_640
- mkl-service=2.4.0=py37h7f8727e_0
- mkl_fft=1.3.1=py37hd3c417c_0
- mkl_random=1.2.2=py37h51133e4_0
- ncurses=6.3=h7f8727e_2
- ninja=1.10.2=h06a4308_5
- ninja-base=1.10.2=hd09550d_5
- numpy=1.21.5=py37he7a7128_2
- numpy-base=1.21.5=py37hf524024_2
- openssl=1.1.1w=h7f8727e_0
- pillow=9.0.1=py37h22f2fdc_0
- protobuf=3.19.1=py37h295c915_0
- pybind11=2.9.1=py37hae6d005_0
- pycosat=0.6.3=py37h27cfd23_0
- pycparser=2.21=pyhd3eb1b0_0
- pyopenssl=23.0.0=py37h06a4308_0
- pysocks=1.7.1=py37_1
- python=3.7.3=h0371630_0
- pytorch=1.7.1=py3.7_cuda11.0.221_cudnn8.0.5_0
- readline=7.0=h7b6447c_5
- requests=2.28.1=py37h06a4308_0
- ruamel_yaml=0.15.100=py37h27cfd23_0
- setuptools=65.6.3=py37h06a4308_0
- six=1.16.0=pyhd3eb1b0_1
- sqlite=3.33.0=h62c20be_0
- tk=8.6.12=h1ccaba5_0
- torchaudio=0.7.2=py37
- torchvision=0.8.2=py37_cu110
- typing_extensions=4.4.0=py37h06a4308_0
- urllib3=1.26.14=py37h06a4308_0
- wheel=0.38.4=py37h06a4308_0
- xz=5.2.5=h7f8727e_1
- yaml=0.2.5=h7b6447c_0
- zlib=1.2.12=h7f8727e_2
- zstandard=0.15.2=py37h27cfd23_0
- zstd=1.4.9=haebb681_0
17 changes: 17 additions & 0 deletions environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: base
prefix: /usr/local
channels:
- pytorch
- defaults
dependencies:
# Install go for boringssl in grpc
- go=1.21.5
# We have some hacky patching code for protobuf that is not guaranteed
# to work on versions other than this.
- protobuf=3.19.1
- pybind11=2.9.1
# Other requirements
- python=3.7.3
- pytorch=1.7.1
- torchaudio=0.7.2
- torchvision=0.8.2
Loading