Skip to content

Alternate run methods

Run a benchmark is the standard way: each target's benchmark harness runs on its runner host, beside its vLLM host. These are the other ways.

Run the harness on the vLLM host

A target with a runner_host runs its benchmark harness there. A target without one runs it on the vLLM host itself, reached at vllm_host (default: the target's name). To run on the vLLM host, write a target like that, with the URLs the host reaches its own vLLM at:

[[targets]]
name = "trn2-local"
base_url = "http://127.0.0.1:8000"
sidecar_url = "http://127.0.0.1:8001"
vllm_host = "<trn2-ssh-host>"

It can sit beside the runner target (trn2) in the same targets file; pick one with --only or a job's only. Everything else is as in Run a benchmark, without the runner host set-up: the vLLM hosts have Docker, and ec2-user can sudo and is in the docker group.

The harness then shares the CPUs with vLLM (CPU contention). Set client-processes low, such as 2, to leave vLLM its CPUs.

Through SSM with run-on-hosts.sh

For when SSH to the hosts isn't set up. The harness runs on each vLLM host, and the results go to S3.

How it works

deploy/client/run-on-hosts.sh runs on your workstation. Through SSM, on each vLLM host, it:

  1. Syncs the code from s3://<bucket>/src/.
  2. Mounts the instance store at /mnt/nvme (a no-op if already mounted).
  3. Starts run-local.sh as a transient systemd unit, snap-asr-bench-<run-id>, so the run doesn't depend on the SSM session. run-local.sh builds the client image and runs it against the host's own deploy/client/targets.toml.

The hosts start a few seconds apart, then run in parallel. The script waits for each one to finish and prints the end of its journal.

Pre-flight

  • Your workstation is set up as in Run a benchmark, with jq.
  • vLLM and the log sidecar are up on each host and serve the same model.
  • deploy/client/targets.toml exists on your workstation, with 127.0.0.1 URLs for targets named trn2, g4dn, g7e and g6 (Configuration). The hosts get it from the bucket.
  • Your code is synced to S3 (Deploy code via S3). The script pulls it onto each host itself.

Run

From the repository root, with AWS_PROFILE set:

BUCKET="$(terraform -chdir=terraform output -raw bucket_name)"
deploy/client/run-on-hosts.sh "s3://$BUCKET/inputs/sample.mp4" \
  --chunk-seconds 1,2,5,10 \
  --strategy independent,growing \
  --pacing realtime,afap \
  --repeats 2

For many clips, pass --manifest s3://$BUCKET/manifests/<file>.csv in place of the input, with any selection flags (Inputs and manifests). Each host reads the manifest from S3, so its media and reference paths must resolve there: S3 URIs, paths relative to the manifest's S3 prefix, or --rewrite to map other paths onto S3.

To run a benchmark plan, pass --plan resources/plans/<name>.toml with the path relative to the repository root. The plan goes to the hosts with the code synced to S3, so sync after editing it. Each host runs only its own target, so the plan's targets, only, work-dir, results-s3 and run-id are overridden by the script. A plan with on-host = true needs --no-on-host here.

Arguments go to snap-asr-bench as given (CLI). The scripts add --targets, --only, --work-dir, --run-id and --results-s3, so don't pass those. Set TARGETS="g4dn g7e" to run a subset.

Ctrl-C stops the script but not the runs. To follow or stop one, on its host, with the run ID the script prints:

sudo journalctl -u snap-asr-bench-<run-id> -f
sudo systemctl stop snap-asr-bench-<run-id>

Stopping the unit stops the client container and every process in it. The run's events.jsonl ends with run_end, stopped_by SIGTERM. The client then uploads it as usual unless docker stop's 30 seconds run out first; the file stays on the host either way.

Results

The run ID is onhost-<UTC timestamp>, then -<plan name> with --plan (the plan's file name without .toml). Each host uploads its own file:

s3://<bucket>/results/<run-id>-trn2/events.jsonl
s3://<bucket>/results/<run-id>-g4dn/events.jsonl
s3://<bucket>/results/<run-id>-g7e/events.jsonl

The local copy is at /mnt/nvme/snap-asr-bench/runs/<run-id>-<target>/ on each host.

Then check them as in Validate the results.

From the bench host

The harness runs on the bench host in us-east-1 against every target over VPC peering, so the network to each target, up to about 230 ms to trn2, is in the results. Use it for end-to-end latency, not to compare the instances: Run from the bench host.