[Log] Add Warning for LLM(data_parallel_size=k) single-process DP Usage (#27282)

Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
Wentao Ye 2025-10-22 08:12:21 -04:00 committed by GitHub
parent 843af7f7fc
commit 1a0f4defb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -285,6 +285,16 @@ class LLM:
else:
structured_outputs_instance = StructuredOutputsConfig()
# warn about single-process data parallel usage.
_dps = int(kwargs.get("data_parallel_size", 1))
if _dps > 1:
raise ValueError(
f"LLM(data_parallel_size={_dps}) is not supported for single-"
"process usage and may hang. Please use "
"the explicit multi-process data-parallel example at "
"'examples/offline_inference/data_parallel.py'."
)
engine_args = EngineArgs(
model=model,
runner=runner,