Skip to content

Commit cb136a2

Browse files
Merge pull request vllm-project#48 from Gaohan123/refractor_v2
[Refractor] Dependency refractored to vLLM v0.11.0
2 parents 98273d4 + d7305cc commit cb136a2

38 files changed

+1423
-1736
lines changed

README.md

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ vLLM-omni is built on a modular architecture that extends vLLM's core functional
3838

3939
## 🛠️ Installation
4040

41-
### Installation of vLLM
41+
### Environment setup
4242

4343
Use Docker to keep consistent basic environment (Optional, Recommended)
4444
```bash
45-
docker run --gpus all --ipc=host --network=host -v $source_dir:$container_dir --rm --name $container_name -it nvcr.io/nvidia/pytorch:25.01-py3 bash
45+
docker run --gpus all --ipc=host --network=host -v $source_dir:$container_dir --name $container_name -it nvcr.io/nvidia/pytorch:25.01-py3 bash
4646
```
4747

4848
Set up basic uv environment
@@ -51,23 +51,45 @@ pip install uv
5151
uv venv --python 3.12 --seed
5252
source .venv/bin/activate
5353
```
54-
Install certain version of vllm with commitid: 808a7b69df479b6b3a16181711cac7ca28a9b941
54+
55+
### Installation of vLLM (for users)
56+
57+
Now we build it based on vLLM v0.11.0. Please install it with command below.
58+
```bash
59+
uv pip install vllm==0.11.0 --torch-backend=auto
60+
```
61+
62+
### Installation of vLLM (for developers)
63+
64+
If you want to check or debug with source code of vLLM, install stable release version of vllm with 0.11.0 from source with pre-built wheel file.
5565

5666
```bash
5767
git clone https://github.com/vllm-project/vllm.git
5868
cd vllm
59-
git checkout 808a7b69df479b6b3a16181711cac7ca28a9b941
69+
git checkout v0.11.0
6070
```
6171
Set up environment variables to get pre-built wheels. If there are internet problems, just download the whl file manually. And set VLLM_PRECOMPILED_WHEEL_LOCATION as your local absolute path of whl file.
6272
```bash
63-
export VLLM_COMMIT=808a7b69df479b6b3a16181711cac7ca28a9b941
64-
export VLLM_PRECOMPILED_WHEEL_LOCATION=https://wheels.vllm.ai/${VLLM_COMMIT}/vllm-1.0.0.dev-cp38-abi3-manylinux1_x86_64.whl
73+
export VLLM_PRECOMPILED_WHEEL_LOCATION=https://github.com/vllm-project/vllm/releases/download/v0.11.0/vllm-0.11.0-cp38-abi3-manylinux1_x86_64.whl
6574
```
66-
Install vllm with command below.
75+
Install vllm with command below (If you have no existing PyTorch).
6776
```bash
6877
uv pip install --editable .
6978
```
7079

80+
Install vllm with command below (If you already have PyTorch).
81+
```bash
82+
python use_existing_torch.py
83+
uv pip install -r requirements/build.txt
84+
uv pip install --no-build-isolation --editable .
85+
```
86+
87+
### Verification for successful installation of vLLM
88+
Just run the command below. If no error, it demonstrates that the installation is successfull.
89+
```bash
90+
python -c "import vllm._C"
91+
```
92+
7193
### Installation of vLLM-omni
7294
Install additional requirements for vllm-omni
7395
```bash
@@ -88,11 +110,6 @@ bash run.sh
88110
```
89111
The output audio is saved in ./output_audio
90112

91-
## To-do list
92-
- [x] Offline inference example for Qwen2.5-omni with single request
93-
- [ ] Adaptation from current vllm branch to stable vllm v0.11.0
94-
- [ ] Offline inference example for Qwen2.5-omni with streaming multiple requests
95-
- [ ] Online inference support
96-
- [ ] Support for other models
113+
## Further details
97114

98-
For detailed model management, see [vllm_omni_design.md](docs/architecture/vllm_omni_design.md) and [high_level_arch_design.md](docs/architecture/high_level_arch_design.md).
115+
For detailed architecture design, see [vllm_omni_design.md](docs/architecture/vllm_omni_design.md) and [high_level_arch_design.md](docs/architecture/high_level_arch_design.md).
File renamed without changes.

examples/offline_inference/qwen_2_5_omni/README.md

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
## 🛠️ Installation
44

5-
### Installation of vLLM
5+
### Environment setup
66

77
Use Docker to keep consistent basic environment (Optional, Recommended)
88
```bash
9-
docker run --gpus all --ipc=host --network=host -v $source_dir:$container_dir --rm --name $container_name -it nvcr.io/nvidia/pytorch:25.01-py3 bash
9+
docker run --gpus all --ipc=host --network=host -v $source_dir:$container_dir --name $container_name -it nvcr.io/nvidia/pytorch:25.01-py3 bash
1010
```
1111

1212
Set up basic uv environment
@@ -15,23 +15,45 @@ pip install uv
1515
uv venv --python 3.12 --seed
1616
source .venv/bin/activate
1717
```
18-
Install certain version of vllm with commitid: 808a7b69df479b6b3a16181711cac7ca28a9b941
18+
19+
### Installation of vLLM (for users)
20+
21+
Now we build it based on vLLM v0.11.0. Please install it with command below.
22+
```bash
23+
uv pip install vllm==0.11.0 --torch-backend=auto
24+
```
25+
26+
### Installation of vLLM (for developers)
27+
28+
If you want to check or debug with source code of vLLM, install stable release version of vllm with 0.11.0 from source with pre-built wheel file.
1929

