Dockerfile 933 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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



FROM pytorch/pytorch:2.3.1-cuda12.1-cudnn8-devel as compile_server
WORKDIR /workspace
15
ENV CUDA_HOME /usr/local/cuda
16
17
18
19
20
21
22
23
24
25
26
27
28
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 &&
29
pip install ninja pyproject numpy cpufeature &&
30
pip install flash-attn &&
31
CPU_INSTRUCT=NATIVE  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 &&
32
33
34
35
pip cache purge
EOF

ENTRYPOINT [ "/opt/conda/bin/ktransformers" ]