sgl-project/sglang · warning · FutureWarning

`sglang.bench_one_batch_server` is deprecated and will be re

Error message

`sglang.bench_one_batch_server` is deprecated and will be removed in a future release; use `sglang.benchmark.one_batch_server` instead (e.g. `python -m sglang.benchmark.one_batch_server`).

What it means

FutureWarning from the compatibility shim sglang.bench_one_batch_server: the server-based one-batch benchmark moved to sglang.benchmark.one_batch_server. The shim re-exports the new module's API and cli_main and warns at import.

Source

Thrown at python/sglang/bench_one_batch_server.py:14

"""Deprecated import path for ``sglang.benchmark.one_batch_server``.

``python -m sglang.bench_one_batch_server`` and
``from sglang.bench_one_batch_server import ...`` still work, but the
implementation now lives in ``sglang.benchmark.one_batch_server``.
Update references to the new path.
"""

import warnings

from sglang.benchmark.one_batch_server import *  # noqa: F401,F403
from sglang.benchmark.one_batch_server import cli_main

warnings.warn(
    "`sglang.bench_one_batch_server` is deprecated and will be removed in a "
    "future release; use `sglang.benchmark.one_batch_server` instead "
    "(e.g. `python -m sglang.benchmark.one_batch_server`).",
    FutureWarning,
    stacklevel=1,
)

if __name__ == "__main__":
    cli_main()

View on GitHub (pinned to 0132848349)

Solutions

  1. Run python -m sglang.benchmark.one_batch_server
  2. Change imports to sglang.benchmark.one_batch_server
  3. Suppress with warnings filters only as a short-term stopgap

Example fix

# before
python -m sglang.bench_one_batch_server --model ...
# after
python -m sglang.benchmark.one_batch_server --model ...
Defensive patterns

Strategy: fallback

Validate before calling

import importlib
bench = importlib.import_module("sglang.benchmark.one_batch_server")

Prevention

When it happens

Trigger: Running python -m sglang.bench_one_batch_server or importing the old module path.

Common situations: Legacy scripts or documentation invoking the pre-reorganization benchmark path after a sglang upgrade.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/22b4396ae6b7843e. Report an issue: GitHub.