Unverified Commit 2dd359f9 authored by Maryam Tahhan's avatar Maryam Tahhan Committed by GitHub
Browse files

[Docs] Simplify CPU x86 Docker build documentation (#33071)


Signed-off-by: default avatarMaryam Tahhan <mtahhan@redhat.com>
parent 22ad6495
...@@ -171,10 +171,6 @@ uv pip install dist/*.whl ...@@ -171,10 +171,6 @@ uv pip install dist/*.whl
## Building for your target CPU ## Building for your target CPU
vLLM supports building Docker images for x86 CPU platforms with automatic instruction set detection.
### Basic build command
```bash ```bash
docker build -f docker/Dockerfile.cpu \ docker build -f docker/Dockerfile.cpu \
--build-arg VLLM_CPU_DISABLE_AVX512=<false (default)|true> \ --build-arg VLLM_CPU_DISABLE_AVX512=<false (default)|true> \
...@@ -187,29 +183,21 @@ docker build -f docker/Dockerfile.cpu \ ...@@ -187,29 +183,21 @@ docker build -f docker/Dockerfile.cpu \
--target vllm-openai . --target vllm-openai .
``` ```
!!! note "Instruction set auto-detection" !!! note "Auto-detection by default"
By default, vLLM will auto-detect CPU instruction sets (AVX512, AVX2, etc.) from the build system's CPU flags. Build arguments like `VLLM_CPU_AVX2`, `VLLM_CPU_AVX512`, `VLLM_CPU_AVX512BF16`, `VLLM_CPU_AVX512VNNI`, and `VLLM_CPU_AMXBF16` are primarily used for **cross-compilation** or for building container images on systems that don't have the target platforms ISA: By default, CPU instruction sets (AVX512, AVX2, etc.) are automatically detected from the build system's CPU flags. Build arguments like `VLLM_CPU_AVX2`, `VLLM_CPU_AVX512`, `VLLM_CPU_AVX512BF16`, `VLLM_CPU_AVX512VNNI`, and `VLLM_CPU_AMXBF16` are used for cross-compilation:
- Set `VLLM_CPU_{ISA}=true` to force-enable an instruction set (for cross-compilation to target platforms with that ISA) - `VLLM_CPU_{ISA}=true` - Force-enable the instruction set (build with ISA regardless of build system capabilities)
- Set `VLLM_CPU_{ISA}=false` to rely on auto-detection - `VLLM_CPU_{ISA}=false` - Rely on auto-detection (default)
- When an ISA build arg is set to `true`, vLLM will build with that instruction set regardless of the build system's CPU capabilities
### Build examples ### Examples
**Example 1: Auto-detection (native build)** **Auto-detection build (default)**
Build on a machine with the same CPU as your target deployment:
```bash ```bash
# Auto-detects all CPU features from the build system docker build -f docker/Dockerfile.cpu --tag vllm-cpu-env --target vllm-openai .
docker build -f docker/Dockerfile.cpu \
--tag vllm-cpu-env \
--target vllm-openai .
``` ```
**Example 2: Cross-compilation for AVX512 deployment** **Cross-compile for AVX512**
Build an AVX512 image on any x86_64 system (even without AVX512):
```bash ```bash
docker build -f docker/Dockerfile.cpu \ docker build -f docker/Dockerfile.cpu \
...@@ -220,9 +208,7 @@ docker build -f docker/Dockerfile.cpu \ ...@@ -220,9 +208,7 @@ docker build -f docker/Dockerfile.cpu \
--target vllm-openai . --target vllm-openai .
``` ```
**Example 3: Cross-compilation for AVX2 deployment** **Cross-compile for AVX2**
Build an AVX2 image for older CPUs:
```bash ```bash
docker build -f docker/Dockerfile.cpu \ docker build -f docker/Dockerfile.cpu \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment