Create an algorithm benchmark
Define a dataset, score candidate outputs against reference answers and rank algorithm versions.
A saved CLI login and a CPU worker.
A benchmark freezes a dataset of test inputs and a scoring rule so you can compare algorithm versions fairly. Every evaluation runs three ordinary Program stages—candidate, evaluator, and reducer—on your existing workers.
1. Run the example benchmark
Run compute/platform/examples/benchmarks/publish.py with the text example, which runs on any CPU worker without a model checkpoint:
Tip: Using a deployed account login instead of the local dev stack? Omit
--config .local-dev/compute/client.json.
The script publishes the Programs, dataset, and benchmark definition, runs the evaluation, and prints the summary JSON:
2. Write the 3 benchmark functions
Every benchmark uses three functions (compute/platform/examples/benchmarks/jobs.py):
- Candidate (
label) — Takes one dataset item (Text) and returns a prediction (Label). - Evaluator (
score_label) — ReceivesEvaluationInput(the candidate output and reference answer) and returnsItemResultfor that item. - Reducer (
reduce_labels) — ReceivesReductionInputacross all items viaoutcomes(request)and returns the aggregateSummary.
Because candidate execution and scoring are separate Programs, your candidate can run on a GPU worker while score_label and reduce_labels run on a cheap CPU pool.
3. Score candidate failures explicitly
What happens when a candidate crashes on a difficult input? Run the numbers benchmark to see how candidate failures are scored:
In compute/platform/examples/benchmarks/jobs.py, the second item intentionally raises ValueError("synthetic candidate failure"):
score_numberchecksrequest.candidate.state == "failed", assigns the configuredfailure_penalty(100), and marks the itemoutcome="candidate_failed".reduce_numberscountsfailed_itemsalongsidermseso a candidate that crashes on hard cases cannot hide behind a low error on easy cases.
4. Inspect results and compare versions
Use ct-cli benchmark to list benchmarks, check an evaluation's status, or inspect item-level artifacts:
When you modify your algorithm, publish a new candidate version (--version 2) and run it against the same dataset and benchmark version to compare metrics directly. See Test parsers and TS strategies for the built-in chemistry benchmarks and Measure throughput and efficiency to track runtime alongside accuracy.