Repository navigation
Expand file tree
/
Copy pathDockerfile.train
More file actions
68 lines (54 loc) · 1.71 KB
/
Copy pathDockerfile.train
File metadata and controls
68 lines (54 loc) · 1.71 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
# Training Dockerfile for H-JEPA
# Optimized for CUDA 11.8+ and PyTorch 2.7.1
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04
# Prevent interactive prompts
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
ENV TORCH_CUDA_ARCH_LIST="7.0 7.5 8.0 8.6 8.9 9.0+PTX"
# Set working directory
WORKDIR /workspace/h-jepa
# Install system dependencies
RUN apt-get update && apt-get install -y \
python3.11 \
python3.11-dev \
python3-pip \
git \
wget \
curl \
vim \
htop \
build-essential \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
libgomp1 \
&& rm -rf /var/lib/apt/lists/*
# Upgrade pip
RUN python3.11 -m pip install --no-cache-dir --upgrade pip setuptools wheel
# Install PyTorch with CUDA support (clean up cache to save space)
RUN python3.11 -m pip install --no-cache-dir torch==2.7.1 torchvision==0.22.1 --index-url https://download.pytorch.org/whl/cu118
# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN python3.11 -m pip install --no-cache-dir -r requirements.txt
# Install additional training dependencies
RUN python3.11 -m pip install --no-cache-dir \
nvidia-ml-py3 \
gpustat \
py-cpuinfo \
psutil
# Copy project files
COPY . .
# Install h-jepa package in development mode
RUN python3.11 -m pip install --no-cache-dir -e . \
&& python3.11 -m pip check \
&& python3.11 scripts/train.py --help
# Create directories for data and results
RUN mkdir -p /workspace/data /workspace/results /workspace/checkpoints
# Set environment variables for optimal performance
ENV OMP_NUM_THREADS=1
ENV MKL_NUM_THREADS=1
# Expose tensorboard port
EXPOSE 6006
# Default command: run training
CMD ["python3.11", "scripts/train.py"]