sgl-project/sglang · warning · FutureWarning
`sglang.bench_serving` is deprecated and will be removed in
Error message
`sglang.bench_serving` is deprecated and will be removed in a future release; use `sglang.benchmark.serving` instead (e.g. `python -m sglang.benchmark.serving`).
What it means
FutureWarning issued by the legacy shim sglang.bench_serving: the serving (online) benchmark was relocated to sglang.benchmark.serving. Importing the old path re-exports the new module and warns of future removal.
Source
Thrown at python/sglang/bench_serving.py:13
"""Deprecated import path for ``sglang.benchmark.serving``.
``python -m sglang.bench_serving`` and ``from sglang.bench_serving import ...``
still work, but the implementation now lives in ``sglang.benchmark.serving``.
Update references to the new path.
"""
import warnings
from sglang.benchmark.serving import * # noqa: F401,F403
from sglang.benchmark.serving import cli_main
warnings.warn(
"`sglang.bench_serving` is deprecated and will be removed in a future "
"release; use `sglang.benchmark.serving` instead "
"(e.g. `python -m sglang.benchmark.serving`).",
FutureWarning,
stacklevel=1,
)
if __name__ == "__main__":
cli_main()
View on GitHub (pinned to 0132848349)
Solutions
- Switch to python -m sglang.benchmark.serving
- Update any Python imports to sglang.benchmark.serving
- Add -W ignore::FutureWarning only if the invoking script is out of your control
Example fix
# before python -m sglang.bench_serving --backend sglang --dataset-name sharegpt ... # after python -m sglang.benchmark.serving --backend sglang --dataset-name sharegpt ...
Defensive patterns
Strategy: fallback
Validate before calling
import importlib.util
name = "sglang.benchmark.serving" if importlib.util.find_spec("sglang.benchmark.serving") else "sglang.bench_serving" Prevention
- Standardize on python -m sglang.benchmark.serving
- Update shared docs/scripts so teammates stop copying the old command
When it happens
Trigger: Running python -m sglang.bench_serving (the classic benchmark-serving command) or importing sglang.bench_serving.
Common situations: Widely-copied benchmark commands from older blog posts/docs/CI jobs; wrapper scripts that hardcode the old module path.
Related errors
- `sglang.bench_offline_throughput` is deprecated and will be
- `sglang.bench_one_batch` is deprecated and will be removed i
- `sglang.bench_one_batch_server` is deprecated and will be re
- head_first is deprecated and will be removed in a future ver
- 'python -m sglang.launch_server' is still supported, but 'sg
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/006195dc9204a5d1.
Report an issue: GitHub.