-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathGenerate.Dockerfile
More file actions
executable file
·130 lines (119 loc) · 4.06 KB
/
Generate.Dockerfile
File metadata and controls
executable file
·130 lines (119 loc) · 4.06 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
SHELL ["/bin/bash", "-c"]
# Setup Environment Variables
ENV CUDA_HOME=/usr/local/cuda \
PYTHONUNBUFFERED=1 \
TORCH_CUDA_ARCH_LIST="7.0 7.5 8.0 8.6 8.9 9.0+PTX"
# Setup System Utilities
RUN apt-get update --yes --quiet \
&& apt-get upgrade --yes --quiet \
&& DEBIAN_FRONTEND=noninteractive apt-get install --yes --quiet --no-install-recommends \
apt-utils \
autoconf \
automake \
bc \
build-essential \
ca-certificates \
check \
cmake \
curl \
dmidecode \
emacs \
g++\
gcc \
git \
iproute2 \
jq \
kmod \
libaio-dev \
libcurl4-openssl-dev \
libgl1-mesa-glx \
libglib2.0-0 \
libgomp1 \
libibverbs-dev \
libnuma-dev \
libnuma1 \
libomp-dev \
libsm6 \
libssl-dev \
libsubunit-dev \
libsubunit0 \
libtool \
libxext6 \
libxrender-dev \
make \
moreutils \
net-tools \
ninja-build \
openssh-client \
openssh-server \
openssl \
pkg-config \
python3-dev \
software-properties-common \
sudo \
unzip \
util-linux \
vim \
wget \
zlib1g-dev \
&& apt-get autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/
# Setup base Python to bootstrap Mamba
RUN add-apt-repository --yes ppa:deadsnakes/ppa \
&& apt-get update --yes --quiet
RUN DEBIAN_FRONTEND=noninteractive apt-get install --yes --quiet --no-install-recommends \
python3.11 \
python3.11-dev \
python3.11-distutils \
python3.11-lib2to3 \
python3.11-gdbm \
python3.11-tk \
pip
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 999 \
&& update-alternatives --config python3 \
&& ln -s /usr/bin/python3 /usr/bin/python
RUN pip install --upgrade pip
# Setup optimized Mamba environment with required PyTorch dependencies
RUN wget -O /tmp/Miniforge.sh https://github.com/conda-forge/miniforge/releases/download/24.3.0-0/Mambaforge-24.3.0-0-Linux-x86_64.sh \
&& bash /tmp/Miniforge.sh -b -p /Miniforge \
&& echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-12.1/compat/" >> /Miniforge/etc/profile.d/mamba.sh \
&& source /Miniforge/etc/profile.d/conda.sh \
&& source /Miniforge/etc/profile.d/mamba.sh \
&& mamba update -y -q -n base -c defaults mamba \
&& mamba create -y -q -n BigCodeBench python=3.11 setuptools=69.5.1 \
&& mamba activate BigCodeBench \
&& mamba install -y -q -c conda-forge \
charset-normalizer \
gputil \
ipython \
numpy \
pandas \
scikit-learn \
wandb \
&& mamba install -y -q -c intel \
"mkl==2023" \
"mkl-static==2023" \
"mkl-include==2023" \
&& mamba install -y -q -c pytorch magma-cuda121 \
&& mamba clean -a -f -y
# Install VLLM precompiled with appropriate CUDA and ensure PyTorch is installed form the same version channel
RUN source /Miniforge/etc/profile.d/conda.sh \
&& source /Miniforge/etc/profile.d/mamba.sh \
&& mamba activate BigCodeBench
RUN rm -rf /bigcodebench
# Acquire benchmark code to local
ADD "https://api.github.com/repos/bigcode-project/bigcodebench/commits?per_page=1" latest_commit
RUN git clone https://github.com/bigcode-project/BigCodeBench.git /bigcodebench
# Install BigCodeBench and pre-load the dataset
RUN source /Miniforge/etc/profile.d/conda.sh \
&& source /Miniforge/etc/profile.d/mamba.sh \
&& mamba activate BigCodeBench \
&& cd /bigcodebench && pip install .[generate] \
&& python -c "from bigcodebench.data import get_bigcodebench; get_bigcodebench()" \
&& export MAX_JOBS=$(($(nproc) - 2)) \
&& pip install --no-cache-dir ninja packaging psutil \
&& pip install flash-attn==2.5.8 --no-build-isolation
WORKDIR /app
ENTRYPOINT ["/Miniforge/envs/BigCodeBench/bin/python", "-m", "bigcodebench.generate"]