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 9, 07:30 UTC
Move decode context parallel validationn to `ParallelConfig` (#33239)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Harry Mellor committed
Jan 30, 2026 at 06:18 UTC
d334dd26c4972312d9dc4f04dc7c93cdcacbd5a4
2 files changed
+11
-10
vllm/config/parallel.py
+11
@@ -348,6 +348,17 @@ class ParallelConfig:
348
"num_redundant_experts."
349
)
350
351
+ # Note(hc): In the current implementation of decode context
352
+ # parallel(DCP), tp_size needs to be divisible by dcp_size,
353
+ # because the world size does not change by dcp, it simply
354
+ # reuses the GPUs of TP group, and split one TP group into
355
+ # tp_size//dcp_size DCP groups.
356
+ if self.tensor_parallel_size % self.decode_context_parallel_size != 0:
357
+ raise ValueError(
358
+ f"tp_size={self.tensor_parallel_size} must be divisible by"
359
+ f"dcp_size={self.decode_context_parallel_size}."
360
+ )
361
+
362
return self
363
364
@property
vllm/engine/arg_utils.py
-10
@@ -1389,16 +1389,6 @@ class EngineArgs:
1389
# global layers in interleaved sliding window models.
1390
sliding_window = model_config.get_sliding_window()
1391
1392
- # Note(hc): In the current implementation of decode context
1393
- # parallel(DCP), tp_size needs to be divisible by dcp_size,
1394
- # because the world size does not change by dcp, it simply
1395
- # reuses the GPUs of TP group, and split one TP group into
1396
- # tp_size//dcp_size DCP groups.
1397
- assert self.tensor_parallel_size % self.decode_context_parallel_size == 0, (
1398
- f"tp_size={self.tensor_parallel_size} must be divisible by"
1399
- f"dcp_size={self.decode_context_parallel_size}."
1400
- )
1401
-
1392
# Resolve "auto" kv_cache_dtype to actual value from model config
1393
resolved_cache_dtype = resolve_kv_cache_dtype_string(
1394
self.kv_cache_dtype, model_config