Skip to content

Commit 73488d2

Browse files
committed
doc: clarify new python-only build options
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
1 parent 26de25d commit 73488d2

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

docs/getting_started/installation/cpu.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ For example, the nightly build index is: `https://wheels.vllm.ai/nightly/cpu/`.
5353

5454
### Build wheel from source
5555

56+
#### Set up using Python-only build (without compilation) {#python-only-build}
57+
58+
Please refer to the instructions for [Python-only build on GPU](./gpu.md#python-only-build), and replace the build commands with:
59+
60+
```bash
61+
VLLM_USE_PRECOMPILED=1 VLLM_PRECOMPILED_WHEEL_VARIANT=cpu VLLM_TARGET_DEVICE=cpu uv pip install --editable .
62+
```
63+
64+
#### Full build (with compilation) {#full-build}
65+
5666
=== "Intel/AMD x86"
5767

5868
--8<-- "docs/getting_started/installation/cpu.x86.inc.md:build-wheel-from-source"

docs/getting_started/installation/gpu.cuda.inc.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ uv pip install vllm \
8484
# --8<-- [end:pre-built-wheels]
8585
# --8<-- [start:build-wheel-from-source]
8686

87-
#### Set up using Python-only build (without compilation)
87+
#### Set up using Python-only build (without compilation) {#python-only-build}
8888

8989
If you only need to change Python code, you can build and install vLLM without compilation. Using `uv pip`'s [`--editable` flag](https://docs.astral.sh/uv/pip/packages/#editable-packages), changes you make to the code will be reflected when you run vLLM:
9090

@@ -108,18 +108,24 @@ This command will do the following:
108108
In case you see an error about wheel not found when running the above command, it might be because the commit you based on in the main branch was just merged and the wheel is being built. In this case, you can wait for around an hour to try again, or manually assign the previous commit in the installation using the `VLLM_PRECOMPILED_WHEEL_LOCATION` environment variable.
109109

110110
```bash
111-
export VLLM_COMMIT=72d9c316d3f6ede485146fe5aabd4e61dbc59069 # use full commit hash from the main branch
112-
export VLLM_PRECOMPILED_WHEEL_LOCATION=https://wheels.vllm.ai/${VLLM_COMMIT}/vllm-1.0.0.dev-cp38-abi3-manylinux1_x86_64.whl
111+
export VLLM_PRECOMPILED_WHEEL_COMIMT=$(git rev-parse HEAD~1) # or earlier commit on main
112+
export VLLM_USE_PRECOMPILED=1
113113
uv pip install --editable .
114114
```
115115

116+
There are more environment variables to control the behavior of Python-only build:
117+
118+
* `VLLM_PRECOMPILED_WHEEL_LOCATION`: specify the exact wheel URL or local file path of a pre-compiled wheel to use. All other logic to find the wheel will be skipped.
119+
* `VLLM_PRECOMPILED_WHEEL_COMMIT`: override the commit hash to download the pre-compiled wheel. It can be `nightly` to use the last **already built** commit on the main branch.
120+
* `VLLM_PRECOMPILED_WHEEL_VARIANT`: specify the variant subdirectory to use on the nightly index, e.g., `cu129`, `cpu`. If not specified, the CUDA variant with `VLLM_MAIN_CUDA_VERSION` will be tried, then fallback to the default variant on the remote index.
121+
116122
You can find more information about vLLM's wheels in [Install the latest code](#install-the-latest-code).
117123

118124
!!! note
119125
There is a possibility that your source code may have a different commit ID compared to the latest vLLM wheel, which could potentially lead to unknown errors.
120126
It is recommended to use the same commit ID for the source code as the vLLM wheel you have installed. Please refer to [Install the latest code](#install-the-latest-code) for instructions on how to install a specified wheel.
121127

122-
#### Full build (with compilation)
128+
#### Full build (with compilation) {#full-build}
123129

124130
If you want to modify C++ or CUDA code, you'll need to build vLLM from source. This can take several minutes:
125131

docs/getting_started/installation/gpu.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ vLLM is a Python library that supports the following GPU variants. Select your G
5252

5353
--8<-- "docs/getting_started/installation/gpu.xpu.inc.md:set-up-using-python"
5454

55-
### Pre-built wheels
55+
### Pre-built wheels {#pre-built-wheels}
5656

5757
=== "NVIDIA CUDA"
5858

0 commit comments

Comments
 (0)