{"record":{"id":"20338895406e0dd4","repo":"sgl-project/sglang","slug":"sglang-bench-one-batch-is-deprecated-and-will-be","errorCode":null,"errorMessage":"`sglang.bench_one_batch` is deprecated and will be removed in a future release; use `sglang.benchmark.one_batch` instead (e.g. `python -m sglang.benchmark.one_batch`).","messagePattern":"`sglang\\.bench_one_batch` is deprecated and will be removed in a future release; use `sglang\\.benchmark\\.one_batch` instead \\(e\\.g\\. `python -m sglang\\.benchmark\\.one_batch`\\)\\.","errorType":"console","errorClass":"FutureWarning","httpStatus":null,"severity":"warning","filePath":"python/sglang/bench_one_batch.py","lineNumber":13,"sourceCode":"\"\"\"Deprecated import path for ``sglang.benchmark.one_batch``.\n\n``python -m sglang.bench_one_batch`` and ``from sglang.bench_one_batch import ...``\nstill work, but the implementation now lives in ``sglang.benchmark.one_batch``.\nUpdate references to the new path.\n\"\"\"\n\nimport warnings\n\nfrom sglang.benchmark.one_batch import *  # noqa: F401,F403\nfrom sglang.benchmark.one_batch import cli_main\n\nwarnings.warn(\n    \"`sglang.bench_one_batch` is deprecated and will be removed in a future \"\n    \"release; use `sglang.benchmark.one_batch` instead \"\n    \"(e.g. `python -m sglang.benchmark.one_batch`).\",\n    FutureWarning,\n    stacklevel=1,\n)\n\nif __name__ == \"__main__\":\n    cli_main()\n","sourceCodeStart":1,"sourceCodeEnd":23,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/bench_one_batch.py#L1-L23","documentation":"FutureWarning raised on import of the legacy shim sglang.bench_one_batch: the one-batch latency benchmark now lives at sglang.benchmark.one_batch. The shim re-exports symbols and warns that it will be deleted in a future release.","triggerScenarios":"Running python -m sglang.bench_one_batch or importing sglang.bench_one_batch in scripts/tools after upgrading sglang.","commonSituations":"Old benchmark commands in docs, shell scripts, or regression harnesses that predate the sglang.benchmark package reorganization.","solutions":["Use python -m sglang.benchmark.one_batch","Update imports to sglang.benchmark.one_batch","Filter FutureWarning in the interim if the command is pinned by CI"],"exampleFix":"# before\npython -m sglang.bench_one_batch --model ...\n# after\npython -m sglang.benchmark.one_batch --model ...","handlingStrategy":"fallback","validationCode":"try:\n    from sglang.benchmark.one_batch import cli_main\nexcept ImportError:\n    from sglang.bench_one_batch import cli_main  # legacy","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer python -m sglang.benchmark.one_batch","Keep benchmark commands in one variable/Makefile target so renames are one-line fixes"],"tags":["deprecation","benchmark","one-batch","future-warning"],"backgroundTag":"deprecated-module-import","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}