Skip to content

Commit d250e4b

Browse files
authored
TRL supports vLLM 0.11 (huggingface#4633)
1 parent 3979ccc commit d250e4b

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

docs/source/vllm_integration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This document will guide you through the process of using vLLM with TRL for faster generation in online methods like GRPO and Online DPO. We first summarize a tl;dr on how to use vLLM with TRL, and then we will go into the details of how it works under the hood.
44

55
> [!WARNING]
6-
> TRL currently only supports vLLM version `0.10.2`. Please ensure you have this version installed to avoid compatibility issues.
6+
> TRL currently only supports vLLM versions `0.10.2`, `0.11.0`, `0.11.1`, and `0.11.2`. Please ensure you have one of these versions installed to avoid compatibility issues.
77
88
> [!TIP]
99
> The following trainers currently support generation with vLLM:

examples/notebooks/openenv_wordle_grpo.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"metadata": {},
5555
"outputs": [],
5656
"source": [
57-
"!pip install -Uq git+https://github.com/huggingface/trl.git git+https://github.com/meta-pytorch/OpenEnv.git trackio vllm==0.10.2 bitsandbytes"
57+
"!pip install -Uq git+https://github.com/huggingface/trl.git git+https://github.com/meta-pytorch/OpenEnv.git trackio vllm==0.11.2 bitsandbytes"
5858
]
5959
},
6060
{
@@ -1590,4 +1590,4 @@
15901590
},
15911591
"nbformat": 4,
15921592
"nbformat_minor": 5
1593-
}
1593+
}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ test = [
7878
"pytest"
7979
]
8080
vllm = [
81-
"vllm==0.10.2",
81+
"vllm>=0.10.2,<0.12.0",
8282
"fastapi",
8383
"pydantic",
8484
"requests",

trl/import_utils.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,14 @@ def is_uvicorn_available() -> bool:
8888

8989

9090
def is_vllm_available() -> bool:
91-
if _vllm_available and version.parse(_vllm_version) != version.parse("0.10.2"):
92-
warnings.warn(
93-
f"TRL currently only supports vLLM version `0.10.2`. You have version {_vllm_version} installed. We "
94-
"recommend to install this version to avoid compatibility issues.",
95-
stacklevel=2,
96-
)
91+
if _vllm_available:
92+
if not (version.parse("0.10.2") <= version.parse(_vllm_version) <= version.parse("0.11.2")):
93+
warnings.warn(
94+
"TRL currently supports vLLM versions: 0.10.2, 0.11.0, 0.11.1, 0.11.2. You have version "
95+
f"{_vllm_version} installed. We recommend installing a supported version to avoid compatibility "
96+
"issues.",
97+
stacklevel=2,
98+
)
9799
return _vllm_available
98100

99101

0 commit comments

Comments
 (0)