@@ -40,6 +40,82 @@ If vLLM successfully returns text (for generative models) or hidden states (for
...
@@ -40,6 +40,82 @@ If vLLM successfully returns text (for generative models) or hidden states (for
Otherwise, please refer to [Adding a New Model](#new-model) for instructions on how to implement your model in vLLM.
Otherwise, please refer to [Adding a New Model](#new-model) for instructions on how to implement your model in vLLM.
Alternatively, you can [open an issue on GitHub](https://github.com/vllm-project/vllm/issues/new/choose) to request vLLM support.
Alternatively, you can [open an issue on GitHub](https://github.com/vllm-project/vllm/issues/new/choose) to request vLLM support.
### Transformers fallback
After the merge of <gh-pr:11330>, `vllm` can fallback to models that are available in `transformers`. This does not work for all models for now, but most decoder language models are supported, and vision language model support is planned!
To check if the backend is `transformers`, you can simply do this:
```python
fromvllmimportLLM
llm=LLM(model=...,task="generate")# Name or path of your model
If it is `TransformersModel` then it means it's based on `transformers`!
#### Supported features
##### LORA and quantization
Both are not supported yet! Make sure to open an issue and we'll work on this together with the `transformers` team!
Usually `transformers` model load weights via the `load_adapters` API, that depends on PEFT. We need to work a bit to either use this api (for now this would result in some weights not being marked as loaded) or replace modules accordingly.
Blocker is that you need to specify supported lora layers, when we would ideally want to load whatever is inside the checkpoint!
##### Remote code
This fallback also means that any model on the hub that can be used in `transformers` with `trust_remote_code=True` that correctly implements attention can be used in production!
```python
fromvllmimportLLM
llm=LLM(model=...,task="generate",trust_remote_code=True)# Name or path of your model
2.`MyModel` python class is loaded from the `auto_map`, and we check that the model `_supports_attention_backend`.
3. The `TransformersModel` backend is used. See `/model_executors/models/transformers`, which leverage `self.config._attn_implementation = "vllm"`, thus the need to use `ALL_ATTENTION_FUNCTION`.
That's it!
### ModelScope
### ModelScope
To use models from [ModelScope](https://www.modelscope.cn) instead of HuggingFace Hub, set an environment variable:
To use models from [ModelScope](https://www.modelscope.cn) instead of HuggingFace Hub, set an environment variable:
...
@@ -650,14 +726,14 @@ See [this page](#generative-models) for more information on how to use generativ
...
@@ -650,14 +726,14 @@ See [this page](#generative-models) for more information on how to use generativ
*`h2oai/h2ovl-mississippi-800m`, `h2oai/h2ovl-mississippi-2b`, etc.
*`h2oai/h2ovl-mississippi-800m`, `h2oai/h2ovl-mississippi-2b`, etc.
*
*
* ✅︎
* ✅︎
*
*\*
-*`Idefics3ForConditionalGeneration`
-*`Idefics3ForConditionalGeneration`
* Idefics3
* Idefics3
* T + I
* T + I
*`HuggingFaceM4/Idefics3-8B-Llama3` etc.
*`HuggingFaceM4/Idefics3-8B-Llama3` etc.
* ✅︎
* ✅︎
*
*
*
* ✅︎
-*`InternVLChatModel`
-*`InternVLChatModel`
* InternVL 2.5, Mono-InternVL, InternVL 2.0
* InternVL 2.5, Mono-InternVL, InternVL 2.0
* T + I<sup>E+</sup>
* T + I<sup>E+</sup>
...
@@ -723,7 +799,7 @@ See [this page](#generative-models) for more information on how to use generativ
...
@@ -723,7 +799,7 @@ See [this page](#generative-models) for more information on how to use generativ
* ✅︎
* ✅︎
-*`NVLM_D_Model`
-*`NVLM_D_Model`
* NVLM-D 1.0
* NVLM-D 1.0
* T + I<sup>E+</sup>
* T + I<sup>+</sup>
*`nvidia/NVLM-D-72B`, etc.
*`nvidia/NVLM-D-72B`, etc.
*
*
* ✅︎
* ✅︎
...
@@ -770,11 +846,18 @@ See [this page](#generative-models) for more information on how to use generativ
...
@@ -770,11 +846,18 @@ See [this page](#generative-models) for more information on how to use generativ
* ✅︎
* ✅︎
* ✅︎
* ✅︎
* ✅︎
* ✅︎
-*`Qwen2_5_VLForConditionalGeneration`
* Qwen2.5-VL
* T + I<sup>E+</sup> + V<sup>E+</sup>
*`Qwen/Qwen2.5-VL-3B-Instruct`, `Qwen/Qwen2.5-VL-72B-Instruct`, etc.
*
* ✅︎
* ✅︎
-*`UltravoxModel`
-*`UltravoxModel`
* Ultravox
* Ultravox
* T + A<sup>E+</sup>
* T + A<sup>E+</sup>
*`fixie-ai/ultravox-v0_3`
*`fixie-ai/ultravox-v0_3`
*
* ✅︎
* ✅︎
* ✅︎
* ✅︎
* ✅︎
:::
:::
...
@@ -783,7 +866,11 @@ See [this page](#generative-models) for more information on how to use generativ
...
@@ -783,7 +866,11 @@ See [this page](#generative-models) for more information on how to use generativ
<sup>+</sup> Multiple items can be inputted per text prompt for this modality.
<sup>+</sup> Multiple items can be inputted per text prompt for this modality.
:::{note}
:::{note}
To use `DeepSeek-VL2` series models, you have to pass `--hf_overrides '{"architectures": ["DeepseekVLV2ForCausalLM"]}'` when running vLLM.
To use DeepSeek-VL2 series models, you have to pass `--hf_overrides '{"architectures": ["DeepseekVLV2ForCausalLM"]}'` when running vLLM.
:::
:::{note}
H2O-VL series models will be available in V1 once we support backends other than FlashAttention.
:::
:::
:::{note}
:::{note}
...
@@ -796,8 +883,11 @@ For more details, please see: <gh-pr:4087#issuecomment-2250397630>
...
@@ -796,8 +883,11 @@ For more details, please see: <gh-pr:4087#issuecomment-2250397630>
:::
:::
:::{note}
:::{note}
The chat template for Pixtral-HF is incorrect (see [discussion](https://huggingface.co/mistral-community/pixtral-12b/discussions/22)).
`mistral-community/pixtral-12b` does not support V1 yet.
A corrected version is available at <gh-file:examples/template_pixtral_hf.jinja>.
:::
:::{note}
To use Qwen2.5-VL series models, you have to install Huggingface `transformers` library from source via `pip install git+https://github.com/huggingface/transformers`.
On the rest of the worker nodes, run the following command:
On the rest of the worker nodes, run the following command:
...
@@ -70,10 +71,11 @@ bash run_cluster.sh \
...
@@ -70,10 +71,11 @@ bash run_cluster.sh \
vllm/vllm-openai \
vllm/vllm-openai \
ip_of_head_node \
ip_of_head_node \
--worker \
--worker \
/path/to/the/huggingface/home/in/this/node
/path/to/the/huggingface/home/in/this/node \
-e VLLM_HOST_IP=ip_of_this_node
```
```
Then you get a ray cluster of containers. Note that you need to keep the shells running these commands alive to hold the cluster. Any shell disconnect will terminate the cluster. In addition, please note that the argument `ip_of_head_node` should be the IP address of the head node, which is accessible by all the worker nodes. A common misunderstanding is to use the IP address of the worker node, which is not correct.
Then you get a ray cluster of containers. Note that you need to keep the shells running these commands alive to hold the cluster. Any shell disconnect will terminate the cluster. In addition, please note that the argument `ip_of_head_node` should be the IP address of the head node, which is accessible by all the worker nodes. The IP addresses of each worker node should be specified in the `VLLM_HOST_IP` environment variable, and should be different for each worker node. Please check the network configuration of your cluster to make sure the nodes can communicate with each other through the specified IP addresses.
Then, on any node, use `docker exec -it node /bin/bash` to enter the container, execute `ray status` to check the status of the Ray cluster. You should see the right number of nodes and GPUs.
Then, on any node, use `docker exec -it node /bin/bash` to enter the container, execute `ray status` to check the status of the Ray cluster. You should see the right number of nodes and GPUs.
...
@@ -103,3 +105,7 @@ Please make sure you downloaded the model to all the nodes (with the same path),
...
@@ -103,3 +105,7 @@ Please make sure you downloaded the model to all the nodes (with the same path),
When you use huggingface repo id to refer to the model, you should append your huggingface token to the `run_cluster.sh` script, e.g. `-e HF_TOKEN=`. The recommended way is to download the model first, and then use the path to refer to the model.
When you use huggingface repo id to refer to the model, you should append your huggingface token to the `run_cluster.sh` script, e.g. `-e HF_TOKEN=`. The recommended way is to download the model first, and then use the path to refer to the model.
:::
:::
:::{warning}
If you keep receiving the error message `Error: No available node types can fulfill resource request` but you have enough GPUs in the cluster, chances are your nodes have multiple IP addresses and vLLM cannot find the right one, especially when you are using multi-node inference. Please make sure vLLM and ray use the same IP address. You can set the `VLLM_HOST_IP` environment variable to the right IP address in the `run_cluster.sh` script (different for each node!), and check `ray status` to see the IP address used by Ray. See <gh-issue:7815> for more information.