installation.rst 2.19 KB
Newer Older
Zhuohan Li's avatar
Zhuohan Li committed
1
2
.. _installation:

Woosuk Kwon's avatar
Woosuk Kwon committed
3
4
5
Installation
============

6
vLLM is a Python library that also contains pre-compiled C++ and CUDA (12.1) binaries.
7
8
9

Requirements
------------
10
11

* OS: Linux
12
* Python: 3.8 -- 3.11
13
* GPU: compute capability 7.0 or higher (e.g., V100, T4, RTX20xx, A100, L4, H100, etc.)
14
15
16
17

Install with pip
----------------

Woosuk Kwon's avatar
Woosuk Kwon committed
18
You can install vLLM using pip:
19
20
21
22

.. code-block:: console

    $ # (Optional) Create a new conda environment.
23
    $ conda create -n myenv python=3.9 -y
24
25
    $ conda activate myenv

26
    $ # Install vLLM with CUDA 12.1.
27
    $ pip install vllm
28

29
30
31
32
33
34
35
36
.. note::

    As of now, vLLM's binaries are compiled on CUDA 12.1 by default.
    However, you can install vLLM with CUDA 11.8 by running:

    .. code-block:: console

        $ # Install vLLM with CUDA 11.8.
37
38
39
        $ export VLLM_VERSION=0.2.4
        $ export PYTHON_VERSION=39
        $ pip install https://github.com/vllm-project/vllm/releases/download/v${VLLM_VERSION}/vllm-${VLLM_VERSION}+cu118-cp${PYTHON_VERSION}-cp${PYTHON_VERSION}-manylinux1_x86_64.whl
40
41
42
43
44

        $ # Re-install PyTorch with CUDA 11.8.
        $ pip uninstall torch -y
        $ pip install torch --upgrade --index-url https://download.pytorch.org/whl/cu118

45
46
47
48
        $ # Re-install xFormers with CUDA 11.8.
        $ pip uninstall xformers -y
        $ pip install --upgrade xformers --index-url https://download.pytorch.org/whl/cu118

49
50
51

.. _build_from_source:

Woosuk Kwon's avatar
Woosuk Kwon committed
52
53
54
Build from source
-----------------

55
You can also build and install vLLM from source:
56

Woosuk Kwon's avatar
Woosuk Kwon committed
57
58
.. code-block:: console

59
    $ git clone https://github.com/vllm-project/vllm.git
Woosuk Kwon's avatar
Woosuk Kwon committed
60
    $ cd vllm
61
    $ pip install -e .  # This may take 5-10 minutes.
62
63
64
65
66
67

.. tip::
    If you have trouble building vLLM, we recommend using the NVIDIA PyTorch Docker image.

    .. code-block:: console

68
        $ # Use `--ipc=host` to make sure the shared memory is large enough.
69
        $ docker run --gpus all -it --rm --ipc=host nvcr.io/nvidia/pytorch:23.10-py3
70
71
72
73
74
75
76
77
78
79

.. note::
    If you are developing the C++ backend of vLLM, consider building vLLM with

    .. code-block:: console

        $ python setup.py develop

    since it will give you incremental builds. The downside is that this method
    is `deprecated by setuptools <https://github.com/pypa/setuptools/issues/917>`_.