Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dtrifiro committed Jan 20, 2025
1 parent 4121ba1 commit fb84bf8
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 17 deletions.
5 changes: 3 additions & 2 deletions Dockerfile.arm
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@ ENV VLLM_CPU_DISABLE_AVX512=${VLLM_CPU_DISABLE_AVX512}
RUN --mount=type=cache,target=/root/.cache/pip \
--mount=type=cache,target=/root/.cache/ccache \
--mount=type=bind,source=.git,target=.git \
VLLM_TARGET_DEVICE=cpu python3 setup.py bdist_wheel && \
pip install build -r requirements-build.txt && \
VLLM_TARGET_DEVICE=cpu python -m build --no-isolation --wheel && \
pip install dist/*.whl && \
rm -rf dist

WORKDIR /workspace/

RUN ln -s /workspace/vllm/tests && ln -s /workspace/vllm/examples && ln -s /workspace/vllm/benchmarks

ENTRYPOINT ["python3", "-m", "vllm.entrypoints.openai.api_server"]
ENTRYPOINT ["python3", "-m", "vllm.entrypoints.openai.api_server"]
2 changes: 1 addition & 1 deletion Dockerfile.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ENV VLLM_CPU_DISABLE_AVX512=${VLLM_CPU_DISABLE_AVX512}
RUN --mount=type=cache,target=/root/.cache/pip \
--mount=type=cache,target=/root/.cache/ccache \
--mount=type=bind,source=.git,target=.git \
VLLM_TARGET_DEVICE=cpu pip install -v .
VLLM_TARGET_DEVICE=cpu pip install -v --no-build-isolation .

WORKDIR /workspace/

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.hpu
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN pip install -v -r requirements-hpu.txt
ENV no_proxy=localhost,127.0.0.1
ENV PT_HPU_ENABLE_LAZY_COLLECTIVES=true

RUN VLLM_TARGET_DEVICE=hpu python3 setup.py install
RUN VLLM_TARGET_DEVICE=hpu pip install .

# install development dependencies (for testing)
RUN python3 -m pip install -e tests/vllm_test_utils
Expand Down
6 changes: 2 additions & 4 deletions Dockerfile.neuron
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@ ARG APP_MOUNT=/workspace
VOLUME [ ${APP_MOUNT} ]
WORKDIR ${APP_MOUNT}/vllm

COPY requirements-build.txt /app/vllm/
COPY requirements-neuron.txt /app/vllm/
COPY requirements-common.txt /app/vllm/

# FIXME: needs some way to provide build dependencies
ENV PIP_EXTRA_INDEX_URL=https://pip.repos.neuron.amazonaws.com
RUN --mount=type=cache,target=/root/.cache/pip \
cd /app/vllm && \
python3 -m pip install --pre -U -r requirements-neuron.txt

python3 -m pip install --pre -U -r requirements-neuron.txt -r requirements-build.txt


COPY . .
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.openvino
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ COPY . /workspace/vllm

# build vLLM with OpenVINO backend
RUN --mount=type=cache,target=/root/.cache/pip \
PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu"
PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu" \
VLLM_TARGET_DEVICE="openvino" \
python3 -m pip install -v /workspace/vllm/

Expand Down
7 changes: 2 additions & 5 deletions Dockerfile.tpu
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,16 @@ RUN --mount=type=cache,target=/var/cache/apt \
RUN --mount=type=cache,target=/root/.cache/pip \
--mount=type=bind,source=requirements-build.txt,target=requirements-build.txt \
--mount=type=bind,source=requirements-tpu.txt,target=requirements-tpu.txt \
pip install -r requirements-tpu.txt
pip install -r requirements-tpu.txt -r requirements-build.txt

COPY . .
ARG GIT_REPO_CHECK=0
RUN --mount=type=bind,source=.git,target=.git \
if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh; fi

# FIXME: needs some way of providing build dependencies

COPY . /workspace/vllm
ENV VLLM_TARGET_DEVICE="tpu"
RUN --mount=type=cache,target=/root/.cache/pip \
--mount=type=bind,source=.git,target=.git \
cd /workspace/vllm && pip install --no-build-isolation -v -e .
VLLM_TARGET_DEVICE="tpu" pip install --no-build-isolation -v -e .

CMD ["/bin/bash"]
12 changes: 11 additions & 1 deletion _build_backend/vllm.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,17 @@ def get_requires_for_build_wheel( # type: ignore[no-redef]
requirements_extras.append("torch==2.5.1")
# TODO: add intel extension for pytorch?
elif VLLM_TARGET_DEVICE == "cuda":
requirements_extras.append("torch==2.5.1")
if os.getenv("TARGETPLATFORM") == "linux/arm64":
# FIXME: ?
_check_for_extra_index_url(
"https://download.pytorch.org/whl/nightly/cu124")
requirements_extras.extend([
"torch==2.6.0.dev20241210+cu124",
"torchvision==0.22.0.dev20241215"
])

else:
requirements_extras.append("torch==2.5.1")
elif VLLM_TARGET_DEVICE == "rocm":
# TODO: ? add support for multiple ROCM versions (6.3?)
rocm_supported_versions = ("6.2", )
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

from packaging.version import Version, parse
from setuptools import Extension, find_packages, setup
from setuptools import build_meta as _orig
from setuptools.build_meta import *
from setuptools.command.build_ext import build_ext
from setuptools.errors import SetupError
Expand Down Expand Up @@ -352,7 +351,8 @@ def _no_device() -> bool:


def _is_cuda() -> bool:
return VLLM_TARGET_DEVICE == "cuda" and not (_is_neuron() or _is_tpu() or _is_hpu())
return VLLM_TARGET_DEVICE == "cuda" and not (_is_neuron() or _is_tpu()
or _is_hpu())


def _is_hip() -> bool:
Expand Down

0 comments on commit fb84bf8

Please sign in to comment.