A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 1, 22:30 UTC
[Bugfix] Reject non-positive values for ParallelConfig int knobs (#44057)
Signed-off-by: jwzheng96 <jianweizheng@pku.edu.cn> Signed-off-by: JianweiZheng <32029023+jwzheng96@users.noreply.github.com> Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com>
JianweiZheng committed
Jun 4, 2026 at 23:46 UTC
99ef652907932fe6ba1fb28fa8bfbafeea8ed317
1 file changed
+20
-18
vllm/config/parallel.py
+20
-18
@@ -109,22 +109,24 @@ class EPLBConfig:
109
class ParallelConfig:
110
"""Configuration for the distributed execution."""
111
112
- pipeline_parallel_size: int = 1
112
+ pipeline_parallel_size: int = Field(default=1, ge=1)
113
"""Number of pipeline parallel groups."""
114
- tensor_parallel_size: int = 1
114
+ tensor_parallel_size: int = Field(default=1, ge=1)
115
"""Number of tensor parallel groups."""
116
- prefill_context_parallel_size: int = 1
116
+ prefill_context_parallel_size: int = Field(default=1, ge=1)
117
"""Number of prefill context parallel groups."""
118
- data_parallel_size: int = 1
118
+ data_parallel_size: int = Field(default=1, ge=1)
119
"""Number of data parallel groups. MoE layers will be sharded according to
120
the product of the tensor parallel size and data parallel size."""
121
- data_parallel_size_local: int = 1
122
- """Number of local data parallel groups."""
123
- data_parallel_rank: int = 0
124
- """Rank of the data parallel group."""
121
+ data_parallel_size_local: int = Field(default=1, ge=0)
122
+ """Number of local data parallel groups. A value of 0 is a sentinel used by
123
+ the engine-args layer to signal that data parallelism was specified
124
+ externally (see `ParallelConfig.__post_init__`)."""
125
+ data_parallel_rank: int = Field(default=0, ge=0)
126
+ """Rank of the data parallel group. The runtime check at
127
+ ``__post_init__`` further bounds this by ``data_parallel_size``."""
128
data_parallel_rank_local: int | None = None
126
- """Local rank of the data parallel group,
127
- set only in SPMD mode."""
129
+ """Local rank of the data parallel group, set only in SPMD mode."""
130
data_parallel_master_ip: str = "127.0.0.1"
131
"""IP of the data parallel master."""
132
data_parallel_rpc_port: int = 29550
@@ -184,7 +186,7 @@ class ParallelConfig:
186
- "flashinfer_nvlink_two_sided": Use flashinfer two-sided kernels for mnnvl
187
- "flashinfer_nvlink_one_sided": Use flashinfer high-throughput a2a kernels"""
188
187
- max_parallel_loading_workers: int | None = None
189
+ max_parallel_loading_workers: int | None = Field(default=None, ge=1)
190
"""Maximum number of parallel loading workers when loading model
191
sequentially in multiple batches. To avoid RAM OOM when using tensor
192
parallel and large models."""
@@ -197,15 +199,15 @@ class ParallelConfig:
199
200
enable_dbo: bool = False
201
"""Enable dual batch overlap for the model executor."""
200
- ubatch_size: int = 0
202
+ ubatch_size: int = Field(default=0, ge=0)
203
"""Number of ubatch size."""
204
203
- dbo_decode_token_threshold: int = 32
205
+ dbo_decode_token_threshold: int = Field(default=32, ge=0)
206
"""The threshold for dual batch overlap for batches only containing decodes.
207
If the number of tokens in the request is greater than this threshold,
208
microbatching will be used. Otherwise, the request will be processed in a
209
single batch."""
208
- dbo_prefill_token_threshold: int = 512 # TODO(lucas): tune
210
+ dbo_prefill_token_threshold: int = Field(default=512, ge=0) # TODO(lucas): tune
211
"""The threshold for dual batch overlap for batches that contain one or more
212
prefills. If the number of tokens in the request is greater than this
213
threshold, microbatching will be used. Otherwise, the request will be
@@ -260,10 +262,10 @@ class ParallelConfig:
262
master_port: int = 29501
263
"""distributed master port for multi-node distributed
264
inference when distributed_executor_backend is mp."""
263
- node_rank: int = 0
264
- """distributed node rank for multi-node distributed
265
+ node_rank: int = Field(default=0, ge=0)
266
+ """distributed node rank for multi-node distributed
267
inference when distributed_executor_backend is mp."""
266
- nnodes: int = 1
268
+ nnodes: int = Field(default=1, ge=1)
269
"""num of nodes for multi-node distributed
270
inference when distributed_executor_backend is mp."""
271
numa_bind: bool = False
@@ -318,7 +320,7 @@ class ParallelConfig:
320
"""Port of the coordination TCPStore. Can be set by the API server; workers
321
connect as clients to exchange self-picked group ports at runtime."""
322
321
- decode_context_parallel_size: int = 1
323
+ decode_context_parallel_size: int = Field(default=1, ge=1)
324
"""Number of decode context parallel groups, because the world size does
325
not change by dcp, it simply reuse the GPUs of TP group, and tp_size
326
needs to be divisible by dcp_size."""