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 14, 05:30 UTC
[FIX] Throwing an exception when the model does not support pool tasks (#25840) (#25855)
Signed-off-by: zxw <1020938856@qq.com> Co-authored-by: wang.yuqi <noooop@126.com>
yyzxw committed
Oct 13, 2025 at 11:56 UTC
46ad73955a47a69411e37c7871480e834dbfeb22
2 files changed
+24
-1
vllm/model_executor/models/adapters.py
+3
@@ -399,6 +399,9 @@ def as_reward_model(cls: _T) -> _T:
399
# Lazy import
400
from vllm.model_executor.layers.pooler import DispatchPooler, Pooler
401
402
+ from .interfaces_base import default_pooling_type
403
+
404
+ @default_pooling_type("ALL")
405
class ModelForReward(_create_pooling_model_cls(cls)):
406
def _init_pooler(self, vllm_config: "VllmConfig", prefix: str = ""):
407
pooler_config = vllm_config.model_config.pooler_config
vllm/v1/worker/gpu_model_runner.py
+21
-1
@@ -3622,8 +3622,28 @@ class GPUModelRunner(LoRAModelRunnerMixin, KVConnectorModelRunnerMixin):
3622
hidden_states: torch.Tensor,
3623
) -> PoolerOutput:
3624
# Find the task that has the largest output for subsequent steps
3625
+ supported_pooling_tasks = self.get_supported_pooling_tasks()
3626
+
3627
+ if not supported_pooling_tasks:
3628
+ if self.scheduler_config.chunked_prefill_enabled:
3629
+ raise RuntimeError(
3630
+ f"Model {self.model_config.model} does not support "
3631
+ "any pooling tasks with chunked prefill enabled. "
3632
+ "Please add --no-enable-chunked-prefill to your "
3633
+ "config or CLI args. See "
3634
+ "https://docs.vllm.ai/en/latest/models/pooling_models.html "
3635
+ "to learn more."
3636
+ )
3637
+ else:
3638
+ raise RuntimeError(
3639
+ f"Model {self.model_config.model} does not support "
3640
+ "any pooling tasks. See "
3641
+ "https://docs.vllm.ai/en/latest/models/pooling_models.html "
3642
+ "to learn more."
3643
+ )
3644
+
3645
output_size = dict[PoolingTask, float]()
3626
- for task in self.get_supported_pooling_tasks():
3646
+ for task in supported_pooling_tasks:
3647
# Run a full batch with each task to ensure none of them OOMs
3648
output = self._dummy_pooler_run_task(hidden_states, task)
3649
output_size[task] = sum(o.nbytes for o in output)