{"record":{"id":"5d3e6352dbb264e5","repo":"sgl-project/sglang","slug":"sm-group-num-must-be-3","errorCode":null,"errorMessage":"sm_group_num must be >= 3","messagePattern":"sm_group_num must be >= 3","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/multiplex/pdmux_context.py","lineNumber":36,"sourceCode":"        default_factory=list\n    )  # [prefill_sm, decode_sm, decode_bs_threshold]\n    split_forward_token_budget: int = 65536\n    decode_bs_divisor: int = 36\n\n\ndef load_pdmux_config(config_path: str) -> PDMuxConfig:\n    \"\"\"Load pdmux configuration from YAML file into a dataclass.\"\"\"\n    if not config_path:\n        return PDMuxConfig()\n\n    with open(config_path, \"r\") as f:\n        raw = yaml.safe_load(f)\n\n    if \"sm_group_num\" not in raw:\n        raise ValueError(\"Missing required field: sm_group_num\")\n\n    if raw[\"sm_group_num\"] < 3:\n        raise ValueError(\"sm_group_num must be >= 3\")\n\n    manual_divisions = raw.get(\"manual_divisions\", [])\n\n    expected = raw[\"sm_group_num\"] - 2\n    if manual_divisions and len(manual_divisions) != expected:\n        raise ValueError(\n            f\"manual_divisions must have {expected} entries, \"\n            f\"but got {len(manual_divisions)}\"\n        )\n\n    return PDMuxConfig(\n        sm_group_num=raw[\"sm_group_num\"],\n        manual_divisions=manual_divisions,\n        split_forward_token_budget=raw.get(\"split_forward_token_budget\", 65536),\n        decode_bs_divisor=raw.get(\"decode_bs_divisor\", 36),\n    )\n\n","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/multiplex/pdmux_context.py#L18-L54","documentation":"PD multiplexing divides SMs into at least three groups (prefill, decode, plus control), so sm_group_num values of 1 or 2 are structurally invalid and rejected.","triggerScenarios":"Setting sm_group_num: 2 (or 1) in the pdmux YAML config.","commonSituations":"Assuming one group per workload type (prefill+decode=2) without knowing the extra control groups are required; shrinking groups to simplify testing.","solutions":["Set sm_group_num to >= 3","Read the pdmux docs for recommended counts for your GPU count and workload","If you only need 2 workload groups, use the corresponding manual_divisions arrangement with the minimum group count"],"exampleFix":"# before\nsm_group_num: 2\n# after\nsm_group_num: 4","handlingStrategy":"validation","validationCode":"assert raw['sm_group_num'] >= 3, 'sm_group_num must be >= 3'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember pdmux needs at least 3 groups (workload + control groups)","Lint numeric constraints in config CI"],"tags":["pdmux","config","validation"],"backgroundTag":"config-value-out-of-range","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}