brixbench is a Go test based benchmark harness for comparing AIBrix-routed
and direct-engine serving paths with reproducible scenario YAML and shared
result artifacts.
- Go 1.22 or newer
kubectlonPATH- Access to the target Kubernetes cluster through the active kubeconfig context
- Permission to create, update, list, watch, and delete resources in the benchmark namespace
- Optional:
uv,.venv, andmatplotlibfor comparison figure generation
Quick cluster preflight:
kubectl config current-context kubectl auth can-i create pods -n brixbench-adhoc kubectl auth can-i delete namespace brixbench-adhoc kubectl auth can-i create pods -n brixbench-dynamo kubectl auth can-i delete namespace brixbench-dynamo kubectl get ns
Each benchmark run is driven by a scenario file under benchmark/testdata/scenarios/.
Each scenario test case wires together three kinds of inputs:
engine.manifest: Kubernetes workload manifest for the model serving path.benchmark: Request workload YAML consumed by the benchmark client.gateway: Optional AIBrix gateway image, environment, or resource overrides.
The runner deploys the selected serving path, waits for readiness, runs the
benchmark client in the cluster, persists artifacts, and then tears down the
run-scoped benchmark namespace. AIBrix and direct vLLM runs use
brixbench-adhoc; Dynamo runs use brixbench-dynamo.
By default, the runner resets the benchmark namespace before each test case and
cleans it up after the case finishes. Set BENCHMARK_RESET_BEFORE_TEST=false
or pass -benchmark.reset=false to reuse the existing benchmark namespace at
the start of a case. Set BENCHMARK_CLEANUP_AFTER_TEST=false or pass
-benchmark.cleanup=false to leave resources in place after a test case
finishes. Use both options together when you want to preserve an existing
deployment across a benchmark run.
Scenario: aibrix-batching-comparison Tests: - name: aibrix-v0.6.0-disaggregated provider: aibrix fullstack: false version: v0.6.0 engine: type: vllm manifest: testdata/deployments/aibrix/models/pd-model.yaml benchmark: testdata/benchmarks/vllm-chat-smoke-pd.yaml gateway: env: ROUTING_ALGORITHM: pd resources: - testdata/deployments/aibrix/gateway/overrides/gateway-plugins-scaleup.yaml
Important scenario fields:
provider: aibrix: use the AIBrix deployer.provider: null: use the plain vLLM direct baseline.fullstack: false: reuse an existing shared AIBrix control plane and update only run-scoped workloads and gateway overrides.fullstack: true: reinstall the AIBrix control plane from the checked-out workspace and Helm chart.version,commit, orlocalPath: choose the AIBrix source or release input.engine.type: currentlyvllmfor supported benchmark paths.engine.manifest: model deployment manifest.benchmark: request workload config.
The benchmark field points to the request-side workload YAML. This is where
RPS, concurrency, arrival rate, dataset shape, and routing-specific benchmark
settings live. It is separate from engine.manifest, which only describes how
to deploy the model workload.
Example benchmark config:
kind: vllm-bench execution: cluster image: aibrix-public-release-cn-beijing.cr.volces.com/aibrix/vllm-bench:v0.21.0-20260521 namespace: brixbench-adhoc podName: vllm-bench-client modelHostPath: /data01/models rootHostPath: /root artifacts: resultFilename: bench_results.json logDir: testdata/logs vllmArgs: base-url: http://aibrix-gateway-plugins.aibrix-system.svc.cluster.local:10080 endpoint: /v1/chat/completions backend: openai-chat model: qwen3-8b tokenizer: /data01/models/Qwen3-8B num-prompts: 200 request-rate: 16 concurrency: 32 metric-percentiles: 50,90,95,99 percentile-metrics: ttft,tpot,itl,e2el goodput: tpot:250 routing-strategy: pd dataset-name: prefix_repetition prefix-repetition-num-prefixes: 20 prefix-repetition-prefix-len: 6000 prefix-repetition-suffix-len: 2000 prefix-repetition-output-len: 1024
Key request-side fields:
base-url: Gateway or direct service endpoint used by the benchmark client. The runner can override this with the resolved serving endpoint at runtime.endpoint: OpenAI-compatible API path, such as/v1/chat/completions.model: Served model name sent in benchmark requests.num-prompts: Total number of benchmark requests.request-rate: Target request arrival rate used byvllm bench serve.concurrency: Maximum in-flight request concurrency.dataset-name: Workload generator, such asrandomorprefix_repetition.goodput: Optional latency SLO expression used byvllm benchreporting.routing-strategy: Optional routing label for routing-specific benchmark cases.prefix-repetition-*: Prefix-repetition dataset shape for shared-prefix workload tests.
Existing request workload examples:
benchmark/testdata/benchmarks/vllm-chat-smoke.yamlbenchmark/testdata/benchmarks/vllm-chat-smoke-pd.yamlbenchmark/testdata/benchmarks/routing/*.yaml
Run from the brixbench/ directory:
export BENCHMARK_SCENARIO=testdata/scenarios/aibrix-batching-comparison.yaml go test -v -count=1 -timeout 30m ./benchmark/...
Run one scenario directly:
go test -v ./benchmark -run TestAIBrixBenchmarkSuite -scenario testdata/scenarios/aibrix-hello-world.yaml -count=1Keep resources after the run for inspection:
BENCHMARK_CLEANUP_AFTER_TEST=false go test -v ./benchmark -run TestAIBrixBenchmarkSuite -scenario testdata/scenarios/aibrix-hello-world.yaml -count=1Reuse existing benchmark namespace resources and keep them after the run:
BENCHMARK_RESET_BEFORE_TEST=false BENCHMARK_CLEANUP_AFTER_TEST=false go test -v ./benchmark -run TestAIBrixBenchmarkSuite -scenario testdata/scenarios/aibrix-hello-world.yaml -count=1Run a single test case:
go test -v -count=1 -timeout 30m -run 'TestAIBrixBenchmarkSuite/aibrix-v0.6.0-disaggregated$' ./benchmark/...
For provider: aibrix, the runner supports these source modes:
version: download release artifacts on demand into.tmp/releases/.commit: check out the requested AIBrix source revision and use the workspace chart/overlays.localPath: stage a local AIBrix source tree and use its workspace chart/overlays.
The benchmark suite should not check in large generated AIBrix core/dependency manifests. Version-based runs should use downloaded release artifacts, and source-based runs should use the checked-out workspace and Helm chart path.
For provider: dynamo, the runner currently supports:
version: stable Dynamo release tag input only, normalized asvMAJOR.MINOR.PATCHengine.manifest: user-providedDynamoGraphDeploymentmanifest
provider: dynamo rejects commit, localPath, and controlplane.
provider: dynamo is a release-based path:
- validate the requested release tag against
https://github.com/ai-dynamo/dynamo.git - check out
.tmp/dynamo/<version> - prepare Helm dependency repositories and run
helm dependency build --skip-refreshfordeploy/helm/charts/platform - install the Dynamo platform chart into
brixbench-dynamowith operator namespace restriction enabled and default platform values - apply the user-provided engine manifest, which may include prerequisite resources such as PVCs or PodMonitors
- wait for Frontend service, component pods, and OpenAI-compatible model/inference readiness when the model name can be inferred
Dynamo platform is installed with Helm. The serving/runtime image is selected by
the DynamoGraphDeployment manifest, not by the platform chart alone.
The provider writes minimal default platform values and leaves image
repositories, workload placement, storage layout, and RDMA settings to the
scenario's platform.valuesFile or engine.manifest.
Dynamo's platform chart configures the operator; for example,
dynamo-operator.dynamo.mpiRun.secretName controls the operator-managed MPI
SSH key secret name.
Example scenario:
Scenario: dynamo-example Tests: - name: dynamo-v1.2.1-custom-graph provider: dynamo version: 1.2.1 engine: type: vllm manifest: path/to/your-dynamo-graph-deployment.yaml benchmark: path/to/your-vllm-benchmark.yaml
The checked-in dynamo-hello-world-vke.yaml scenario is a VKE validation
sample. It uses AIBrix CN mirror images, VKE node selectors, RDMA resources,
local model paths, and PodMonitor resources. Run it only on a matching cluster:
go test -v ./benchmark -run TestAIBrixBenchmarkSuite \
-scenario testdata/scenarios/dynamo-hello-world-vke.yaml \
-count=1 -timeout 90mThese requirements apply to the machine where go test, git, helm, and
kubectl run. They are separate from cluster-side scheduling or storage
requirements.
gitonPATHhelm3.x onPATHkubectlonPATH- writable workspace cache under
.tmp/dynamo/ - writable isolated Helm state under
.tmp/dynamo-helm/ - active kubeconfig context that can reach the target cluster
- outbound HTTPS access to:
github.comfor Dynamo tag lookup and release checkoutnats-io.github.iofor the NATS Helm repocharts.bitnami.comfor the Bitnami Etcd chartghcr.iofor OCI-hosted dependencies such askai-schedulerandgrove
Why this matters:
helm dependency buildruns on the current server, not inside the cluster- if the current server cannot fetch remote Helm repo
index.yamlfiles or OCI artifacts, deployment fails before any Dynamo workload is created in the cluster
Quick local preflight:
git ls-remote --tags --refs https://github.com/ai-dynamo/dynamo.git refs/tags/v1.2.1 helm version kubectl config current-context
These requirements apply after the platform chart has been downloaded and Helm starts creating resources in Kubernetes.
- permission to create, list, watch, patch, and delete resources in
brixbench-dynamo - permission to create any prerequisite resources included by the user-provided engine manifest, such as model PV/PVCs or PodMonitors
- permission for the Dynamo operator to create or replicate its MPI SSH Secret when multinode components require it
- if the engine manifest includes PodMonitors: the
podmonitors.monitoring.coreos.comCRD must already be installed - cluster capacity for Dynamo platform dependencies such as NATS
- image pull access for platform and engine images referenced by the chart and
engine.manifest - for private registries: configure image pull secrets in
platform.valuesFileor the user-providedDynamoGraphDeployment; brixbench does not create registry credentials. - if the engine manifest expects a
models-pvcbacked by local model files: define the PV/PVC in the engine manifest or create the PVC outside brixbench. - any cluster-specific networking, RDMA, nodeSelector, and runtime image settings
required by the user-provided
DynamoGraphDeployment
Typical failure split:
helm dependency buildfails:- current server to remote Helm repo or OCI registry problem
helm upgrade --install ... --waitfails:- cluster-side scheduling, storage, image pull, or readiness problem
Metrics export is disabled by default.
- Without
BENCHMARK_PUSHGATEWAY_URL, the runner skips external metric export. - With
BENCHMARK_PUSHGATEWAY_URL, the runner enables the Pushgateway exporter. - The current Pushgateway exporter returns an explicit not-implemented error until real export behavior is implemented.
The runner creates Prometheus Operator PodMonitor resources for benchmark
workloads after the serving deployment becomes ready. This is separate from the
benchmark result Pushgateway export above: PodMonitoring lets Prometheus or VMP
scrape serving workload /metrics endpoints for Grafana dashboards.
PodMonitoring is enabled by default. Disable it with either option:
BENCHMARK_POD_MONITORING=false go test -v ./benchmark -run TestAIBrixBenchmarkSuite -count=1 go test -v ./benchmark -run TestAIBrixBenchmarkSuite -benchmark.pod-monitoring=false -count=1
By default, missing PodMonitor CRDs or apply permission errors are logged as warnings so benchmark execution can continue. Use strict mode when dashboard metric collection is required for validation:
BENCHMARK_POD_MONITORING_STRICT=true go test -v ./benchmark -run TestAIBrixBenchmarkSuite -count=1Created PodMonitors are labeled with volcengine.vmp=true and
brixbench.aibrix.ai/managed=true. For the integrated benchmark dashboard,
select datasource AIBrix_Benchmark and keep vllm_job as All; plain vLLM
and AIBrix StormService vLLM metrics are relabeled to job=brixbench-vllm.
Custom engine manifests must expose the metrics-serving container port with the
name expected by the generated PodMonitor. For vLLM and AIBrix vLLM profiles,
brixbench generates PodMonitors with podMetricsEndpoints.port: http, so the
serving container must declare a named port:
ports: - name: http containerPort: 8000
Without this named container port, the PodMonitor resource may be created successfully, but Prometheus Operator may not discover a valid scrape target.
Useful checks:
kubectl get podmonitor -n brixbench-adhoc -l brixbench.aibrix.ai/managed=true kubectl get podmonitor brixbench-aibrix-vllm-metrics -n brixbench-adhoc -o yaml
Run artifacts are written under:
benchmark/testdata/logs/<timestamp>-<zone>-<scenario>/
The <zone> token comes from BENCHMARK_TIMEZONE (IANA name such as
Asia/Shanghai or UTC). When unset, the runner uses the host local
timezone. The abbreviation is sanitized for path safety (for example
Asia/Shanghai → cst). The same location also shapes the scenario
run_id used for local logs and TOS publish paths.
Typical artifacts include:
metadata.jsonsummary.jsonsummary.csv- per-case
bench_results.json - per-case
vllm-bench-client.log - per-case
vllm-bench-pod.yaml - optional comparison figures under
figures/
By default, AIBrix scenarios that resolve a workspace commit build the gateway image locally. To skip that build in CI (or when an image is already published), set:
export BENCHMARK_GATEWAY_IMAGE=registry.example/aibrix/gateway:my-tag # optional: full 40-char commit SHA recorded as the run's resolved commit # and written to aggregate CSV platform_commit / series_label export BENCHMARK_GATEWAY_COMMIT=01ce8b3a1b2c3d4e5f678901234567890abcdef0 go test -v ./benchmark -run TestAIBrixBenchmarkSuite \ -scenario testdata/scenarios/<scenario>.yaml -count=1
BENCHMARK_GATEWAY_COMMIT requires BENCHMARK_GATEWAY_IMAGE. When only
the image is set, the runner still uses the prebuilt image but keeps the
commit resolved from the scenario (version / commit / workspace).
For commit-based AIBrix scenarios, BENCHMARK_GATEWAY_COMMIT pins the
workspace checkout to the exact commit used by the prebuilt image. For
version-based scenarios, the release tag remains authoritative and a
prebuilt commit that does not match the resolved tag commit is rejected.
Aggregate CSV labels distinguish these modes: commit-based AIBrix runs are
shown as main@<short-commit>, while version-based runs are shown only by
their release tag (for example, v0.6.0).
Artifacts remain local by default. Publish a completed scenario to TOS only for an official or explicitly shared result:
BENCHMARK_PUBLISH_RESULTS=true \
go test -v ./benchmark -run TestAIBrixBenchmarkSuite \
-scenario testdata/scenarios/dynamo-hello-world.yaml -count=1The default destination is
tos://aibrix-artifact-testing/benchmarks/brixbench-results/runs/<run_id>/.
Use BENCHMARK_TOS_BUCKET and BENCHMARK_TOS_PREFIX to override it, and set
BENCHMARK_PUBLISH_TIER to minimal, standard (default), or full.
Publishing uses the S3-compatible TOS API (aws-sdk-go-v2), matching the
Python TOSDownloaderV2 / S3BaseDownloader pattern so the same client works
against public Volcengine TOS and (with the right endpoint) internal
S3-compatible TOS. Set credentials via environment variables (never commit
them). If both TOS_ACCESS_KEY and TOS_SECRET_KEY are unset, the AWS default
credential chain is used (IRSA / instance profile / ~/.aws).
export TOS_ACCESS_KEY=... export TOS_SECRET_KEY=... # optional overrides: # export TOS_ENDPOINT=https://tos-s3-cn-beijing.volces.com # export TOS_REGION=cn-beijing # export TOS_S3_FORCE_PATH_STYLE=true # some internal S3 endpoints
A TOS-native host (https://tos-cn-beijing.volces.com) is rewritten to the S3
API host (tos-s3-…) automatically. Do not put TOS credentials, kubeconfigs,
or secret values in scenario files or the repository. Scenario inputs are
copied with common secret fields redacted before upload.
Per-run artifacts use PutObject. The top-level aggregate CSV
(aggregates/benchmark_metrics.csv) is updated by downloading the existing
object (if any), appending rows, and PutObject again — S3 has no native
AppendObject. Prefer a single publisher at a time for that object.
An upload failure is a warning by default and leaves the local artifacts
intact. CI should use BENCHMARK_PUBLISH_STRICT=true; it retries failed object
uploads three times and fails the benchmark test if publishing is incomplete.
The scenario YAML does not control publishing.
If brixbench/.venv/bin/python and matplotlib are available, the Go runner
generates figures automatically after writing the scenario summary.
Manual setup:
uv venv .venv
source .venv/bin/activate
uv pip install matplotlibIf a run logs that figure generation was skipped because
.venv/bin/python is not available, recreate the local plotting environment:
rm -rf .venv uv venv .venv uv pip install matplotlib
Manual regeneration:
.venv/bin/python benchmark/plot_summary_vllm_bench.py \ benchmark/testdata/logs/<timestamp>-UTC-<scenario>/summary.csv
If a run stalls before benchmark execution, check pending model pods:
kubectl get pods -n brixbench-adhoc kubectl describe pod -n brixbench-adhoc <pending-pod-name> kubectl get pods -n brixbench-dynamo kubectl describe pod -n brixbench-dynamo <pending-pod-name>
Common causes include insufficient GPU capacity or a missing shared AIBrix
control plane when using fullstack: false.