-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.gpu
More file actions
82 lines (69 loc) · 2.59 KB
/
Copy pathDockerfile.gpu
File metadata and controls
82 lines (69 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# striatica pipeline — GPU variant for Vast.ai / Lambda / cloud GPU instances
# CUDA 12.4 + Python 3.12 + PyTorch with CUDA support
#
# Build:
# docker build -f Dockerfile.gpu -t striatica-pipeline:gpu .
#
# Run:
# docker run --gpus all -v $(pwd)/output:/app/output -it \
# striatica-pipeline:gpu bash
FROM nvidia/cuda:12.4.1-runtime-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive
# Python 3.12 from deadsnakes PPA (not in base Ubuntu 22.04)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get update && \
apt-get install -y --no-install-recommends \
python3.12 \
python3.12-venv \
python3.12-dev \
build-essential \
git \
curl \
&& rm -rf /var/lib/apt/lists/* \
&& ln -sf /usr/bin/python3.12 /usr/bin/python
# pip for Python 3.12 (apt python3-pip installs for system python, not 3.12)
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python
WORKDIR /app
# PyTorch with CUDA — install FIRST so later deps don't pull CPU torch
RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cu124
# === UMAP REPRODUCIBILITY CHAIN — exact pins ===
# These versions produced the Feb 27 2026 dataset positions.
# Changing ANY of these will produce different 3D embeddings
# even with the same random_state. Do not widen these ranges.
RUN pip install --no-cache-dir \
"numpy==2.4.2" \
"scipy==1.17.1" \
"scikit-learn==1.8.0" \
"umap-learn==0.5.11" \
"hdbscan==0.8.41" \
"numba==0.64.0" \
"llvmlite==0.46.0" \
"pynndescent==0.6.0"
# Other pipeline deps
RUN pip install --no-cache-dir \
"requests>=2.32.5,<3.0.0" \
"huggingface-hub>=0.28.0,<1.0.0" \
"safetensors>=0.5.0,<1.0.0" \
"python-dotenv>=1.1.0,<2.0.0"
# ML optional deps (SAELens, TransformerLens, transformers)
RUN pip install --no-cache-dir \
"sae-lens>=6.37.0" \
"transformer-lens>=2.12.0" \
"transformers>=4.40.0,<5.0.0"
# Copy source and install project (striat entrypoint)
COPY pyproject.toml ./
COPY pipeline/ pipeline/
COPY scripts/ scripts/
COPY tests/ tests/
RUN pip install --no-cache-dir -e .
RUN mkdir -p /app/output /app/data
ENV STRIATICA_OUTPUT_DIR=/app/output
ENV STRIATICA_DATA_DIR=/app/data
# Smoke test at build time
RUN python -c "import torch; print(f'PyTorch {torch.__version__}, CUDA: {torch.backends.cuda.is_built()}')" || true
RUN python -c "from pipeline.vectors import load_transcoder_vectors; print('transcoder loader OK')"
ENTRYPOINT ["python", "-m", "pipeline.cli"]
CMD ["--help"]