ask-matt
MAmattpocock/skills337k4,978 new stars in the last 7 days
Configure, run, compare, and interpret the repository's Strands Decider inference-performance benchmarks. Use for local, HTTP, or SageMaker benchmark environments; multi-model runs; throughput, latency, reliability, and cost analysis; benchmark graphs; or accepting a faster run as the new baseline. This skill covers server performance, not model correctness, quality, or ranking different compute environments against one another.
Use the benchmark suite under benchmark/. Its purpose is to measure
how an inference-server change affects each model within a fixed compute environment. Compare a
candidate only with that environment and model's accepted baseline.
Read the benchmark README before changing or running the suite. Read:
scripts/run_on_ec2.py.Do not restore or use evaluation/decider_bench.py; the current entry point is
python -m benchmark.runner.
Keep the workload and measurement settings fixed when evaluating an inference change:
The standard preset measures concurrency 1, 4, 16, and 32 twice. It uses a minimum of 16 requests per point and increases that to two complete request waves at higher concurrency: 16, 16, 32, and 64 requests respectively. The smoke preset measures one eight-request workload cycle at concurrency 1. Poisson traffic, bursts, soak tests, production datasets, and correctness evaluation are deferred.
The headline metrics are:
Treat p95 and p99 fields as diagnostics only: the current sample count is not sufficient for strong tail-latency claims.
Each compute environment has a local
benchmark/environments/<environment>/environment.yaml; the entire environments/ tree is
gitignored, and results belong under the adjacent runs/ directory. A full run benchmarks every
model listed in models sequentially. List only models the target host can actually load.
Use a managed environment for a local server:
name: local
models:
- StrandsAgents/strands-decider-2B-qwen3.5-v1-2610
endpoint: http://127.0.0.1:{port}
timeout_s: 120
lifecycle:
type: managed
command:
- strands-decider
- serve
- "{model}"
- --host
- 127.0.0.1
- --port
- "{port}"
Use lifecycle: {type: external} and an endpoint for an already-running ordinary HTTP server.
The URL must be the server root; the runner calls /health and /v1/systemone.
For SageMaker, map every model to the endpoint that serves it:
name: sagemaker-us-west-2-ml-g6-xlarge
models:
- MODEL_A
- MODEL_B
lifecycle:
type: external
sagemaker:
region: us-west-2
instance_type: ml.g6.xlarge
endpoints:
MODEL_A: ENDPOINT_A
MODEL_B: ENDPOINT_B
The runner uses boto3's credential chain and SigV4, describes each endpoint, and refuses to run if
its live instance type differs from instance_type. A single-model environment may use
endpoint_name instead of endpoints. Keep different instance types in separate environment
directories and baselines even when the models use different endpoints. profile is optional for
a named local AWS profile; omit it when the benchmark client uses an EC2 instance role.
Invoking remote endpoints can incur cost. Do not create, update, resize, or delete cloud resources without the user's explicit approval. Confirm scope and expected cost before a full paid run.
The configured AWS region selects which SageMaker API endpoint receives the requests; it does not
move the benchmark client. For latency claims, tell the user to run the benchmark from an EC2
instance in the same region as the SageMaker endpoints. Follow
references/aws.md for the setup and checks. When the user authorizes creating
a temporary load generator, use scripts/run_on_ec2.py. The script archives the selected
committed Git revision and transfers the ignored local
environment.yaml separately through its private, encrypted temporary S3 bucket.
After the remote SSM command starts, give the user the copy-paste status and live-progress
commands printed by the script; do not wait for them to ask how to monitor it.
For an external HTTP or SageMaker endpoint, use the lightweight client project so the load generator does not install PyTorch or CUDA:
PYTHONPATH=src uv run --project benchmark python -m benchmark.runner run \
ENVIRONMENT MODEL --smoke
For a managed local server, use the root project and add the applicable device extra, such as
--extra mlx on Apple Silicon.
Start with one model:
uv run --extra mlx --extra benchmark python -m benchmark.runner run ENVIRONMENT MODEL --smoke
Inspect the smoke summary for successful calibration, the expected endpoint/model/instance metadata, zero failures, and plausible latency. Then run every model configured for that host:
uv run --extra mlx --extra benchmark python -m benchmark.runner run ENVIRONMENT
Omitting MODEL means all configured models. Smoke runs require one model. --output PATH
overrides the normal result location; benchmark artifacts at that location are replaced by a
successful rerun.
The first standard run becomes the accepted baseline. A later compatible run is written to the
model's candidate/ directory. Review it with:
uv run --extra benchmark python -m benchmark.runner compare \
ENVIRONMENT MODEL benchmark/environments/ENVIRONMENT/runs/MODEL_SLUG/candidate
Update the baseline only after the performance change is understood and the reliability gate passes:
uv run --extra benchmark python -m benchmark.runner compare \
ENVIRONMENT MODEL benchmark/environments/ENVIRONMENT/runs/MODEL_SLUG/candidate \
--update-baseline
Compatibility requires the same environment fingerprint, model, workload, measurement preset, and baseline lineage. Do not work around a compatibility failure by manually copying artifacts.
A SageMaker sagemaker.region or a Lambda aws_sigv4.region selects the AWS API region but does
not relocate the benchmark process. A laptop run records the laptop-to-AWS round trip. For a
same-region latency claim, run the client in the endpoint's region.
You MUST use scripts/run_on_ec2.py for any SageMaker or Lambda benchmark. This applies to
smoke runs as well as standard runs, and to one-off exploratory invocations the moment they
produce numbers you might report. Do not:
benchmark.runner against a SageMaker endpoint or a Lambda Function URL from a laptop,
CI runner, or any machine outside the endpoint's region;lambda:AddPermission grant (and its revocation),
the no-ingress security group, the temporary private S3 bucket, and all cleanup;The only sanctioned alternative is an existing in-region EC2 that already satisfies every prerequisite in references/aws.md; if any item is unclear, use the script.
Confirm the scope and cost with the user, then run:
uv run --project benchmark python skills/benchmark-decider/scripts/run_on_ec2.py \
ENVIRONMENT MODEL \
--account ACCOUNT_ID \
--region us-west-2
Drop MODEL to run every configured model. After the SSM command starts, pass the user the
status and live-progress commands the script prints; do not wait to be asked.
For the manual client setup (minimum IAM, network, tokenizer prerequisites) and interpretation rules, read references/aws.md.
Report improvements relative to each model's baseline in the same environment. Lead with peak requests per second and concurrency-1 p50 latency; include failure rate and any OOM/crash. Explain where throughput plateaus or declines, but do not claim an absolute server ceiling if the fixed concurrency sweep never reaches one.
The suite intentionally stores aggregate results rather than raw per-request measurements. Preserve
manifest.json, summary.json, summary.csv, and the generated PNGs together so a result remains
traceable to its environment, model, workload, and code revision.
MAmattpocock/skills337k4,978 new stars in the last 7 days
MAmattpocock/skills337k4,978 new stars in the last 7 days
MAmattpocock/skills337k4,978 new stars in the last 7 days
OBobra/superpowers331k4,772 new stars in the last 7 days
AFaffaan-m/ECC315k4,381 new stars in the last 7 days
AFaffaan-m/ECC315k4,381 new stars in the last 7 days