Sub topic 12
Running a trial and recording the decision
This chapter assumes you have read the earlier chapters on the run data model, MLflow and Weights & Biases (W&B) architecture, hosting and governance, lock-in, and evaluation criteria. You should be comfortable with Python, with running a local server, and with reading a short benchmark script. By the end you will be able to run a time-boxed trial of two or three trackers, score them against criteria you set in advance, and write a decision record that others can check later.
Why a trial beats a feature table
Feature tables come from documentation. They tell you what a tool claims to do, not how it behaves with your training code, your network, your security review, and your teammates. Two trackers can both "support artifacts" and still differ greatly in how they handle a 6 GB checkpoint on a slow VPN link.
A trial replaces claims with observations from your own environment. It also limits the cost of choosing. A team that spends one week on a structured trial usually spends less than a team that spends a month in meetings and then migrates later.
A trial answers a different question than the evaluation criteria chapter did. The criteria chapter told you what to weigh. The trial gives you the evidence to fill in the weights.
Set the rules before you start
Most failed trials fail at the start. Without rules written down first, the tool that someone already likes tends to win.
Fix these items before anyone logs a single run:
- Candidates. Pick two or three. Include the tool you would choose by default, so the trial can confirm or overturn it.
- Time box. Five working days is enough for most teams. Stop at the deadline even if some questions are open, and record them as open.
- Participants. Use at least two people, and include one who did not pick a favorite. One person's habits should not decide the result.
- Workload. Use a real training script from your team, not a tutorial notebook. Add a second, synthetic workload for measuring overhead.
- Must-have criteria. These are pass or fail. Examples are "data stays in our cloud account" or "single sign-on works". A candidate that fails one is out, whatever its score.
- Weighted criteria. These are scored. Assign weights that sum to 100 before you see any results.
What to test
Choose tests that expose differences. Logging a loss curve works in every tracker, so it tells you nothing. The tests below target the places where trackers diverge.
| Area | Test to run | Evidence to keep |
|---|---|---|
| Instrumentation effort | Add tracking to your real training script. | Lines changed, time taken, and which parts needed workarounds. |
| Logging overhead | Log 2,000 metric points and time the run. | Median seconds over several repeats. |
| Failure behavior | Cut the network or stop the server mid-run. | Whether training continued, crashed, or lost data. |
| Comparison | Have a teammate find the best of 20 runs without your help. | Time to answer and what they struggled with. |
| Artifacts | Upload and download a realistic checkpoint. | Upload time, size limits, and how versions are named. |
| Access control | Create a user who must see only one project. | Whether the tool could enforce it and how much setup it took. |
| Export | Pull all runs, parameters, and metrics out through the API. | Whether the export was complete and how long it took. |
| Cost | Estimate users, run volume, and storage for 12 months. | A number with the assumptions written next to it. |
The export test matters most for lock-in. If you cannot get your history out during a trial with five runs, you will not get it out after five thousand.
Measure logging overhead
Overhead is easy to measure and often misreported. Some clients send data in a background process, so the time spent inside the logging call can look tiny while the real work happens later. To compare fairly, time the whole run, including the call that ends it.
The script below logs the same synthetic loss curve to MLflow and to W&B and reports the median time over three repeats. It assumes an MLflow server is running at 127.0.0.1:5000, as in the earlier chapter, and that you have already run wandb login. If you want to exclude the network from the W&B measurement, set the environment variable WANDB_MODE=offline. Note that this changes what you are measuring, so record it.
import statistics
import time
import mlflow
import wandb
N_STEPS = 2000
REPEATS = 3
def loss_curve():
for step in range(N_STEPS):
yield step, 1.0 / (step + 1)
def run_mlflow() -> float:
mlflow.set_tracking_uri("http://127.0.0.1:5000")
mlflow.set_experiment("tracker-trial")
start = time.perf_counter()
with mlflow.start_run(run_name="overhead"):
mlflow.log_param("n_steps", N_STEPS)
for step, loss in loss_curve():
mlflow.log_metric("loss", loss, step=step)
return time.perf_counter() - start
def run_wandb() -> float:
start = time.perf_counter()
run = wandb.init(
project="tracker-trial",
name="overhead",
config={"n_steps": N_STEPS},
)
for step, loss in loss_curve():
run.log({"loss": loss}, step=step)
run.finish()
return time.perf_counter() - start
def median_seconds(fn) -> float:
return statistics.median(fn() for _ in range(REPEATS))
if __name__ == "__main__":
print(f"mlflow: {median_seconds(run_mlflow):.2f} s for {N_STEPS} points")
print(f"wandb: {median_seconds(run_wandb):.2f} s for {N_STEPS} points")Interpret the numbers against your real training loop, not in isolation. If your model takes 0.5 seconds per step and a logging call takes 5 milliseconds, the overhead is about one percent and does not matter. If you log every step of a loop that takes 20 milliseconds, the same call costs 25 percent, and you should log less often or batch.
Test failure behavior on purpose
Trackers fail in different ways. In the middle of a long run, stop the MLflow server or disconnect the network, wait a minute, and restore it. Then record three facts:
- Did the training process keep running, or did it raise an exception?
- After the connection returned, did the missing metrics appear?
- Was any run left in a "running" state with no way to close it?
A tracker that crashes a 40-hour training job because a logging call timed out is a real operational risk, even if it scores well everywhere else. You can contain that risk by wrapping tracker calls in your thin interface and catching errors there, but you should know whether you need to.
Score with evidence
After the workload runs, score each weighted criterion from 0 to 5. Next to each score, write one sentence of evidence. A score with no evidence is an opinion, and it will not survive a reviewer's question.
Multiply each score by its weight and sum. The example below uses invented numbers to show the shape of the table. Your criteria and weights will differ.
| Criterion | Weight | Candidate A | Candidate B | Evidence for the difference |
|---|---|---|---|---|
| Data stays in our cloud account | 25 | 5 | 3 | A runs in our VPC. B needs a paid self-hosted plan. |
| Run comparison and sharing | 20 | 3 | 5 | A teammate found the best run in 2 minutes in B and 9 in A. |
| Artifact and model registry | 20 | 4 | 4 | Both stored a 2 GB checkpoint and listed versions. |
| Setup and operations effort | 15 | 2 | 5 | A needed a database, object store, and auth proxy. |
| Lock-in and export | 10 | 5 | 3 | A exported every run in one script. B's export missed some artifacts. |
| Estimated 12-month cost | 10 | 4 | 3 | See cost sheet, assuming 12 users and 40,000 runs. |
In this invented example, Candidate A scores 3.85 and Candidate B scores 3.95 on a 0 to 5 scale (a weighted sum divided by 100). That is too close to settle on arithmetic alone. When totals are within about half a point, treat them as a tie and decide on the criterion that matters most to your team, which you should be able to name.
Be suspicious of a result that feels too clean. If one candidate wins every row, check whether the criteria were written to describe that tool.
Common errors in trials
- Comparing different workloads. If one tool logs system metrics and the other does not, overhead is not comparable. Log the same set of values.
- Trialing on toy data. Small runs hide problems with large artifacts, large numbers of runs, and slow dashboards.
- Letting the free tier decide. A free plan may lack single sign-on, audit logs, or private projects. Check which plan you actually need before you cost it.
- Skipping the second user. Many problems show up only when someone other than the setup person opens the UI, such as permissions and unclear naming.
- Counting setup time as a one-off. A self-hosted server needs upgrades, backups, and an owner. Add that ongoing time to the cost.
- Changing criteria after seeing results. If you discover a new criterion, add it, state that it was added late, and score all candidates on it.
Write the decision record
A decision record is a short document that explains what you chose, why, and what would change your mind. It is useful on the day you write it and more useful a year later, when someone asks why the team uses this tool. Store it in the repository, next to the code that depends on it.
Keep it to one page. This template covers the parts that matter:
# Decision: experiment tracker
- Date: 2026-12-04
- Status: accepted
- Decided by: ML platform team
- Review date: 2027-06-01
## Context
We need one tracker for 12 users training tabular and NLP models.
Trial ran 2026-11-30 to 2026-12-04 with three people.
## Options considered
MLflow (self-hosted), Weights & Biases (hosted), Aim (self-hosted).
## Decision
Use MLflow self-hosted, behind a Tracker interface in `tracking/`.
## Reasons
- Must-have met: data stays in our cloud account.
- Highest lock-in score: full export tested on 20 runs.
- Weaker comparison UI accepted; see mitigation below.
## Trade-offs accepted
- We own upgrades and backups. Owner: platform team.
- Comparison UI is slower for large sweeps.
## Evidence
Scores, timings, and notes: `docs/tracker-trial/`.
## What would change this decision
- Sweep comparison remains a daily complaint after 3 months.
- Hosting effort exceeds 2 engineer-days per month.
- Governance rules change to allow a hosted service.
## Exit plan
Export script `tools/export_runs.py` and the adapter layer limit
migration to writing one new adapter and re-importing history.Three sections carry most of the value. "Trade-offs accepted" shows you saw the weaknesses. "What would change this decision" turns a permanent verdict into a hypothesis with conditions. "Exit plan" ties back to the thin interface from the lock-in chapter and shows that the decision is reversible.
After the decision
A decision record does not finish the work. Do these things in the following weeks:
- Put the tracker calls behind your interface, so that training code never imports the tracker directly.
- Write down naming rules for experiments, runs, and tags, such as
data_versionandgit_commit. Without them, any tracker becomes a pile of unlabeled runs. - Assign an owner for hosting, upgrades, and access requests, even if it is a hosted service.
- Put the review date in a calendar. At the review, check the "what would change this decision" list against what happened.
Exercises
Exercise
Your overhead test shows W&B finishing 2,000 log calls in 0.4 seconds and MLflow taking 6 seconds against a remote server. A colleague concludes that W&B has far lower overhead. What should you check before accepting that, and what change to the script fixes the comparison?
Show answer
Check whether the timing includes the work the client does after the logging calls return. Some clients buffer data and send it in a background process, so the time inside the log calls understates the cost. The script should time the whole run, including run.finish() for W&B and the end of the with block for MLflow. Also confirm that both tools ran from the same machine, over the same network, with the same set of logged values, and that W&B was not in offline mode unless you meant to exclude the network.
Exercise
Two candidates score 3.85 and 3.95 on your weighted matrix. A third teammate asks you to add a new criterion, "has a dark mode", after seeing the results. How should you handle the tie and the late criterion?
Show answer
Treat totals within about half a point as a tie. Break the tie on the criterion that matters most to the team, or on which option is easier to leave. Add the late criterion only if it matters, label it as added after results, give it a weight, and score all candidates on it. If its weight is small, it should not decide the outcome. Record both the tie and the reasoning in the decision record.