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
8f7bace7
Unverified
Commit
8f7bace7
authored
Apr 22, 2025
by
Cyrus Leung
Committed by
GitHub
Apr 22, 2025
Browse files
[Doc] Improve documentation for multimodal CLI args (#16960)
Signed-off-by:
DarkLight1337
<
tlleungac@connect.ust.hk
>
parent
e4d61442
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
10 deletions
+17
-10
vllm/config.py
vllm/config.py
+9
-4
vllm/engine/arg_utils.py
vllm/engine/arg_utils.py
+8
-6
No files found.
vllm/config.py
View file @
8f7bace7
...
@@ -54,13 +54,15 @@ if TYPE_CHECKING:
...
@@ -54,13 +54,15 @@ if TYPE_CHECKING:
from
vllm.transformers_utils.tokenizer_group.base_tokenizer_group
import
(
from
vllm.transformers_utils.tokenizer_group.base_tokenizer_group
import
(
BaseTokenizerGroup
)
BaseTokenizerGroup
)
Config
=
T
ype
Var
(
"Config"
,
bound
=
DataclassInstance
)
Config
Type
=
t
ype
[
DataclassInstance
]
else
:
else
:
QuantizationConfig
=
None
QuantizationConfig
=
None
Config
=
T
ype
Var
(
"Config"
)
Config
Type
=
t
ype
logger
=
init_logger
(
__name__
)
logger
=
init_logger
(
__name__
)
ConfigT
=
TypeVar
(
"ConfigT"
,
bound
=
ConfigType
)
# This value is chosen to have a balance between ITL and TTFT. Note it is
# This value is chosen to have a balance between ITL and TTFT. Note it is
# not optimized for throughput.
# not optimized for throughput.
_DEFAULT_MAX_NUM_BATCHED_TOKENS
=
2048
_DEFAULT_MAX_NUM_BATCHED_TOKENS
=
2048
...
@@ -162,7 +164,7 @@ def get_attr_docs(cls: type[Any]) -> dict[str, str]:
...
@@ -162,7 +164,7 @@ def get_attr_docs(cls: type[Any]) -> dict[str, str]:
return
out
return
out
def
config
(
cls
:
type
[
Config
]
)
->
type
[
Config
]
:
def
config
(
cls
:
Config
T
)
->
Config
T
:
"""
"""
A decorator that ensures all fields in a dataclass have default values
A decorator that ensures all fields in a dataclass have default values
and that each field has a docstring.
and that each field has a docstring.
...
@@ -181,7 +183,7 @@ def config(cls: type[Config]) -> type[Config]:
...
@@ -181,7 +183,7 @@ def config(cls: type[Config]) -> type[Config]:
return
cls
return
cls
def
get_field
(
cls
:
type
[
Config
]
,
name
:
str
)
->
Field
:
def
get_field
(
cls
:
Config
Type
,
name
:
str
)
->
Field
:
"""Get the default factory field of a dataclass by name. Used for getting
"""Get the default factory field of a dataclass by name. Used for getting
default factory fields in `EngineArgs`."""
default factory fields in `EngineArgs`."""
if
not
is_dataclass
(
cls
):
if
not
is_dataclass
(
cls
):
...
@@ -2749,6 +2751,9 @@ class MultiModalConfig:
...
@@ -2749,6 +2751,9 @@ class MultiModalConfig:
The maximum number of input items allowed per prompt for each modality.
The maximum number of input items allowed per prompt for each modality.
This should be a JSON string that will be parsed into a dictionary.
This should be a JSON string that will be parsed into a dictionary.
Defaults to 1 (V0) or 999 (V1) for each modality.
Defaults to 1 (V0) or 999 (V1) for each modality.
For example, to allow up to 16 images and 2 videos per prompt:
``{"images": 16, "videos": 2}``
"""
"""
def
compute_hash
(
self
)
->
str
:
def
compute_hash
(
self
)
->
str
:
...
...
vllm/engine/arg_utils.py
View file @
8f7bace7
...
@@ -17,7 +17,7 @@ from typing_extensions import TypeIs
...
@@ -17,7 +17,7 @@ from typing_extensions import TypeIs
import
vllm.envs
as
envs
import
vllm.envs
as
envs
from
vllm
import
version
from
vllm
import
version
from
vllm.config
import
(
BlockSize
,
CacheConfig
,
CacheDType
,
CompilationConfig
,
from
vllm.config
import
(
BlockSize
,
CacheConfig
,
CacheDType
,
CompilationConfig
,
Config
,
Config
Format
,
DecodingConfig
,
Device
,
Config
Format
,
Config
Type
,
DecodingConfig
,
Device
,
DeviceConfig
,
DistributedExecutorBackend
,
HfOverrides
,
DeviceConfig
,
DistributedExecutorBackend
,
HfOverrides
,
KVTransferConfig
,
LoadConfig
,
LoadFormat
,
LoRAConfig
,
KVTransferConfig
,
LoadConfig
,
LoadFormat
,
LoRAConfig
,
ModelConfig
,
ModelImpl
,
MultiModalConfig
,
ModelConfig
,
ModelImpl
,
MultiModalConfig
,
...
@@ -304,7 +304,7 @@ class EngineArgs:
...
@@ -304,7 +304,7 @@ class EngineArgs:
"""Check if the class is a custom type."""
"""Check if the class is a custom type."""
return
cls
.
__module__
!=
"builtins"
return
cls
.
__module__
!=
"builtins"
def
get_kwargs
(
cls
:
type
[
Config
]
)
->
dict
[
str
,
Any
]:
def
get_kwargs
(
cls
:
Config
Type
)
->
dict
[
str
,
Any
]:
cls_docs
=
get_attr_docs
(
cls
)
cls_docs
=
get_attr_docs
(
cls
)
kwargs
=
{}
kwargs
=
{}
for
field
in
fields
(
cls
):
for
field
in
fields
(
cls
):
...
@@ -678,13 +678,15 @@ class EngineArgs:
...
@@ -678,13 +678,15 @@ class EngineArgs:
'--mm-processor-kwargs'
,
'--mm-processor-kwargs'
,
default
=
None
,
default
=
None
,
type
=
json
.
loads
,
type
=
json
.
loads
,
help
=
(
'Overrides for the multimodal input mapping/processing, '
help
=
(
'Overrides for the multi-modal processor obtained from '
'e.g., image processor. For example: ``{"num_crops": 4}``.'
))
'``AutoProcessor.from_pretrained``. The available overrides '
'depend on the model that is being run.'
'For example, for Phi-3-Vision: ``{"num_crops": 4}``.'
))
parser
.
add_argument
(
parser
.
add_argument
(
'--disable-mm-preprocessor-cache'
,
'--disable-mm-preprocessor-cache'
,
action
=
'store_true'
,
action
=
'store_true'
,
help
=
'If
t
rue,
then
disable
s
caching of the multi-modal '
help
=
'If
T
rue, disable caching of the
processed
multi-modal '
'
preprocessor/mapper. (not recommended)
'
)
'
inputs.
'
)
# LoRA related configs
# LoRA related configs
parser
.
add_argument
(
'--enable-lora'
,
parser
.
add_argument
(
'--enable-lora'
,
...
...
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