Skip to content
Merged
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
20 changes: 15 additions & 5 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
# Data directories - these will be accessed via volume mount
data/
results/
logs_to_keep/
# Generated data payloads are accessed via a volume mount. Keep the root
# compatibility modules and the packaged speedrunning_plms.data source code.
/data/*
!/data/
!/data/*.py
/results/
/logs_to_keep/
/runs/
/targets.local.json

# Cache directories
.cache/
.pytest_cache/
__pycache__/
*.pyc
*.pyo
*.pyd
*.egg-info/
build/
dist/

# Git files
.git/
Expand All @@ -27,6 +36,7 @@ Thumbs.db

# Python virtual environments
venv/
.venv/
env/
.env

Expand All @@ -45,4 +55,4 @@ logs/

# Temporary files
tmp/
temp/
temp/
8 changes: 4 additions & 4 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
branches: [main]

permissions: # 👈 add this block (workflow- or job-level)
permissions:
contents: write

jobs:
Expand All @@ -14,6 +14,6 @@ jobs:

- uses: peaceiris/actions-gh-pages@v4
with:
publish_dir: docs # folder to publish
publish_branch: gh-pages # default is fine; adjust if you use a different branch
github_token: ${{ secrets.PERSONAL_TOKEN }}
publish_dir: docs
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
40 changes: 40 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CPU tests

on:
pull_request:
push:
branches: [main]

permissions:
contents: read

concurrency:
group: cpu-tests-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.12']
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- name: Install CPU dependencies
run: |
python -m pip install torch==2.6.0 --index-url https://download.pytorch.org/whl/cpu
python -m pip install -e ".[test,evaluation]"
python -m pip check
- name: Run offline tests
run: python -m pytest -q --durations=10
- name: Test historical score viewer
run: node --test tests/test_hub.cjs
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
omgprot50/
__pycache__/
.pytest_cache/
*.parquet
*.bin
/logs
/experiments/*.yaml
/.cache
*.egg-info/
/runs/
/targets.local.json
/.venv/
/data/*/manifest.json
/data/*/*.pt
38 changes: 13 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# sudo docker build -t speedrun_plm .
# sudo docker run --gpus all --shm-size=128g -v ${PWD}:/workspace speedrun_plm torchrun --standalone --nproc_per_node=4 train.py
# docker run --gpus all -v ${PWD}:/workspace speedrun_plm python train.py --bugfix
# 1️⃣ CUDA / cuDNN base with no Python
# docker build -t speedrun_plm .
# docker run --gpus all -v "${PWD}:/workspace" speedrun_plm python train.py --config experiment.json
FROM nvidia/cuda:12.8.0-cudnn-devel-ubuntu24.04

# 2️⃣ System prerequisites + Python 3.12
ENV DEBIAN_FRONTEND=noninteractive \
PYTHON_VERSION=3.12.7 \
PATH=/usr/local/bin:$PATH
ENV DEBIAN_FRONTEND=noninteractive \
PYTHON_VERSION=3.12.7 \
PATH=/usr/local/bin:$PATH

RUN apt-get update && \
apt-get install -y --no-install-recommends \
Expand All @@ -27,34 +24,27 @@ RUN curl -fsSLO https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYT
ln -s /usr/local/bin/python3.12 /usr/local/bin/python && \
ln -s /usr/local/bin/pip3.12 /usr/local/bin/pip

# 3️⃣ Location of project code (inside image) – NOT shared with host
WORKDIR /app

# 4️⃣ Copy requirements first for layer caching
# Cache dependency installation independently of source changes.
COPY requirements.txt .

RUN pip install --upgrade pip setuptools && \
pip install -r requirements.txt -U && \
pip install --force-reinstall torch torchvision --index-url https://download.pytorch.org/whl/cu128 -U && \
pip install numpy==1.26.4

pip install torch --index-url https://download.pytorch.org/whl/cu128 -U && \
pip install -r requirements.txt

# 5️⃣ Copy the rest of the source
COPY . .

# 6️⃣ Change working directory to where the volume will be mounted
RUN pip install -e ".[test,evaluation]"

WORKDIR /workspace

# ──────────────────────────────────────────────────────────────────────────────
# 7️⃣ Single persistent host volume (/workspace) for *all* artefacts & caches
# Bind-mount it when you run the container: -v ${PWD}:/workspace
# ──────────────────────────────────────────────────────────────────────────────
# Prefer the bind-mounted candidate over the image's installed source.
ENV PROJECT_ROOT=/workspace \
TRANSFORMERS_CACHE=/workspace/.cache/huggingface \
PYTHONPATH=/workspace/src \
HF_HOME=/workspace/.cache/huggingface \
TORCH_HOME=/workspace/.cache/torch \
XDG_CACHE_HOME=/workspace/.cache \
WANDB_DIR=/workspace/logs \
TQDM_CACHE=/workspace/.cache/tqdm

RUN mkdir -p \
Expand All @@ -65,8 +55,6 @@ RUN mkdir -p \
/workspace/data \
/workspace/results

# Declare the volume so other developers know it's intended to persist
VOLUME ["/workspace"]

# 8️⃣ Default command – override in `docker run … python train.py`
CMD ["bash"]
CMD ["bash"]
11 changes: 11 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
include LICENSE
include README.md
include requirements.txt
include prepare.py
include train.py
include research.py
include program.md
include experiment.json
recursive-include targets *.json
recursive-include evaluation *.py *.json
recursive-include tests *.py
Loading
Loading