{"record":{"id":"01b1004c4625c867","repo":"sgl-project/sglang","slug":"error-model-type-requires-a-non-empty-value","errorCode":null,"errorMessage":"Error: --model-type requires a non-empty value.","messagePattern":"Error: --model-type requires a non-empty value\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"critical","filePath":"python/sglang/cli/serve.py","lineNumber":51,"sourceCode":"    while i < len(extra_argv):\n        arg = extra_argv[i]\n        if arg == \"--model-type\":\n            if i + 1 >= len(extra_argv):\n                raise ValueError(\"Error: --model-type requires a value.\")\n            backend_name = extra_argv[i + 1]\n            i += 2\n            continue\n\n        if arg.startswith(\"--model-type=\"):\n            backend_name = arg.split(\"=\", 1)[1]\n            i += 1\n            continue\n\n        filtered_argv.append(arg)\n        i += 1\n\n    if not backend_name:\n        raise ValueError(\"Error: --model-type requires a non-empty value.\")\n    return backend_name, filtered_argv\n\n\ndef _normalize_positional_model_path(extra_argv):\n    \"\"\"Allow `sglang serve <model>` while preserving existing flag parsing.\"\"\"\n    if extra_argv and not extra_argv[0].startswith(\"-\"):\n        return [\"--model-path\", extra_argv[0], *extra_argv[1:]], True\n    return extra_argv, False\n\n\ndef _print_llm_help(_request: ServeRequest) -> None:\n    from sglang.srt.server_args import prepare_server_args\n\n    try:\n        prepare_server_args([\"--help\"])\n    except SystemExit:\n        pass  # argparse --help calls sys.exit\n","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/cli/serve.py#L33-L69","documentation":"The bfloat16 branch of deterministic_all_reduce supports only world sizes 2,4,6,8; anything else throws at the dispatch switch.","triggerScenarios":"Deterministic allreduce with bf16 tensors on a CustomAllreduce with world_size_ outside {2,4,6,8}.","commonSituations":"Deterministic inference enabled on odd or >8-GPU ROCm topologies with bf16 models (e.g. TP=3, TP=16).","solutions":["Run TP in {2,4,6,8}","Disable the deterministic custom kernel on unsupported topologies","Verify visible GPU count matches intended TP"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"assert fa.world_size_ in (2,4,6,8), 'deterministic bf16 allreduce needs TP in (2,4,6,8)'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate deterministic bf16 runs on supported TP sizes"],"tags":["rocm","allreduce","deterministic","tensor-parallel","bfloat16"],"backgroundTag":"world-size-unsupported","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}