Dockerfile: # The vLLM Dockerfile is used to construct vLLM image that can be directly used
  # to run the OpenAI compatible server.
  
  # Please update any changes made here to
  # docs/source/dev/dockerfile/dockerfile.rst and
  # docs/source/assets/dev/dockerfile-stages-dependency.png
  
  ARG CUDA_VERSION=12.4.1
  #################### BASE BUILD IMAGE ####################
  # prepare basic build environment
  FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu20.04 AS base
  
  ARG CUDA_VERSION=12.4.1
  ARG PYTHON_VERSION=3.10
  
  ENV DEBIAN_FRONTEND=noninteractive
  
  RUN echo 'tzdata tzdata/Areas select America' | debconf-set-selections \
      && echo 'tzdata tzdata/Zones/America select Los_Angeles' | debconf-set-selections \
      && apt-get update -y \
      && apt-get install -y ccache software-properties-common \
      && add-apt-repository ppa:deadsnakes/ppa \
      && apt-get update -y \
      && apt-get install -y python${PYTHON_VERSION} python${PYTHON_VERSION}-dev python${PYTHON_VERSION}-venv \
      && if [ "${PYTHON_VERSION}" != "3" ]; then update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1; fi \
      && python3 --version
  
  RUN apt-get update -y \
      && apt-get install -y git curl sudo
  
  # Install pip s.t. it will be compatible with our PYTHON_VERSION
  RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION}
  RUN python3 -m pip --version
  
  # Workaround for https://github.com/openai/triton/issues/2507 and
  # https://github.com/pytorch/pytorch/issues/107960 -- hopefully
  # this won't be needed for future versions of this docker image
  # or future versions of triton.
  RUN ldconfig /usr/local/cuda-$(echo $CUDA_VERSION | cut -d. -f1,2)/compat/
  
  WORKDIR /workspace
  
  # install build and runtime dependencies
  COPY requirements-common.txt requirements-common.txt
  COPY requirements-adag.txt requirements-adag.txt
  COPY requirements-cuda.txt requirements-cuda.txt
  RUN --mount=type=cache,target=/root/.cache/pip \
      python3 -m pip install -r requirements-cuda.txt
  
  COPY requirements-mamba.txt requirements-mamba.txt
  RUN python3 -m pip install packaging
  RUN python3 -m pip install -r requirements-mamba.txt
  
  # cuda arch list used by torch
  # can be useful for both `dev` and `test`
  # explicitly set the list to avoid issues with torch 2.2
  # see https://github.com/pytorch/pytorch/pull/123243
  ARG torch_cuda_arch_list='7.0 7.5 8.0 8.6 8.9 9.0+PTX'
  ENV TORCH_CUDA_ARCH_LIST=${torch_cuda_arch_list}
  #################### BASE BUILD IMAGE ####################
  
  #################### WHEEL BUILD IMAGE ####################
  FROM base AS build
  
  ARG PYTHON_VERSION=3.10
  
  # install build dependencies
  COPY requirements-build.txt requirements-build.txt
  
  RUN --mount=type=cache,target=/root/.cache/pip \
      python3 -m pip install -r requirements-build.txt
  
  # install compiler cache to speed up compilation leveraging local or remote caching
  RUN apt-get update -y && apt-get install -y ccache
  
  # files and directories related to build wheels
  COPY csrc csrc
  COPY setup.py setup.py
  COPY cmake cmake
  COPY CMakeLists.txt CMakeLists.txt
  COPY requirements-common.txt requirements-common.txt
  COPY requirements-adag.txt requirements-adag.txt
  COPY requirements-cuda.txt requirements-cuda.txt
  COPY pyproject.toml pyproject.toml
  COPY vllm vllm
  
  # max jobs used by Ninja to build extensions
  ARG max_jobs=2
  ENV MAX_JOBS=${max_jobs}
  # number of threads used by nvcc
  ARG nvcc_threads=8
  ENV NVCC_THREADS=$nvcc_threads
  
  ARG buildkite_commit
  ENV BUILDKITE_COMMIT=${buildkite_commit}
  
  ARG USE_SCCACHE
  # if USE_SCCACHE is set, use sccache to speed up compilation
  RUN --mount=type=cache,target=/root/.cache/pip \
      if [ "$USE_SCCACHE" = "1" ]; then \
          echo "Installing sccache..." \
          && curl -L -o sccache.tar.gz https://github.com/mozilla/sccache/releases/download/v0.8.1/sccache-v0.8.1-x86_64-unknown-linux-musl.tar.gz \
          && tar -xzf sccache.tar.gz \
          && sudo mv sccache-v0.8.1-x86_64-unknown-linux-musl/sccache /usr/bin/sccache \
          && rm -rf sccache.tar.gz sccache-v0.8.1-x86_64-unknown-linux-musl \
          && if [ "$CUDA_VERSION" = "11.8.0" ]; then \
              export SCCACHE_BUCKET=vllm-build-sccache-2; \
             else \
              export SCCACHE_BUCKET=vllm-build-sccache; \
             fi \
          && export SCCACHE_REGION=us-west-2 \
          && export CMAKE_BUILD_TYPE=Release \
          && sccache --show-stats \
          && python3 setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38 \
          && sccache --show-stats; \
      fi
  
  ENV CCACHE_DIR=/root/.cache/ccache
  RUN --mount=type=cache,target=/root/.cache/ccache \
      --mount=type=cache,target=/root/.cache/pip \
      if [ "$USE_SCCACHE" != "1" ]; then \
          python3 setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38; \
      fi
  
  # check the size of the wheel, we cannot upload wheels larger than 100MB
  COPY .buildkite/check-wheel-size.py check-wheel-size.py
  RUN python3 check-wheel-size.py dist
  
  #################### EXTENSION Build IMAGE ####################
  
  #################### DEV IMAGE ####################
  FROM base as dev
  
  COPY requirements-lint.txt requirements-lint.txt
  COPY requirements-test.txt requirements-test.txt
  COPY requirements-dev.txt requirements-dev.txt
  RUN --mount=type=cache,target=/root/.cache/pip \
      python3 -m pip install -r requirements-dev.txt
  
  #################### DEV IMAGE ####################
  #################### MAMBA Build IMAGE ####################
  FROM dev as mamba-builder
  # max jobs used for build
  ARG max_jobs=2
  ENV MAX_JOBS=${max_jobs}
  
  WORKDIR /usr/src/mamba
  
  COPY requirements-mamba.txt requirements-mamba.txt
  
  # Download the wheel or build it if a pre-compiled release doesn't exist
  RUN pip --verbose wheel -r requirements-mamba.txt \
      --no-build-isolation --no-deps --no-cache-dir
  
  #################### MAMBA Build IMAGE ####################
  
  #################### vLLM installation IMAGE ####################
  # image with vLLM installed
  FROM nvidia/cuda:${CUDA_VERSION}-base-ubuntu20.04 AS vllm-base
  ARG CUDA_VERSION=12.4.1
  ARG PYTHON_VERSION=3.10
  WORKDIR /vllm-workspace
  
  RUN echo 'tzdata tzdata/Areas select America' | debconf-set-selections \
      && echo 'tzdata tzdata/Zones/America select Los_Angeles' | debconf-set-selections \
      && apt-get update -y \
      && apt-get install -y ccache software-properties-common \
      && add-apt-repository ppa:deadsnakes/ppa \
      && apt-get update -y \
      && apt-get install -y python${PYTHON_VERSION} python${PYTHON_VERSION}-dev python${PYTHON_VERSION}-venv \
      && if [ "${PYTHON_VERSION}" != "3" ]; then update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1; fi \
      && python3 --version
  
  RUN apt-get update -y \
      && apt-get install -y python3-pip git vim curl libibverbs-dev
  
  # Install pip s.t. it will be compatible with our PYTHON_VERSION
  RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION}
  RUN python3 -m pip --version
  
  # Workaround for https://github.com/openai/triton/issues/2507 and
  # https://github.com/pytorch/pytorch/issues/107960 -- hopefully
  # this won't be needed for future versions of this docker image
  # or future versions of triton.
  RUN ldconfig /usr/local/cuda-$(echo $CUDA_VERSION | cut -d. -f1,2)/compat/
  
  # install vllm wheel first, so that torch etc will be installed
  RUN --mount=type=bind,from=build,src=/workspace/dist,target=/vllm-workspace/dist \
      --mount=type=cache,target=/root/.cache/pip \
      python3 -m pip install dist/*.whl --verbose
  
  RUN --mount=type=bind,from=mamba-builder,src=/usr/src/mamba,target=/usr/src/mamba \
      --mount=type=cache,target=/root/.cache/pip \
      python3 -m pip install /usr/src/mamba/*.whl --no-cache-dir
  
  RUN --mount=type=cache,target=/root/.cache/pip \
      python3 -m pip install https://github.com/flashinfer-ai/flashinfer/releases/download/v0.1.2/flashinfer-0.1.2+cu121torch2.4-cp310-cp310-linux_x86_64.whl
  #################### vLLM installation IMAGE ####################
  
  
  #################### TEST IMAGE ####################
  # image to run unit testing suite
  # note that this uses vllm installed by `pip`
  FROM vllm-base AS test
  
  ADD . /vllm-workspace/
  
  # install development dependencies (for testing)
  RUN --mount=type=cache,target=/root/.cache/pip \
      python3 -m pip install -r requirements-dev.txt
  
  # doc requires source code
  # we hide them inside `test_docs/` , so that this source code
  # will not be imported by other tests
  RUN mkdir test_docs
  RUN mv docs test_docs/
  RUN mv vllm test_docs/
  
  #################### TEST IMAGE ####################
  
  #################### OPENAI API SERVER ####################
  # openai api server alternative
  FROM vllm-base AS vllm-openai
  
  # install additional dependencies for openai api server
  RUN --mount=type=cache,target=/root/.cache/pip \
      pip install accelerate hf_transfer 'modelscope!=1.15.0'
  
  ENV VLLM_USAGE_SOURCE production-docker-image
  
  ENTRYPOINT ["python3", "-m", "vllm.entrypoints.openai.api_server"]
  #################### OPENAI API SERVER ####################
  
Dockerfile.rocm: # Default ROCm 6.1 base image
  ARG BASE_IMAGE="rocm/pytorch:rocm6.1.2_ubuntu20.04_py3.9_pytorch_staging"
  
  # Default ROCm ARCHes to build vLLM for.
  ARG PYTORCH_ROCM_ARCH="gfx908;gfx90a;gfx942;gfx1100"
  
  # Whether to install CK-based flash-attention
  # If 0, will not install flash-attention
  ARG BUILD_FA="1"
  # If `TRY_FA_WHEEL=1`, we will try installing flash-attention from `FA_WHEEL_URL`
  # If this succeeds, we use the downloaded wheel and skip building flash-attention.
  # Otherwise, ROCm flash-attention from `FA_BRANCH` will be built for the
  # architectures specified in `FA_GFX_ARCHS`
  ARG TRY_FA_WHEEL="1"
  ARG FA_WHEEL_URL="https://github.com/ROCm/flash-attention/releases/download/v2.5.9post1-cktile-vllm/flash_attn-2.5.9.post1-cp39-cp39-linux_x86_64.whl"
  ARG FA_GFX_ARCHS="gfx90a;gfx942"
  ARG FA_BRANCH="23a2b1c2"
  
  # Whether to build triton on rocm
  ARG BUILD_TRITON="1"
  ARG TRITON_BRANCH="e0fc12c"
  
  ### Base image build stage
  FROM $BASE_IMAGE AS base
  
  # Import arg(s) defined before this build stage
  ARG PYTORCH_ROCM_ARCH
  
  # Install some basic utilities
  RUN apt-get update && apt-get install python3 python3-pip -y
  RUN apt-get update && apt-get install -y \
      curl \
      ca-certificates \
      sudo \
      git \
      bzip2 \
      libx11-6 \
      build-essential \
      wget \
      unzip \
      tmux \
      ccache \
   && rm -rf /var/lib/apt/lists/*
  
  # When launching the container, mount the code directory to /vllm-workspace
  ARG APP_MOUNT=/vllm-workspace
  WORKDIR ${APP_MOUNT}
  
  RUN python3 -m pip install --upgrade pip
  # Remove sccache so it doesn't interfere with ccache
  # TODO: implement sccache support across components
  RUN apt-get purge -y sccache; python3 -m pip uninstall -y sccache; rm -f "$(which sccache)"
  # Install torch == 2.5.0 on ROCm
  RUN case "$(ls /opt | grep -Po 'rocm-[0-9]\.[0-9]')" in \
          *"rocm-6.1"*) \
              python3 -m pip uninstall -y torch torchvision \
              && python3 -m pip install --no-cache-dir --pre \
                  torch==2.5.0.dev20240726 \
                  torchvision==0.20.0.dev20240726 \
                 --index-url https://download.pytorch.org/whl/nightly/rocm6.1;; \
          *) ;; esac
  
  ENV LLVM_SYMBOLIZER_PATH=/opt/rocm/llvm/bin/llvm-symbolizer
  ENV PATH=$PATH:/opt/rocm/bin:/libtorch/bin:
  ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/lib/:/libtorch/lib:
  ENV CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/libtorch/include:/libtorch/include/torch/csrc/api/include/:/opt/rocm/include/:
  
  ENV PYTORCH_ROCM_ARCH=${PYTORCH_ROCM_ARCH}
  ENV CCACHE_DIR=/root/.cache/ccache
  
  
  ### AMD-SMI build stage
  FROM base AS build_amdsmi
  # Build amdsmi wheel always
  RUN cd /opt/rocm/share/amd_smi \
      && python3 -m pip wheel . --wheel-dir=/install
  
  
  ### Flash-Attention wheel build stage
  FROM base AS build_fa
  ARG BUILD_FA
  ARG TRY_FA_WHEEL
  ARG FA_WHEEL_URL
  ARG FA_GFX_ARCHS
  ARG FA_BRANCH
  # Build ROCm flash-attention wheel if `BUILD_FA = 1`
  RUN --mount=type=cache,target=${CCACHE_DIR} \
      if [ "$BUILD_FA" = "1" ]; then \
          if [ "${TRY_FA_WHEEL}" = "1" ] && python3 -m pip install "${FA_WHEEL_URL}"; then \
              # If a suitable wheel exists, we download it instead of building FA
              mkdir -p /install && wget -N "${FA_WHEEL_URL}" -P /install; \
          else \
              mkdir -p libs \
              && cd libs \
              && git clone https://github.com/ROCm/flash-attention.git \
              && cd flash-attention \
              && git checkout "${FA_BRANCH}" \
              && git submodule update --init \
              && GPU_ARCHS="${FA_GFX_ARCHS}" python3 setup.py bdist_wheel --dist-dir=/install; \
          fi; \
      # Create an empty directory otherwise as later build stages expect one
      else mkdir -p /install; \
      fi
  
  
  ### Triton wheel build stage
  FROM base AS build_triton
  ARG BUILD_TRITON
  ARG TRITON_BRANCH
  # Build triton wheel if `BUILD_TRITON = 1`
  RUN --mount=type=cache,target=${CCACHE_DIR} \
      if [ "$BUILD_TRITON" = "1" ]; then \
      mkdir -p libs \
      && cd libs \
      && git clone https://github.com/OpenAI/triton.git \
      && cd triton \
      && git checkout "${TRITON_BRANCH}" \
      && cd python \
      && python3 setup.py bdist_wheel --dist-dir=/install; \
      # Create an empty directory otherwise as later build stages expect one
      else mkdir -p /install; \
      fi
  
  
  ### Final vLLM build stage
  FROM base AS final
  # Import the vLLM development directory from the build context
  COPY . .
  
  # Package upgrades for useful functionality or to avoid dependency issues
  RUN --mount=type=cache,target=/root/.cache/pip \
      python3 -m pip install --upgrade numba scipy huggingface-hub[cli]
  
  
  # Workaround for ray >= 2.10.0
  ENV RAY_EXPERIMENTAL_NOSET_ROCR_VISIBLE_DEVICES=1
  # Silences the HF Tokenizers warning
  ENV TOKENIZERS_PARALLELISM=false
  
  RUN --mount=type=cache,target=${CCACHE_DIR} \
      --mount=type=cache,target=/root/.cache/pip \
      python3 -m pip install -Ur requirements-rocm.txt \
      && case "$(ls /opt | grep -Po 'rocm-[0-9]\.[0-9]')" in \
          *"rocm-6.1"*) \
              # Bring in upgrades to HIP graph earlier than ROCm 6.2 for vLLM
              wget -N https://github.com/ROCm/vllm/raw/fa78403/rocm_patch/libamdhip64.so.6 -P /opt/rocm/lib \
              # Prevent interference if torch bundles its own HIP runtime
              && rm -f "$(python3 -c 'import torch; print(torch.__path__[0])')"/lib/libamdhip64.so* || true;; \
          *) ;; esac \
      && python3 setup.py clean --all \
      && python3 setup.py develop
  
  # Copy amdsmi wheel into final image
  RUN --mount=type=bind,from=build_amdsmi,src=/install,target=/install \
      mkdir -p libs \
      && cp /install/*.whl libs \
      # Preemptively uninstall to avoid same-version no-installs
      && python3 -m pip uninstall -y amdsmi;
  
  # Copy triton wheel(s) into final image if they were built
  RUN --mount=type=bind,from=build_triton,src=/install,target=/install \
      mkdir -p libs \
      && if ls /install/*.whl; then \
          cp /install/*.whl libs \
          # Preemptively uninstall to avoid same-version no-installs
          && python3 -m pip uninstall -y triton; fi
  
  # Copy flash-attn wheel(s) into final image if they were built
  RUN --mount=type=bind,from=build_fa,src=/install,target=/install \
      mkdir -p libs \
      && if ls /install/*.whl; then \
          cp /install/*.whl libs \
          # Preemptively uninstall to avoid same-version no-installs
          && python3 -m pip uninstall -y flash-attn; fi
  
  # Install wheels that were built to the final image
  RUN --mount=type=cache,target=/root/.cache/pip \
      if ls libs/*.whl; then \
      python3 -m pip install libs/*.whl; fi
  
  CMD ["/bin/bash"]
  
Dockerfile.cpu: # This vLLM Dockerfile is used to construct image that can build and run vLLM on x86 CPU platform.
  
  FROM ubuntu:22.04 AS cpu-test-1
  
  RUN --mount=type=cache,target=/var/cache/apt \
      apt-get update -y \
      && apt-get install -y curl ccache git wget vim numactl gcc-12 g++-12 python3 python3-pip libtcmalloc-minimal4 libnuma-dev \
      && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 10 --slave /usr/bin/g++ g++ /usr/bin/g++-12
  
  # https://intel.github.io/intel-extension-for-pytorch/cpu/latest/tutorials/performance_tuning/tuning_guide.html
  # intel-openmp provides additional performance improvement vs. openmp
  # tcmalloc provides better memory allocation efficiency, e.g, holding memory in caches to speed up access of commonly-used objects.
  RUN --mount=type=cache,target=/root/.cache/pip \
      pip install intel-openmp
  
  ENV LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4:/usr/local/lib/libiomp5.so:$LD_PRELOAD"
  
  RUN echo 'ulimit -c 0' >> ~/.bashrc
  
  RUN pip install https://intel-extension-for-pytorch.s3.amazonaws.com/ipex_dev/cpu/intel_extension_for_pytorch-2.4.0%2Bgitfbaa4bc-cp310-cp310-linux_x86_64.whl
  
  ENV PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cpu
  RUN --mount=type=cache,target=/root/.cache/pip \
      --mount=type=bind,src=requirements-build.txt,target=requirements-build.txt \
      pip install --upgrade pip && \
      pip install -r requirements-build.txt
  
  FROM cpu-test-1 AS build
  
  WORKDIR /workspace/vllm
  
  RUN --mount=type=cache,target=/root/.cache/pip \
      --mount=type=bind,src=requirements-common.txt,target=requirements-common.txt \
      --mount=type=bind,src=requirements-cpu.txt,target=requirements-cpu.txt \
      pip install -v -r requirements-cpu.txt
  
  COPY ./ ./
  
  # Support for building with non-AVX512 vLLM: docker build --build-arg VLLM_CPU_DISABLE_AVX512="true" ...
  ARG VLLM_CPU_DISABLE_AVX512
  ENV VLLM_CPU_DISABLE_AVX512=${VLLM_CPU_DISABLE_AVX512}
  
  ENV CCACHE_DIR=/root/.cache/ccache
  RUN --mount=type=cache,target=/root/.cache/pip \
      --mount=type=cache,target=/root/.cache/ccache \
      VLLM_TARGET_DEVICE=cpu python3 setup.py bdist_wheel && \
      pip install dist/*.whl
  
  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"]
  
Dockerfile.neuron: # default base image
  ARG BASE_IMAGE="763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-inference-neuronx:2.1.1-neuronx-py310-sdk2.17.0-ubuntu20.04"
  
  FROM $BASE_IMAGE
  
  RUN echo "Base image is $BASE_IMAGE"
  
  # Install some basic utilities
  RUN apt-get update && apt-get install python3 python3-pip -y
  
  ### Mount Point ###
  # When launching the container, mount the code directory to /app
  ARG APP_MOUNT=/app
  VOLUME [ ${APP_MOUNT} ]
  WORKDIR ${APP_MOUNT}
  
  RUN python3 -m pip install --upgrade pip
  RUN python3 -m pip install --no-cache-dir fastapi ninja tokenizers pandas
  RUN python3 -m pip install sentencepiece transformers==4.36.2 -U
  RUN python3 -m pip install transformers-neuronx --extra-index-url=https://pip.repos.neuron.amazonaws.com -U
  RUN python3 -m pip install --pre neuronx-cc==2.12.* --extra-index-url=https://pip.repos.neuron.amazonaws.com -U
  
  COPY ./vllm /app/vllm/vllm
  COPY ./setup.py /app/vllm/setup.py
  COPY ./requirements-common.txt /app/vllm/requirements-common.txt
  COPY ./requirements-neuron.txt /app/vllm/requirements-neuron.txt
  
  RUN cd /app/vllm \
      && python3 -m pip install -U -r requirements-neuron.txt
  
  ENV VLLM_TARGET_DEVICE neuron
  RUN cd /app/vllm \
      && pip install -e . \
      && cd ..
  
  CMD ["/bin/bash"]
  
Dockerfile.tpu: ARG NIGHTLY_DATE="20240726"
  ARG BASE_IMAGE="us-central1-docker.pkg.dev/tpu-pytorch-releases/docker/xla:nightly_3.10_tpuvm_$NIGHTLY_DATE"
  
  FROM $BASE_IMAGE
  WORKDIR /workspace
  
  # Install the TPU and Pallas dependencies.
  RUN python3 -m pip install torch_xla[tpu] -f https://storage.googleapis.com/libtpu-releases/index.html
  RUN python3 -m pip install torch_xla[pallas] -f https://storage.googleapis.com/jax-releases/jax_nightly_releases.html -f https://storage.googleapis.com/jax-releases/jaxlib_nightly_releases.html
  
  # Build vLLM.
  COPY . /workspace/vllm
  ENV VLLM_TARGET_DEVICE="tpu"
  RUN cd /workspace/vllm && python3 -m pip install -r requirements-tpu.txt
  RUN cd /workspace/vllm && python3 setup.py develop
  
  CMD ["/bin/bash"]
  
Dockerfile.openvino: # The vLLM Dockerfile is used to construct vLLM image that can be directly used
  # to run the OpenAI compatible server.
  
  FROM ubuntu:22.04 AS dev
  
  RUN apt-get update -y && \
      apt-get install -y python3-pip git
  WORKDIR /workspace
  
  # copy requirements
  COPY requirements-build.txt /workspace/vllm/
  COPY requirements-common.txt /workspace/vllm/
  COPY requirements-openvino.txt /workspace/vllm/
  
  COPY vllm/ /workspace/vllm/vllm
  COPY csrc/core /workspace/vllm/csrc/core
  COPY cmake/utils.cmake /workspace/vllm/cmake/
  COPY CMakeLists.txt /workspace/vllm/
  COPY setup.py /workspace/vllm/
  
  # install build requirements
  RUN PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu" python3 -m pip install -r /workspace/vllm/requirements-build.txt
  # build vLLM with OpenVINO backend
  RUN PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu" VLLM_TARGET_DEVICE="openvino" python3 -m pip install /workspace/vllm/
  
  COPY examples/ /workspace/vllm/examples
  COPY benchmarks/ /workspace/vllm/benchmarks
  
  CMD ["/bin/bash"]
  
Dockerfile.ppc64le: FROM mambaorg/micromamba
  ARG MAMBA_DOCKERFILE_ACTIVATE=1
  USER root
  
  RUN apt-get update  -y     && apt-get install -y git wget vim numactl gcc-12 g++-12 protobuf-compiler libprotobuf-dev     && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 10 --slave /usr/bin/g++ g++ /usr/bin/g++-12
  
  # Some packages in requirements-cpu are installed here
  # IBM provides optimized packages for ppc64le processors in the open-ce project for mamba
  # Currently these may not be available for venv or pip directly
  RUN micromamba install -y -n base -c https://ftp.osuosl.org/pub/open-ce/1.11.0-p10/ -c defaults     python=3.10     pytorch-cpu=2.1.2     torchvision-cpu=0.16.2    &&     micromamba clean --all --yes
  
  COPY ./ /workspace/vllm
  
  WORKDIR /workspace/vllm
  
  # These packages will be in rocketce eventually
  RUN pip install -v -r requirements-cpu.txt --prefer-binary --extra-index-url https://repo.fury.io/mgiessing
  
  RUN VLLM_TARGET_DEVICE=cpu python3 setup.py install
  
  WORKDIR /vllm-workspace
  ENTRYPOINT ["/opt/conda/bin/python3", "-m", "vllm.entrypoints.openai.api_server"]
  
Dockerfile.xpu: FROM intel/oneapi-basekit:2024.1.0-devel-ubuntu20.04
  
  RUN wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | tee /usr/share/keyrings/intel-oneapi-archive-keyring.gpg > /dev/null && \
      echo "deb [signed-by=/usr/share/keyrings/intel-oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main " | tee /etc/apt/sources.list.d/oneAPI.list && \
      chmod 644 /usr/share/keyrings/intel-oneapi-archive-keyring.gpg && \
      rm /etc/apt/sources.list.d/intel-graphics.list && \
      wget -O- https://repositories.intel.com/graphics/intel-graphics.key | gpg --dearmor | tee /usr/share/keyrings/intel-graphics.gpg > /dev/null && \
      echo "deb [arch=amd64,i386 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/graphics/ubuntu jammy arc" | tee /etc/apt/sources.list.d/intel.gpu.jammy.list && \
      chmod 644 /usr/share/keyrings/intel-graphics.gpg
  
  RUN apt-get update  -y \
  && apt-get install -y curl libicu70 lsb-release git wget vim numactl python3 python3-pip
  
  COPY ./ /workspace/vllm
  
  WORKDIR /workspace/vllm
  
  RUN pip install -v -r requirements-xpu.txt
  
  RUN VLLM_TARGET_DEVICE=xpu python3 setup.py install
  
  CMD ["/bin/bash"]
  