{"record":{"id":"747a9dfe0376d73d","repo":"vllm-project/vllm","slug":"cannot-set-both-pooling-type-and-tok-pooling-ty","errorCode":null,"errorMessage":"Cannot set both `pooling_type` and `tok_pooling_type`","messagePattern":"Cannot set both `pooling_type` and `tok_pooling_type`","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/config/pooler.py","lineNumber":141,"sourceCode":"            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,\n                    pooling_type,\n                )\n                self.tok_pooling_type = pooling_type  # type: ignore[assignment]\n            else:","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/config/pooler.py#L123-L159","documentation":"PoolerConfig.__post_init__ forbids setting both pooling_type and tok_pooling_type, the tokenwise-specific variant. Same rationale as the seq_pooling_type conflict: pooling_type is a convenience alias that resolves into the specific fields, so specifying both is ambiguous.","triggerScenarios":"Constructing PoolerConfig(pooling_type='ALL', tok_pooling_type='STEP'), or a config override containing both keys.","commonSituations":"Token-level reward/classification setups where users set tok_pooling_type explicitly and also pass pooling_type carried over from an older config.","solutions":["Drop pooling_type and keep tok_pooling_type (or vice versa).","Regenerate override dicts ensuring only one of the three pooling fields is present."],"exampleFix":"# before\nPoolerConfig(pooling_type='STEP', tok_pooling_type='STEP')\n\n# after\nPoolerConfig(tok_pooling_type='STEP')","handlingStrategy":"validation","validationCode":"def validate_pooler_fields(cfg_kwargs: dict) -> None:\n    if cfg_kwargs.get(\"pooling_type\") and cfg_kwargs.get(\"tok_pooling_type\"):\n        raise SystemExit(\"set either pooling_type or tok_pooling_type, not both\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When merging config dicts, de-duplicate the pooling fields to exactly one of pooling_type / seq_ / tok_."],"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"}