2030
```bash
2131
git clone https://github.com/vllm-project/vllm.git
2232
cd vllm
23-
git checkout 808a7b69df479b6b3a16181711cac7ca28a9b941
33+
git checkout v0.11.0
2434
```
2535
Set up environment variables to get pre-built wheels. If there are internet problems, just download the whl file manually. And set VLLM_PRECOMPILED_WHEEL_LOCATION as your local absolute path of whl file.
2636
```bash
27-
export VLLM_COMMIT=808a7b69df479b6b3a16181711cac7ca28a9b941
28-
export VLLM_PRECOMPILED_WHEEL_LOCATION=https://wheels.vllm.ai/${VLLM_COMMIT}/vllm-1.0.0.dev-cp38-abi3-manylinux1_x86_64.whl
37+
export VLLM_PRECOMPILED_WHEEL_LOCATION=https://github.com/vllm-project/vllm/releases/download/v0.11.0/vllm-0.11.0-cp38-abi3-manylinux1_x86_64.whl
2938
```
30-
Install vllm with command below.
39+
Install vllm with command below (If you have no existing PyTorch).
3140
```bash
3241
uv pip install --editable .
3342
```
3443

44+
Install vllm with command below (If you already have PyTorch).
45+
```bash
46+
python use_existing_torch.py
47+
uv pip install -r requirements/build.txt
48+
uv pip install --no-build-isolation --editable .
49+
```
50+
51+
### Verification for successful installation of vLLM
52+
Just run the command below. If no error, it demonstrates that the installation is successfull.
53+
```bash
54+
python -c "import vllm._C"
55+
```
56+
3557
### Installation of vLLM-omni
3658
Install additional requirements for vllm-omni
3759
```bash
@@ -51,10 +73,3 @@ Modify PYTHONPATH in run.sh as your path of vllm_omni. Then run.
5173
bash run.sh
5274
```
5375
The output audio is saved in ./output_audio
54-
55-
## To-do list
56-
- [x] Offline inference example for Qwen2.5-omni with single request
57-
- [ ] Adaptation from current vllm branch to stable vllm v0.11.0
58-
- [ ] Offline inference example for Qwen2.5-omni with streaming multiple requests
59-
- [ ] Online inference support
60-
- [ ] Support for other models

examples/offline_inference/qwen_2_5_omni/end2end.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import soundfile as sf
88
import torch
99
from utils import make_omni_prompt
10-
from vllm.sampling_params import SamplingParams
1110

11+
from vllm.sampling_params import SamplingParams
1212
from vllm_omni.entrypoints.omni_llm import OmniLLM
1313

1414
_os_env_toggle.environ["VLLM_USE_V1"] = "1"

examples/offline_inference/qwen_2_5_omni/run.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export PYTHONPATH=/path/to/vllm-omni:$PYTHONPATH
2-
export HF_ENDPOINT=https://hf-mirror.com
32
python end2end.py --model Qwen/Qwen2.5-Omni-7B \
43
--prompts "Explain the system architecture for a scalable audio generation pipeline. Answer in 15 words." \
54
--voice-type "m02" \

examples/offline_inference/qwen_2_5_omni/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
import torch
1010
import torchvision.io
1111
from processing_omni import fetch_image, fetch_video
12-
from vllm.inputs import TextPrompt
1312

13+
from vllm.inputs import TextPrompt
1414
from vllm_omni.inputs.data import OmniTokensPrompt
1515

1616

requirements.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
1-
cloudpickle==3.1.1
2-
msgspec==0.19.0
3-
numpy==2.3.4
41
omegaconf==2.3.0
5-
pydantic==2.12.3
6-
transformers==4.57.0
7-
typing_extensions==4.15.0
82
decord==0.6.0
93
librosa==0.11.0
10-
packaging==25.0
11-
Pillow==12.0.0
12-
Requests==2.32.5
134
resampy==0.4.3
14-
soundfile==0.13.1

vllm_omni/config/__init__.py

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,7 @@
22
Configuration module for vLLM-omni.
33
"""
44

5-
from typing import Optional
6-
7-
from pydantic import ConfigDict
8-
from pydantic.dataclasses import dataclass
9-
from vllm.config import ModelConfig, config
10-
11-
import vllm_omni.model_executor.models as me_models
12-
13-
14-
@config
15-
@dataclass(config=ConfigDict(arbitrary_types_allowed=True))
16-
class OmniModelConfig(ModelConfig):
17-
"""Configuration for Omni models, extending the base ModelConfig."""
18-
19-
stage_id: int = 0
20-
model_stage: str = "thinker"
21-
model_arch: str = "Qwen2_5OmniForConditionalGeneration"
22-
engine_output_type: Optional[str] = None
23-
24-
@property
25-
def registry(self):
26-
return me_models.OmniModelRegistry
27-
28-
@property
29-
def architectures(self) -> list[str]:
30-
return [self.model_arch]
31-
5+
from vllm_omni.config.model import OmniModelConfig
326

337
__all__ = [
348
"OmniModelConfig",

vllm_omni/config/model.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from typing import Optional
2+
3+
from pydantic import ConfigDict
4+
from pydantic.dataclasses import dataclass
5+
6+
import vllm_omni.model_executor.models as me_models
7+
from vllm.config import ModelConfig, config
8+
9+
10+
@config
11+
@dataclass(config=ConfigDict(arbitrary_types_allowed=True))
12+
class OmniModelConfig(ModelConfig):
13+
"""Configuration for Omni models, extending the base ModelConfig."""
14+
15+
stage_id: int = 0
16+
model_stage: str = "thinker"
17+
model_arch: str = "Qwen2_5OmniForConditionalGeneration"
18+
engine_output_type: Optional[str] = None
19+
20+
@property
21+
def registry(self):
22+
return me_models.OmniModelRegistry
23+
24+
@property
25+
def architectures(self) -> list[str]:
26+
return [self.model_arch]

0 commit comments

Comments
 (0)