Skip to content

Commit 3fefe27

Browse files
authored
Update Dockerfile to build Megablocks (#2042)
1 parent 6428f1d commit 3fefe27

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

Dockerfile

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ ENV NVCC_THREADS=$nvcc_threads
4141

4242
RUN python3 setup.py build_ext --inplace
4343

44+
# Build the megablocks library as wheel because it doesn't publish pre-built wheels.
45+
# https://github.com/stanford-futuredata/megablocks/commit/5897cd6f254b7b3edf7a708a3a3314ecb54b6f78
46+
RUN apt-get install -y git && \
47+
git clone https://github.com/stanford-futuredata/megablocks.git && \
48+
cd megablocks && \
49+
git checkout 5897cd6f254b7b3edf7a708a3a3314ecb54b6f78 && \
50+
MAX_JOBS=8 NVCC_THREADS=8 python3 setup.py bdist_wheel
51+
4452
# image to run unit testing suite
4553
FROM dev AS test
4654

@@ -73,12 +81,16 @@ ENTRYPOINT ["python3", "-m", "vllm.entrypoints.api_server"]
7381

7482
# openai api server alternative
7583
FROM vllm-base AS vllm-openai
76-
# install additional dependencies for openai api server, and mixtral
84+
# install additional dependencies for openai api server
7785
RUN --mount=type=cache,target=/root/.cache/pip \
78-
pip install accelerate megablocks
86+
pip install accelerate
7987

80-
COPY --from=build /workspace/vllm/*.so /workspace/vllm/
8188
COPY vllm vllm
89+
COPY --from=build /workspace/vllm/*.so /workspace/vllm/
90+
COPY --from=build /workspace/megablocks/dist/*.whl /tmp/
91+
RUN --mount=type=cache,target=/root/.cache/pip \
92+
pip install /tmp/megablocks-0.5.0-cp310-cp310-linux_x86_64.whl && \
93+
rm /tmp/megablocks-0.5.0-cp310-cp310-linux_x86_64.whl
8294

8395
ENTRYPOINT ["python3", "-m", "vllm.entrypoints.openai.api_server"]
8496

0 commit comments

Comments
 (0)