@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 92924b2ddd
Fork 0

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, 05:00 UTC

[Deprecation] Remove deprecated items related to pooling (#33477)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>

Cyrus Leung committed Feb 1, 2026 at 00:44 UTC 92924b2dddebc6dc80b3fff6c84ff095530b8e58
8 files changed +52 -105
docs/models/pooling_models.md
-9
@@ -352,15 +352,6 @@ We have split the `encode` task into two more specific token-wise tasks: `token_
352 - `token_embed` is the same as `embed`, using normalization as the activation.
353 - `token_classify` is the same as `classify`, by default using softmax as the activation.
354
355 -### Remove softmax from PoolingParams
356 -
357 -We are going to remove `softmax` and `activation` from `PoolingParams` in v0.15. Instead, use `use_activation`, since we allow `classify` and `token_classify` to use any activation function.
358 -
359 -### as_reward_model
360 -
361 -!!! warning
362 - We are going to remove `--convert reward` in v0.15, use `--convert embed` instead.
363 -
355 Pooling models now default support all pooling, you can use it without any settings.
356
357 - Extracting hidden states prefers using `token_embed` task.
vllm/config/model.py
+1 -17
@@ -75,7 +75,7 @@ else:
75 logger = init_logger(__name__)
76
77 RunnerOption = Literal["auto", RunnerType]
78 -ConvertType = Literal["none", "embed", "classify", "reward", "mm_encoder_only"]
78 +ConvertType = Literal["none", "embed", "classify"]
79 ConvertOption = Literal["auto", ConvertType]
80 TokenizerMode = Literal["auto", "hf", "slow", "mistral", "deepseek_v32"]
81 ModelDType = Literal["auto", "half", "float16", "bfloat16", "float", "float32"]
@@ -499,15 +499,6 @@ class ModelConfig:
499 )
500 self.model_arch_config = self.get_model_arch_config()
501
502 - if self.convert == "mm_encoder_only":
503 - logger.warning_once(
504 - "`--convert mm_encoder_only` is deprecated and "
505 - "will be removed in v0.15. "
506 - "Please use --mm-encoder-only` instead."
507 - )
508 - mm_encoder_only = True
509 - self.convert = "none"
510 -
502 architectures = self.architectures
503 registry = self.registry
504 is_generative_model = registry.is_text_generation_model(architectures, self)
@@ -855,13 +846,6 @@ class ModelConfig:
846 runner_type: RunnerType,
847 convert: ConvertOption,
848 ) -> ConvertType:
858 - if convert == "reward":
859 - logger.warning(
860 - "`--convert reward` is deprecated and will be removed in v0.15. "
861 - "Please use `--convert embed` instead."
862 - )
863 - return "embed"
864 -
849 if convert != "auto":
850 return convert
851
vllm/config/pooler.py
+6 -45
@@ -45,11 +45,13 @@ class PoolerConfig:
45 The pooling method used for tokenwise pooling.
46 """
47
48 - ## for embeddings models
49 - normalize: bool | None = None
48 + use_activation: bool | None = None
49 """
51 - DEPRECATED: please use `use_activation` instead.
50 + Whether to apply activation function to the pooler outputs.
51 + `None` uses the pooler's default, which is `True` in most cases.
52 """
53 +
54 + ## for embedding models
55 dimensions: int | None = None
56 """
57 Reduce the dimensions of embeddings if model
@@ -73,19 +75,6 @@ class PoolerConfig:
75 """
76
77 ## for classification models
76 - softmax: float | None = None
77 - """
78 - DEPRECATED: please use `use_activation` instead.
79 - """
80 - activation: float | None = None
81 - """
82 - DEPRECATED: please use `use_activation` instead.
83 - """
84 - use_activation: bool | None = None
85 - """
86 - Whether to apply activation function to the classification outputs.
87 - Defaults to True.
88 - """
78 logit_bias: float | None = None
79 """
80 If provided, apply classification logit biases. Defaults to None.
@@ -105,10 +94,7 @@ class PoolerConfig:
94 `math-shepherd-mistral-7b-prm` model.
95 """
96
108 - def __post_init__(self):
109 - # raise deprecated warning for softmax and activation
110 - self.use_activation = get_use_activation(self)
111 -
97 + def __post_init__(self) -> None:
98 if pooling_type := self.pooling_type:
99 if self.seq_pooling_type is not None:
100 raise ValueError(
@@ -161,28 +147,3 @@ class PoolerConfig:
147 factors: list[Any] = []
148 hash_str = safe_hash(str(factors).encode(), usedforsecurity=False).hexdigest()
149 return hash_str
164 -
165 -
166 -def get_use_activation(o: object):
167 - if (normalize := getattr(o, "normalize", None)) is not None:
168 - logger.warning_once(
169 - "`normalize` is deprecated and will be removed in v0.15. "
170 - "Please use `use_activation` instead."
171 - )
172 - return normalize
173 -
174 - if (softmax := getattr(o, "softmax", None)) is not None:
175 - logger.warning_once(
176 - "`softmax` is deprecated and will be removed in v0.15. "
177 - "Please use `use_activation` instead."
178 - )
179 - return softmax
180 -
181 - if (activation := getattr(o, "activation", None)) is not None:
182 - logger.warning_once(
183 - "`activation` is deprecated and will be removed in v0.15. "
184 - "Please use `use_activation` instead."
185 - )
186 - return activation
187 -
188 - return getattr(o, "use_activation", None)
vllm/entrypoints/pooling/base/protocol.py
+20 -14
@@ -7,16 +7,18 @@ from typing import Annotated, Any
7 from pydantic import Field, model_validator
8
9 from vllm import PoolingParams
10 -from vllm.config.pooler import get_use_activation
10 from vllm.entrypoints.chat_utils import (
11 ChatCompletionMessageParam,
12 ChatTemplateContentFormatOption,
13 )
14 from vllm.entrypoints.openai.engine.protocol import OpenAIBaseModel
15 +from vllm.logger import init_logger
16 from vllm.renderers import ChatParams, merge_kwargs
17 from vllm.utils import random_uuid
18 from vllm.utils.serial_utils import EmbedDType, EncodingFormat, Endianness
19
20 +logger = init_logger(__name__)
21 +
22
23 class PoolingBasicRequestMixin(OpenAIBaseModel):
24 # --8<-- [start:pooling-common-params]
@@ -172,39 +174,43 @@ class EmbedRequestMixin(EncodingRequestMixin):
174 # --8<-- [end:embed-params]
175
176 # --8<-- [start:embed-extra-params]
177 + use_activation: bool | None = Field(
178 + default=None,
179 + description="Whether to use activation for the pooler outputs. "
180 + "`None` uses the pooler's default, which is `True` in most cases.",
181 + )
182 normalize: bool | None = Field(
183 default=None,
177 - description="Whether to normalize the embeddings outputs. Default is True.",
184 + description="Deprecated; please pass `use_activation` instead",
185 )
186 # --8<-- [end:embed-extra-params]
187
188 def to_pooling_params(self):
189 + if self.normalize is not None:
190 + logger.warning_once(
191 + "`normalize` is deprecated and will be removed in v0.17. "
192 + "Please pass `use_activation` instead."
193 + )
194 + self.use_activation = self.normalize
195 +
196 return PoolingParams(
197 dimensions=self.dimensions,
184 - use_activation=self.normalize,
198 + use_activation=self.use_activation,
199 truncate_prompt_tokens=getattr(self, "truncate_prompt_tokens", None),
200 )
201
202
203 class ClassifyRequestMixin(OpenAIBaseModel):
204 # --8<-- [start:classify-extra-params]
191 - softmax: bool | None = Field(
192 - default=None,
193 - description="softmax will be deprecated, please use use_activation instead.",
194 - )
195 - activation: bool | None = Field(
196 - default=None,
197 - description="activation will be deprecated, please use use_activation instead.",
198 - )
205 use_activation: bool | None = Field(
206 default=None,
201 - description="Whether to use activation for classification outputs. "
202 - "Default is True.",
207 + description="Whether to use activation for the pooler outputs. "
208 + "`None` uses the pooler's default, which is `True` in most cases.",
209 )
210 # --8<-- [end:classify-extra-params]
211
212 def to_pooling_params(self):
213 return PoolingParams(
208 - use_activation=get_use_activation(self),
214 + use_activation=self.use_activation,
215 truncate_prompt_tokens=getattr(self, "truncate_prompt_tokens", None),
216 )
vllm/entrypoints/pooling/pooling/protocol.py
+19 -3
@@ -7,7 +7,6 @@ from pydantic import Field
7
8 from vllm import PoolingParams
9 from vllm.config import ModelConfig
10 -from vllm.config.pooler import get_use_activation
10 from vllm.entrypoints.openai.engine.protocol import OpenAIBaseModel, UsageInfo
11 from vllm.entrypoints.pooling.base.protocol import (
12 ChatRequestMixin,
@@ -17,10 +16,13 @@ from vllm.entrypoints.pooling.base.protocol import (
16 EncodingRequestMixin,
17 PoolingBasicRequestMixin,
18 )
19 +from vllm.logger import init_logger
20 from vllm.renderers import TokenizeParams
21 from vllm.tasks import PoolingTask
22 from vllm.utils import random_uuid
23
24 +logger = init_logger(__name__)
25 +
26
27 class PoolingCompletionRequest(
28 PoolingBasicRequestMixin,
@@ -43,10 +45,17 @@ class PoolingCompletionRequest(
45 )
46
47 def to_pooling_params(self):
48 + if self.normalize is not None:
49 + logger.warning_once(
50 + "`normalize` is deprecated and will be removed in v0.17. "
51 + "Please pass `use_activation` instead."
52 + )
53 + self.use_activation = self.normalize
54 +
55 return PoolingParams(
56 truncate_prompt_tokens=self.truncate_prompt_tokens,
57 + use_activation=self.use_activation,
58 dimensions=self.dimensions,
49 - use_activation=get_use_activation(self),
59 )
60
61
@@ -73,10 +82,17 @@ class PoolingChatRequest(
82 )
83
84 def to_pooling_params(self):
85 + if self.normalize is not None:
86 + logger.warning_once(
87 + "`normalize` is deprecated and will be removed in v0.17. "
88 + "Please pass `use_activation` instead."
89 + )
90 + self.use_activation = self.normalize
91 +
92 return PoolingParams(
93 truncate_prompt_tokens=self.truncate_prompt_tokens,
94 + use_activation=self.use_activation,
95 dimensions=self.dimensions,
79 - use_activation=get_use_activation(self),
96 )
97
98
vllm/entrypoints/pooling/score/protocol.py
+1 -2
@@ -7,7 +7,6 @@ from pydantic import BaseModel, Field
7
8 from vllm import PoolingParams
9 from vllm.config import ModelConfig
10 -from vllm.config.pooler import get_use_activation
10 from vllm.entrypoints.openai.engine.protocol import OpenAIBaseModel, UsageInfo
11 from vllm.entrypoints.pooling.base.protocol import (
12 ClassifyRequestMixin,
@@ -43,7 +42,7 @@ class ScoreRequestMixin(PoolingBasicRequestMixin, ClassifyRequestMixin):
42 def to_pooling_params(self):
43 return PoolingParams(
44 truncate_prompt_tokens=self.truncate_prompt_tokens,
46 - use_activation=get_use_activation(self),
45 + use_activation=self.use_activation,
46 )
47
48
vllm/model_executor/models/config.py
+2 -2
@@ -233,8 +233,8 @@ class Qwen2ForRewardModelConfig(VerifyAndUpdateConfig):
233 def verify_and_update_model_config(model_config: "ModelConfig") -> None:
234 pooler_config = model_config.pooler_config
235
236 - if pooler_config.softmax is None:
237 - pooler_config.softmax = False
236 + if pooler_config.use_activation is None:
237 + pooler_config.use_activation = False
238
239
240 class Qwen3ForSequenceClassificationConfig(VerifyAndUpdateConfig):
vllm/pooling_params.py
+3 -13
@@ -7,7 +7,6 @@ from typing import Annotated, Any
7 import msgspec
8
9 from vllm.config import ModelConfig, PoolerConfig
10 -from vllm.config.pooler import get_use_activation
10 from vllm.sampling_params import RequestOutputKind
11 from vllm.tasks import PoolingTask
12
@@ -24,30 +23,24 @@ class PoolingParams(
23 Set to -1 to use the model's default truncation size.
24 Set to k to keep only the last k tokens (left truncation).
25 Set to None to disable truncation.
26 + use_activation: Whether to apply activation function to the pooler outputs.
27 + `None` uses the pooler's default, which is `True` in most cases.
28 dimensions: Reduce the dimensions of embeddings
29 if model support matryoshka representation.
29 - normalize: Deprecated, please use use_activation instead.
30 - softmax: Deprecated, please use use_activation instead.
31 - activation: Deprecated, please use use_activation instead.
32 - use_activation: Whether to apply activation function to
33 - the classification outputs.
30 """
31
32 # --8<-- [start:common-pooling-params]
33 truncate_prompt_tokens: Annotated[int, msgspec.Meta(ge=-1)] | None = None
34 + use_activation: bool | None = None
35 # --8<-- [end:common-pooling-params]
36
37 ## for embeddings models
38 # --8<-- [start:embed-pooling-params]
39 dimensions: int | None = None
43 - normalize: bool | None = None
40 # --8<-- [end:embed-pooling-params]
41
42 ## for classification, scoring and rerank
43 # --8<-- [start:classify-pooling-params]
48 - softmax: bool | None = None
49 - activation: bool | None = None
50 - use_activation: bool | None = None
44 # --8<-- [end:classify-pooling-params]
45
46 ## for step pooling models
@@ -88,9 +81,6 @@ class PoolingParams(
81 msg = f"You cannot overwrite {self.task=!r} with {task=!r}!"
82 raise ValueError(msg)
83
91 - # raise deprecated warning for softmax and activation
92 - self.use_activation = get_use_activation(self)
93 -
84 # plugin task uses io_processor.parse_request to verify inputs,
85 # skipping PoolingParams verify
86 if self.task == "plugin":