{"record":{"id":"704af0e395daf5d1","repo":"vllm-project/vllm","slug":"cannot-set-both-pooling-type-and-seq-pooling-ty","errorCode":null,"errorMessage":"Cannot set both `pooling_type` and `seq_pooling_type`","messagePattern":"Cannot set both `pooling_type` and `seq_pooling_type`","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/config/pooler.py","lineNumber":137,"sourceCode":"    @classmethod\n    def reject_removed_parameters(cls, data):\n        values = data.kwargs if isinstance(data, ArgsKwargs) else data\n        if not isinstance(values, dict):\n            return data\n        if \"normalize\" in values:\n            raise ValueError(\n                \"Parameter `normalize` was removed; use `use_activation` instead.\"\n            )\n        check_removed_pooling_task(values.get(\"task\"))\n        return data\n\n    def __post_init__(self) -> None:\n        if self.logit_sigma is not None and self.logit_sigma == 0:\n            raise ValueError(\"logit_sigma cannot be 0 (division by zero)\")\n\n        if pooling_type := self.pooling_type:\n            if self.seq_pooling_type is not None:\n                raise ValueError(\n                    \"Cannot set both `pooling_type` and `seq_pooling_type`\"\n                )\n            if self.tok_pooling_type is not None:\n                raise ValueError(\n                    \"Cannot set both `pooling_type` and `tok_pooling_type`\"\n                )\n\n            if pooling_type in SEQ_POOLING_TYPES:\n                logger.debug(\n                    \"Resolved `pooling_type=%r` to `seq_pooling_type=%r`.\",\n                    pooling_type,\n                    pooling_type,\n                )\n                self.seq_pooling_type = pooling_type  # type: ignore[assignment]\n            elif pooling_type in TOK_POOLING_TYPES:\n                logger.debug(\n                    \"Resolved `pooling_type=%r` to `tok_pooling_type=%r`.\",\n                    pooling_type,","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/config/pooler.py#L119-L155","documentation":"PoolerConfig.__post_init__ forbids setting both the convenience field pooling_type and the specific seq_pooling_type. pooling_type exists only as a user-facing shortcut that auto-resolves into seq_pooling_type or tok_pooling_type; setting both creates ambiguity about which sequence pooling method wins.","triggerScenarios":"Constructing PoolerConfig(pooling_type='MEAN', seq_pooling_type='CLS') or a CLI/config override that supplies both keys.","commonSituations":"Copying a model's default seq_pooling_type into an override while also setting pooling_type for clarity; merging config dicts that each contributed one of the fields.","solutions":["Keep only seq_pooling_type (or tok_pooling_type) and drop pooling_type.","Or keep only pooling_type and let it auto-resolve.","Audit generated override dicts for both keys before passing to PoolerConfig."],"exampleFix":"# before\nPoolerConfig(pooling_type='MEAN', seq_pooling_type='CLS')\n\n# after\nPoolerConfig(seq_pooling_type='CLS')","handlingStrategy":"validation","validationCode":"def validate_pooler_fields(cfg_kwargs: dict) -> None:\n    if cfg_kwargs.get(\"pooling_type\") and cfg_kwargs.get(\"seq_pooling_type\"):\n        raise SystemExit(\"set either pooling_type or seq_pooling_type, not both\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer the specific seq_/tok_pooling_type fields in persistent configs; treat pooling_type as a CLI convenience only."],"tags":["pooling","configuration","conflicting-fields"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}