Skip to content

Commit 00fd789

Browse files
committed
[vLLM] Remove xformers in vLLM build workflow
Signed-off-by: Huy Do <huydhn@gmail.com>
1 parent e701379 commit 00fd789

3 files changed

Lines changed: 8 additions & 35 deletions

File tree

.ci/lumen_cli/cli/lib/core/vllm/vllm_test.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ def __init__(self, args: Any):
8282

8383
# Match the structure of the artifacts.zip from vllm external build
8484
self.VLLM_TEST_WHLS_REGEX = [
85-
"xformers/*.whl",
8685
"vllm/vllm*.whl",
8786
]
8887

@@ -222,14 +221,13 @@ def preprocess_test_in(
222221
"""
223222
This modifies the target_file file in place in vllm work directory.
224223
It removes torch and unwanted packages in target_file and replace with local torch whls
225-
package with format "$WHEEL_PACKAGE_NAME @ file://<LOCAL_PATH>"
224+
package with format "$WHEEL_PACKAGE_NAME @ file://<LOCAL_PATH>"
226225
"""
227226
additional_package_to_move = list(additional_packages or ())
228227
pkgs_to_remove = [
229228
"torch",
230229
"torchvision",
231230
"torchaudio",
232-
"xformers",
233231
"mamba_ssm",
234232
] + additional_package_to_move
235233
# Read current requirements
@@ -273,7 +271,7 @@ def check_versions():
273271
check installed packages version
274272
"""
275273
logger.info("Double check installed packages")
276-
patterns = ["torch", "xformers", "torchvision", "torchaudio", "vllm"]
274+
patterns = ["torch", "torchvision", "torchaudio", "vllm"]
277275
for pkg in patterns:
278276
pkg_exists(pkg)
279277
logger.info("Done. checked installed packages")

.github/ci_configs/vllm/Dockerfile

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG CUDA_VERSION=12.9.1
22
ARG PYTHON_VERSION=3.12
33

4-
# BUILD_BASE_IMAGE: used to setup python build xformers, and vllm wheels, It can be replaced with a different base image from local machine,
4+
# BUILD_BASE_IMAGE: used to build vllm wheels, It can be replaced with a different base image from local machine,
55
# by default, it uses the torch-nightly-base stage from this docker image
66
ARG BUILD_BASE_IMAGE=torch-nightly-base
77
ARG FINAL_BASE_IMAGE=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu22.04
@@ -116,28 +116,9 @@ RUN --mount=type=cache,target=/root/.cache/uv \
116116
RUN --mount=type=cache,target=/root/.cache/uv \
117117
uv pip install --system -r requirements/common.txt
118118

119-
ARG max_jobs=16
120-
ENV MAX_JOBS=${max_jobs}
121-
122-
RUN --mount=type=cache,target=/root/.cache/uv bash - <<'BASH'
123-
export TORCH_CUDA_ARCH_LIST='7.5 8.0+PTX 9.0a'
124-
git clone https://github.com/facebookresearch/xformers.git
125-
126-
pushd xformers
127-
git checkout v0.0.33.post1
128-
git submodule update --init --recursive
129-
python3 setup.py bdist_wheel --dist-dir=../xformers-dist --verbose
130-
popd
131-
132-
rm -rf xformers
133-
BASH
134-
135-
RUN --mount=type=cache,target=/root/.cache/uv \
136-
uv pip install --system xformers-dist/*.whl
137-
138119
RUN uv pip freeze | grep -i '^torch\|^torchvision\|^torchaudio' > torch_build_versions.txt
139120
RUN cat torch_build_versions.txt
140-
RUN pip freeze | grep -E 'torch|xformers|torchvision|torchaudio'
121+
RUN pip freeze | grep -E 'torch|torchvision|torchaudio'
141122
#################### BASE BUILD IMAGE ####################
142123

143124

@@ -240,7 +221,6 @@ RUN if command -v apt-get >/dev/null; then \
240221

241222
# Get the torch versions, and whls used in previous stage
242223
COPY --from=base /workspace/torch_build_versions.txt ./torch_build_versions.txt
243-
COPY --from=base /workspace/xformers-dist /wheels/xformers
244224
COPY --from=build /workspace/vllm-dist /wheels/vllm
245225
RUN echo "[INFO] Listing current directory before torch install step:" && \
246226
ls -al && \
@@ -290,20 +270,15 @@ RUN --mount=type=cache,target=/root/.cache/uv \
290270
RUN --mount=type=cache,target=/root/.cache/uv \
291271
uv pip install --system /wheels/vllm/*.whl --verbose
292272

293-
# Install xformers wheel from previous stage
294-
RUN --mount=type=cache,target=/root/.cache/uv \
295-
uv pip install --system /wheels/xformers/*.whl --verbose
296-
297273
# Logging to confirm the torch versions
298-
RUN pip freeze | grep -E 'torch|xformers|vllm'
299-
RUN uv pip freeze | grep -i '^torch\|^torchvision\|^torchaudio\|^xformers\|^vllm' > build_summary.txt
274+
RUN pip freeze | grep -E 'torch|vllm'
275+
RUN uv pip freeze | grep -i '^torch\|^torchvision\|^torchaudio\|^vllm' > build_summary.txt
300276
################### VLLM INSTALLED IMAGE ####################
301277

302278

303279
#################### EXPORT STAGE ####################
304280
FROM scratch as export-wheels
305281

306282
# Just copy the wheels we prepared in previous stages
307-
COPY --from=base /workspace/xformers-dist /wheels/xformers
308283
COPY --from=build /workspace/vllm-dist /wheels/vllm
309284
COPY --from=vllm-base /workspace/build_summary.txt /wheels/build_summary.txt

.github/scripts/prepare_vllm_wheels.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ change_wheel_version() {
3737
# Update the version in METADATA and its SHA256 hash
3838
sed -i "s/Version: ${f_version}/Version: ${t_version}/g" METADATA
3939
# then add PyTorch nightly dependency of vLLM
40-
if [[ "${package}" == vllm ]] || [[ "${package}" == xformers ]]; then
40+
if [[ "${package}" == vllm ]]; then
4141
sed -i "/License-File/a\Requires-Dist: torch==${torch_version}" METADATA
4242
fi
4343
sed -i '/METADATA,sha256/d' RECORD
@@ -88,7 +88,7 @@ repackage_wheel() {
8888
${PYTHON_EXECUTABLE} -mpip install wheel==0.45.1
8989

9090
pushd externals/vllm/wheels
91-
for package in xformers vllm; do
91+
for package in vllm; do
9292
repackage_wheel $package
9393
done
9494
popd

0 commit comments

Comments
 (0)