Dockerfile 1.03 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
FROM node:20.16.0 as web_compile
WORKDIR /home
RUN <<EOF
git clone https://github.com/kvcache-ai/ktransformers.git &&
cd ktransformers/ktransformers/website/ &&
npm install @vue/cli &&
npm run build &&
rm -rf node_modules
EOF



liam's avatar
liam committed
13
FROM pytorch/pytorch:2.5.1-cuda12.1-cudnn9-devel as compile_server
liam's avatar
liam committed
14
ARG CPU_INSTRUCT=NATIVE
15
WORKDIR /workspace
16
ENV CUDA_HOME /usr/local/cuda
17
18
19
20
21
22
23
24
25
26
27
28
29
COPY --from=web_compile /home/ktransformers /workspace/ktransformers
RUN <<EOF
apt update -y &&  apt install -y  --no-install-recommends \
    git \
    wget \
    vim \
    gcc \
    g++ \
    cmake && 
rm -rf /var/lib/apt/lists/* &&
cd ktransformers &&
git submodule init &&
git submodule update &&
liam's avatar
liam committed
30
pip install --upgrade pip &&
31
pip install ninja pyproject numpy cpufeature &&
32
pip install flash-attn &&
liam's avatar
liam committed
33
CPU_INSTRUCT=${CPU_INSTRUCT}  KTRANSFORMERS_FORCE_BUILD=TRUE TORCH_CUDA_ARCH_LIST="8.0;8.6;8.7;8.9;9.0+PTX" pip install . --no-build-isolation --verbose &&
liam's avatar
liam committed
34
35
pip cache purge &&
cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /opt/conda/lib/
36
37
EOF

38
ENTRYPOINT ["tail", "-f", "/dev/null"]