|
1 | 1 | FROM nvidia/cuda:11.7.0-devel-ubuntu22.04 as builder
|
2 | 2 |
|
3 |
| -ENV NVIDIA_VISIBLE_DEVICES=all |
4 |
| -ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility |
5 |
| - |
6 |
| -# If you are running something modern, reducing this to 8.6 will speed up build times slightly. |
7 |
| -ENV TORCH_CUDA_ARCH_LIST="7.0 7.5 8.0 8.6+PTX" |
8 |
| - |
9 | 3 | RUN apt-get update && \
|
10 | 4 | apt-get install --no-install-recommends -y git ninja-build build-essential python3-dev python3-pip && \
|
11 | 5 | rm -rf /var/lib/apt/lists/*
|
12 | 6 |
|
| 7 | +RUN --mount=type=cache,target=/root/.cache/pip,Z pip3 install torch |
13 | 8 | RUN git clone https://github.com/qwopqwop200/GPTQ-for-LLaMa /build
|
14 | 9 |
|
15 | 10 | WORKDIR /build
|
16 | 11 |
|
17 |
| -# Fix until new parameter "groupsize" is figured out |
18 |
| -RUN git reset --hard 468c47c01b4fe370616747b6d69a2d3f48bab5e4 |
| 12 | +ARG GPTQ_SHA=HEAD |
| 13 | +RUN git reset --hard ${GPTQ_SHA} |
19 | 14 |
|
20 |
| -RUN --mount=type=cache,target=/root/.cache/pip,Z pip3 install torch |
21 | 15 | RUN --mount=type=cache,target=/root/.cache/pip,Z pip3 install -r requirements.txt
|
| 16 | + |
| 17 | +ARG TORCH_CUDA_ARCH_LIST="8.6+PTX" |
22 | 18 | RUN python3 setup_cuda.py bdist_wheel -d .
|
23 | 19 |
|
24 | 20 | FROM ubuntu:22.04
|
25 | 21 |
|
26 |
| -ENV CLI_ARGS="" |
27 |
| -ENV NVIDIA_VISIBLE_DEVICES=all |
28 |
| -ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility |
29 |
| - |
30 |
| -VOLUME /data |
31 |
| -VOLUME /output |
32 |
| - |
33 | 22 | RUN apt-get update && \
|
34 | 23 | apt-get install --no-install-recommends -y git python3 python3-pip && \
|
35 | 24 | rm -rf /var/lib/apt/lists/*
|
36 | 25 |
|
| 26 | +RUN --mount=type=cache,target=/root/.cache/pip,Z pip install torch torchvision torchaudio |
| 27 | + |
37 | 28 | RUN git clone https://github.com/oobabooga/text-generation-webui /app
|
38 | 29 |
|
39 | 30 | WORKDIR /app
|
40 | 31 |
|
41 |
| -COPY --from=builder /build /app/repositories/GPTQ-for-LLaMa |
| 32 | +ARG WEBUI_SHA=HEAD |
| 33 | +RUN git reset --hard ${WEBUI_SHA} |
42 | 34 |
|
43 |
| -RUN --mount=type=cache,target=/root/.cache/pip,Z pip install torch torchvision torchaudio |
44 | 35 | RUN --mount=type=cache,target=/root/.cache/pip,Z pip install -r requirements.txt
|
| 36 | + |
| 37 | +COPY --from=builder /build /app/repositories/GPTQ-for-LLaMa |
45 | 38 | RUN --mount=type=cache,target=/root/.cache/pip,Z pip install /app/repositories/GPTQ-for-LLaMa/*.whl
|
46 | 39 |
|
47 | 40 | COPY entrypoint.sh .
|
| 41 | + |
| 42 | +VOLUME /data |
| 43 | +VOLUME /output |
| 44 | + |
| 45 | +ENV CLI_ARGS="" |
| 46 | +ENV NVIDIA_VISIBLE_DEVICES=all |
| 47 | +ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility |
48 | 48 | ENTRYPOINT ["/app/entrypoint.sh"]
|
49 | 49 | CMD python3 server.py ${CLI_ARGS}
|
0 commit comments