Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
8711bc5e
Unverified
Commit
8711bc5e
authored
Jun 04, 2025
by
Isotr0py
Committed by
GitHub
Jun 04, 2025
Browse files
[Misc] Add packages for benchmark as extra dependency (#19089)
Signed-off-by:
Isotr0py
<
2037008807@qq.com
>
parent
2669a0d7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
22 deletions
+20
-22
docs/cli/README.md
docs/cli/README.md
+2
-0
setup.py
setup.py
+1
-0
vllm/benchmarks/datasets.py
vllm/benchmarks/datasets.py
+17
-22
No files found.
docs/cli/README.md
View file @
8711bc5e
...
...
@@ -77,6 +77,8 @@ vllm complete --quick "The future of AI is"
Run benchmark tests for latency online serving throughput and offline inference throughput.
To use benchmark commands, please install with extra dependencies using
`pip install vllm[bench]`
.
Available Commands:
```
bash
...
...
setup.py
View file @
8711bc5e
...
...
@@ -688,6 +688,7 @@ setup(
ext_modules
=
ext_modules
,
install_requires
=
get_requirements
(),
extras_require
=
{
"bench"
:
[
"pandas"
,
"datasets"
],
"tensorizer"
:
[
"tensorizer>=2.9.0"
],
"fastsafetensors"
:
[
"fastsafetensors >= 0.1.10"
],
"runai"
:
[
"runai-model-streamer"
,
"runai-model-streamer-s3"
,
"boto3"
],
...
...
vllm/benchmarks/datasets.py
View file @
8711bc5e
...
...
@@ -24,7 +24,6 @@ from io import BytesIO
from
typing
import
Any
,
Callable
,
Optional
,
Union
import
numpy
as
np
import
pandas
as
pd
from
PIL
import
Image
from
transformers
import
PreTrainedTokenizerBase
...
...
@@ -33,6 +32,23 @@ from vllm.lora.utils import get_adapter_absolute_path
from
vllm.multimodal
import
MultiModalDataDict
from
vllm.multimodal.image
import
convert_image_mode
from
vllm.transformers_utils.tokenizer
import
AnyTokenizer
,
get_lora_tokenizer
from
vllm.utils
import
PlaceholderModule
try
:
from
datasets
import
load_dataset
except
ImportError
:
datasets
=
PlaceholderModule
(
"datasets"
)
load_dataset
=
datasets
.
placeholder_attr
(
"load_dataset"
)
try
:
import
pandas
as
pd
except
ImportError
:
pd
=
PlaceholderModule
(
"pandas"
)
try
:
import
librosa
except
ImportError
:
librosa
=
PlaceholderModule
(
"librosa"
)
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -636,13 +652,6 @@ class BurstGPTDataset(BenchmarkDataset):
if
self
.
dataset_path
is
None
:
raise
ValueError
(
"dataset_path must be provided for loading data."
)
try
:
import
pandas
as
pd
except
ImportError
as
e
:
raise
ImportError
(
"Pandas is required for BurstGPTDataset. Please install it "
"using `pip install pandas`."
)
from
e
df
=
pd
.
read_csv
(
self
.
dataset_path
)
# Filter to keep only GPT-4 rows.
gpt4_df
=
df
[
df
[
"Model"
]
==
"GPT-4"
]
...
...
@@ -717,13 +726,6 @@ class HuggingFaceDataset(BenchmarkDataset):
def
load_data
(
self
)
->
None
:
"""Load data from HuggingFace datasets."""
try
:
from
datasets
import
load_dataset
except
ImportError
as
e
:
raise
ImportError
(
"Hugging Face datasets library is required for this dataset. "
"Please install it using `pip install datasets`."
)
from
e
self
.
data
=
load_dataset
(
self
.
dataset_path
,
name
=
self
.
dataset_subset
,
...
...
@@ -1147,13 +1149,6 @@ class ASRDataset(HuggingFaceDataset):
output_len
:
Optional
[
int
]
=
None
,
**
kwargs
,
)
->
list
:
try
:
import
librosa
except
ImportError
as
e
:
raise
ImportError
(
"librosa is required for ASRDataset. Please install it "
"using `pip install librosa`."
)
from
e
output_len
=
(
output_len
if
output_len
is
not
None
else
self
.
DEFAULT_OUTPUT_LEN
)
prompt
=
ASRDataset
.
TRANSCRIPTION_PREAMBLE
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment