Skip to content

[Benchmark] Remove obsolete auto-benchmark remnants - #31941

Merged
BBuf merged 1 commit into
sgl-project:mainfrom
BBuf:agent/remove-auto-benchmark-remnants
Jul 21, 2026
Merged

BBuf merged 1 commit into
sgl-project:mainfrom
BBuf:agent/remove-auto-benchmark-remnants

Conversation

@BBuf

@BBuf BBuf commented Jul 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • remove the retired sglang.auto_benchmark CLI and orchestration library
  • remove the private autobench dataset adapter, registry entry, and serving CLI choice
  • remove the dedicated unit tests for the deleted subsystem

Why

The in-repository llm-serving-auto-benchmark skill was removed in #29487, but
its Python support code remained behind. A repository-wide reference audit
found no callers outside the old entry point, dataset registration, and the
subsystem's own tests. Keeping this unsupported workflow in the public package
causes confusion and leaves more than 3,000 lines of unmaintained code.

Impact

python -m sglang.auto_benchmark and bench_serving --dataset-name autobench
are removed. Other benchmark datasets and serving behavior are unchanged.

Validation

  • python3 -m pytest test/registered/bench_fn/test_benchmark_datasets_api.py::TestBenchmarkDatasetsAPI::test_dataset_mapping_and_dispatch -q
  • pre-commit run --files python/sglang/benchmark/datasets/__init__.py python/sglang/benchmark/serving.py
  • git diff --check origin/main...HEAD
  • rg -n 'auto_benchmark|autobench|AutoBenchmark' python test
  • AST inspection of the --dataset-name choices in python/sglang/benchmark/serving.py

CI States

Latest PR Test (Base): ⏳ Run #29830429642
Latest PR Test (Extra): 🚫 Run #29830640983

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@BBuf
BBuf marked this pull request as ready for review July 21, 2026 12:34
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@BBuf BBuf added benchmark ready-for-review run-ci CI: run the baseline test suite on this PR labels Jul 21, 2026 — with ChatGPT Codex Connector

BBuf commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator Author

/tag-and-rerun-ci extra

@github-actions github-actions Bot added the run-ci-extra CI: also run the extra suite (requires run-ci) label Jul 21, 2026
@BBuf
BBuf merged commit 075bd97 into sgl-project:main Jul 21, 2026
188 of 284 checks passed
Zhylkaaa pushed a commit to Zhylkaaa/sglang that referenced this pull request Jul 29, 2026
shuwang21 added a commit to shuwang21/sglang that referenced this pull request Sep 3, 2026
Introduces `sglang.autotune`, one framework for two layers of tuning for
a (model, platform): the inner layer tunes kernels and dispatch heuristics
(triton fused MoE tile sizes, cutlass variants, allreduce algorithm,
attention / MoE backend choice, speculative parameters per batch size),
the outer layer searches the deployment configuration space (parallelism,
scheduler and memory knobs) under a workload and SLA. The top-level
command is `python -m sglang.auto_tune --model-path X --tp N`.

This commit lands the design doc and the abstractions only; no concrete
space, strategy, driver, store, or reporter yet.

Design (docs/developer_guide/auto_tune_design.mdx):
- greenfield: the previous `sglang.auto_benchmark` was removed in sgl-project#31941,
  so there is no compatibility burden. Its failure modes are recorded as
  design rationale.
- kernel tuning is the inner layer, not a non-goal: the existing per-kernel
  scripts (`benchmark/kernels/**/tuning_*.py`) become drivers. The outer
  layer pins tp/ep, runs the inner layer for that parallelism, then searches
  the remaining knobs. Rollout starts with the triton fused MoE driver and
  the `sglang.auto_tune` front; the serving driver comes later.
- builds on `sglang.benchmark` (serving, offline_throughput, steady_state,
  datasets) rather than forking a benchmark client. `run_benchmark()`
  writes a module-global `args`, so concurrent trials must run their
  client in separate processes.
- ranks on the steady-state window so candidates are not compared on their
  ramp-up transient. `steady_state_serving.run_steady_state_benchmark()`
  is the entry point; `serving.py` does not call it.
- knobs come from the `Annotated[..., Arg(...)]` field metadata on
  `ServerArgs` rather than from argparse parser internals, so the coupling
  is to a declared contract.

Abstractions (python/sglang/autotune/):
- types.py       Point, Trial, Measurement, Workload, LoadPoint, Fidelity,
                 Provenance, Budget, TrialStatus, FailureKind
- space/base.py  Space, Knob, Domain, FeasibilityRule, Conditional
- strategy/base  Strategy (ask/tell), StrategyState
- executor/base  Executor, SerialExecutor, TrialSlot, Submission
- measure.py     MeasurementDriver, LoadPlan, CapacitySearch
- objective.py   Objective, Constraint, MetricThreshold, rank_by_bucket,
                 pareto_front
- store.py       TrialStore
- report.py      Reporter
- registry.py    per-kind name -> class registries
- orchestrator   the ask/run/tell loop

Invariants the abstractions exist to enforce:
- feasibility is separate from quality, so a candidate that violates the
  SLA can never outrank a compliant one;
- a constraint is validated against the metrics its driver declares it
  emits, so a threshold cannot be silently ignored;
- ranking is per point, not per measurement: a point is measured once per
  (workload, load) and is feasible only if every one of those measurements
  is, with `Objective.aggregate()` as the hook that combines them;
- only full-fidelity measurements enter the final ranking, so a winner is
  never declared on a reduced-fidelity rung;
- every submitted trial yields exactly one measurement, cancelled ones
  included, so the orchestrator's in-flight accounting cannot deadlock;
- results are ranked per bucket (`Trial.bucket`, named by
  `TuneTask.bucket_of`): kernel tuning gets one winner per shape or batch
  size, which is the table a kernel's config file or a dispatch heuristic
  needs, and deployment tuning is the one-bucket special case with a
  single best.yaml;
- the driver contract assumes no server: launch-command and config
  rendering are optional, and a driver that sweeps many candidates in one
  call (cutlass profiler) attaches the rest as `Measurement.discovered`,
  deduplicated by trial key.

Per-trial limits -- the timeout derived from the remaining budget, and the
strategy's prune predicate -- travel with the submission rather than being
installed on the executor, so an executor that hands work to a subprocess
or another host has nothing to look up.

Next (P1): a mock executor exercising the loop with no GPU, the `grid`
strategy, a JSONL store, the triton fused MoE kernel driver with shape
derivation from (model, tp, ep, dtype) and a per-shape JSON reporter, and
the `sglang.auto_tune --model-path --tp` front.

Co-Authored-By: Claude Opus 5 <[email protected]>
Atituiset pushed a commit to Atituiset/sglang that referenced this pull request Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

benchmark ready-for-review run-ci CI: run the baseline test suite on this PR run-ci-extra CI: also run the extra suite (requires run-ci)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant