feat(bench): add reproducible serving performance harness - #341
Open
tuxevil wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
benchmarks/bench_serving.py, a reproducible client-wall performance harness for an already-running FreeToken server./v1/messages/count_tokens./v1/chat/completionsTTFT, decode throughput, effective prefill throughput, and total latency.Motivation
FreeToken currently has serving benchmarks, but no small, generic harness that clearly separates client-observed performance from engine-internal telemetry.
This harness records measurements at the HTTP client boundary. Fields prefixed with
client_wall_include queueing, prefill, scheduling, detokenization, and SSE delivery.Design
The harness:
/health,/v1/models,/v1/cache/status, and/v1/stats.fresh→identical→small_suffixsequence.The benchmark uses explicit greedy sampling with thinking disabled so runtime measurements are not affected by reasoning nondeterminism.
Decode throughput follows the existing serving benchmark convention:
Scope
This first version intentionally:
These capabilities can build on the schema in later PRs.
Validation
PYTHONPATH=python:. uv run --no-project --with pytest pytest -q tests/benchmarks/test_bench_serving.pyuv run --no-project --with ruff ruff check benchmarks/bench_serving.py tests/benchmarks/test_bench_serving.pyuv run --no-project --with ruff ruff format --check benchmarks/bench_serving.py tests/benchmarks/test_bench_serving.pypython -m py_compile benchmarks/bench_serving.pygit diff --checkThe full repository test suite was not collected in this environment because FreeToken's runtime dependencies, including PyTorch, are not installed.