{"record":{"id":"e5311409d1d4a155","repo":"vllm-project/vllm","slug":"logit-sigma-cannot-be-0-division-by-zero","errorCode":null,"errorMessage":"logit_sigma cannot be 0 (division by zero)","messagePattern":"logit_sigma cannot be 0 \\(division by zero\\)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/config/pooler.py","lineNumber":133,"sourceCode":"    `math-shepherd-mistral-7b-prm` model.\n    \"\"\"\n\n    @model_validator(mode=\"before\")\n    @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]","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/config/pooler.py#L115-L151","documentation":"PoolerConfig.__post_init__ rejects logit_sigma == 0. logit_sigma divides classification logits for Platt-style score calibration: activation((logit - logit_mean) / logit_sigma). Zero would cause division by zero at inference time, so config construction fails fast.","triggerScenarios":"Passing PoolerConfig(logit_sigma=0) (or --overrides pooler_config.logit_sigma=0) for a classification model, often when logit_mean is set for calibration and sigma is left as an explicit 0 instead of omitted.","commonSituations":"Calibration configs where a user zeroes out unused knobs; porting calibration YAML where 0 was a placeholder; confusion between 'None means unused' and '0 means unused'.","solutions":["Set logit_sigma to a non-zero scale value (typically the calibrated sigma, e.g. 1.0).","Omit logit_sigma entirely if no sigma scaling is wanted (None disables it).","If only mean calibration is needed, set logit_mean only and leave logit_sigma unset."],"exampleFix":"# before\nPoolerConfig(logit_mean=0.5, logit_sigma=0)\n\n# after\nPoolerConfig(logit_mean=0.5, logit_sigma=1.0)  # or omit logit_sigma","handlingStrategy":"validation","validationCode":"def validate_pooler_calibration(logit_sigma: float | None) -> float | None:\n    if logit_sigma == 0:\n        raise SystemExit(\"logit_sigma must be non-zero; omit it if sigma scaling is unused\")\n    return logit_sigma","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use None (omit) to disable calibration params, never 0.","Validate calibration configs (mean set, sigma positive) before engine start."],"tags":["pooling","classification","calibration","configuration"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}