{"record":{"id":"3f2f26a87ac4cf94","repo":"sgl-project/sglang","slug":"no-valid-partitions-found-for-total-sms-total-sms","errorCode":null,"errorMessage":"No valid partitions found for total SMs {total_sms} with constraints (min per part: {min_per_part}, multiple: {multiple})","messagePattern":"No valid partitions found for total SMs (.+?) with constraints \\(min per part: (.+?), multiple: (.+?)\\)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/multiplex/pdmux_context.py","lineNumber":83,"sourceCode":"        return 8, 8\n    else:\n        raise ValueError(f\"Unsupported compute capability: {major}.{minor}\")\n\n\ndef divide_sm(total_sms, compute_capability, groups):\n    \"\"\"\n    :param total_sms: total sm count on a single GPU\n    :param compute_capability: (major, minor)\n    :return: SM partition group(prefill sm, decode sm)\n    \"\"\"\n    min_per_part, multiple = get_arch_constraints(compute_capability)\n    possible_values = [\n        x\n        for x in range(min_per_part, total_sms - min_per_part + 1, multiple)\n        if x >= total_sms - x and total_sms - x >= 16\n    ]\n    if not possible_values:\n        raise ValueError(\n            f\"No valid partitions found for total SMs {total_sms} \"\n            f\"with constraints (min per part: {min_per_part}, multiple: {multiple})\"\n        )\n\n    if len(possible_values) >= groups:\n        step = max(1, len(possible_values) // groups)\n        selected_values = possible_values[::step][:groups]\n    else:\n        selected_values = possible_values\n\n    divisions = []\n    for part1 in selected_values:\n        part2 = total_sms - part1\n        divisions.append((part1, part2))\n\n    divisions.reverse()  # Reverse to have larger prefill SM first\n\n    return divisions","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/multiplex/pdmux_context.py#L65-L101","documentation":"divide_sm searches for a first-partition size >= min_per_part, a multiple of 'multiple', where the first part covers at least half the SMs (x >= total - x) and the remainder keeps >= 16 SMs. On small GPUs or with Hopper's (8,8) constraints no candidate may exist.","triggerScenarios":"initialize_stream_groups on e.g. a small GPU (few SMs) with CC 9.0 constraints min_per_part=8, multiple=8 — e.g. total_sms where no multiple-of-8 x satisfies x >= total-x and total-x >= 16, like total_sms=24.","commonSituations":"Running PD multiplexing on entry-level GPUs (few SMs); future GPUs with unusual SM counts; total_sms not divisible-friendly with the required multiple.","solutions":["Disable PD multiplexing on this GPU — it cannot be partitioned under current constraints","Use a GPU with more SMs (constraints effectively require >= ~32+ SMs depending on arch)","File an issue with your total SM count and compute capability so constraints can be relaxed/extended"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"total = torch.cuda.get_device_properties(0).multi_processor_count\nmajor, minor = torch.cuda.get_device_capability()\n# conservative precheck for CC 9.0 constraints (min 8, multiple 8, remainder >= 16)\nassert total >= 32 and any(x for x in range(8, total - 15, 8) if x >= total - x), 'SM partitioning infeasible'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Don't enable pdmux on small/entry GPUs; check SM count first","File issues with SM count + CC so feasibility rules can improve"],"tags":["pdmux","gpu","partitioning","capacity"],"backgroundTag":"resource-partition-infeasible","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}