TAI BUI
Back to curriculum
BuildPython

Building a Complete LLM Pipeline

Lessons 01 to 12 are each one stage of one pipeline. This capstone wires them into a single end-to-end run: tokenize, pre-train, scale, SFT, align, evaluate, quantize, serve. You will not train a 70B model on a laptop. You will build the orchestration layer, the manifest, the eval gate, and the rollback plan that a 2026 frontier team uses to decide what ships.

TIME: ~120 minutesPREREQUISITES: All Phase 10 lessons 01-12

Learning Objectives

  • Compose the eleven prior lessons (tokenizer, data, pre-training, scaling, SFT, RLHF, DPO, CAI, eval, quantization, inference) into a single reproducible pipeline spec
  • Define the artifact contract between stages: what each stage consumes, what it produces, and how the next stage verifies its input
  • Build an orchestrator that tracks experiments, hashes artifacts, and gates ship decisions on eval thresholds
  • Design the rollback plan: which artifacts are cheap to re-run, which are expensive, and what a corrupted checkpoint costs

The Problem

Each previous lesson works on its own. The tokenizer trains, the tiny GPT pre-trains, the SFT dataset gets assembled, the reward model learns, DPO runs, evals score, the weights quantize, and an inference server comes up. Each of those is a notebook with its own conventions, output paths, and seed.

A frontier training run is not a notebook. Llama 3 405B took 30 million H100 hours over roughly 54 days. DeepSeek-V3 used around 2.8 million H800 hours. Over a span like that, one corrupted checkpoint, one data contamination, or one eval regression can cost a team a week of wall-clock and a month of GPU budget. Teams survive through pipeline hygiene: each stage has a deterministic input, a deterministic output, a manifest, a hash, and a gate.

This is the capstone, and you will not run it end-to-end on a laptop. You will write the orchestrator that coordinates the stages, the manifest that describes the run, the verifier that gates ship decisions, and the replay plan that lets a third party re-run your work from a single file. The code is small. The discipline is large.

The pattern holds from 100M to 1T parameters. The same four components (manifest, orchestrator, eval gate, artifact store) run Llama 3 and a hobby GPT alike. What changes is the size of the numbers inside each stage's config, not the shape of the pipeline.

Warm-up0/3
1. Which ordering of Phase 10 stages is correct for a full pipeline?Warm-up
Eight pipeline stage names (Alignment, Data, Eval, Pre-training, Quantization, Serving, SFT, Tokenizer) listed alphabetically in a grid, next to 8 numbered blank slots for the correct order.
The stage names, alphabetized so their listed order gives no hint about the pipeline order.
2. Why must evaluation data be kept out of the training data?Warm-up
Two overlapping sets, training data and eval (benchmark) data, with the overlap region marked as a blank, and a question about what that overlap does to a benchmark score.
A generic training-set and eval-set overlap, with no lesson terms used.
3. What does quantizing a model's weights trade away?Warm-up
Two bars comparing FP16 at 16 bits per weight against INT4 at 4 bits per weight, the second noted as smaller and faster to serve, with a blank for what is given up.
Bit widths are general facts about number storage, not specific to this lesson's code.

The Concept

The Twelve Stages

Each Phase 10 lesson is one stage. Here is the dependency graph.

Mermaid diagram

Stages 07 and 08 can run in parallel, and so can 10 and 11, since both only read the stage 09 policy. The rest is a chain. A change in stage 02 (tokenizer) invalidates every downstream artifact. A change in stage 10 (eval) invalidates only the ship decision.

The Manifest

A manifest is a single file that describes a run well enough to replay it. Nothing the pipeline produces should depend on state outside it. The fields are boring and mandatory.

pipeline_version: 1.2.3
seed: 42
git_commit: a1b2c3d4
stages:
  01_tokenizer:
    recipe: bpe_32k
    input_hash: sha256:...
    output_hash: sha256:...
    wall_clock_sec: 3600
    cost_usd: 12

The output hash of stage N is the input hash of stage N+1, and a mismatch halts the pipeline. That is how you catch data corruption early. It is also how a teammate on a different continent checks that their replay produced the same artifact as yours.

In practice teams use a small YAML schema plus a manifest checker that diffs against the previous successful run. A delta outside the expected fields (cost, wall clock) is a red flag.

Artifact Typing

Each stage's output is a typed artifact: a named type with a known schema, not a directory blob or a pickle.

StageArtifact TypeKey Fields
01-02Tokenizervocab.json, merges.txt, config.json, hash
03Datasetshards[], row count, token count, dedup stats
04-05Checkpointweights.safetensors, config.json, optimizer state, step count
06SFT Modelcheckpoint + SFT recipe + data mix
07Reward ModelRM checkpoint + preference data hash
08-09Policycheckpoint + reference hash + beta + KL budget consumed
10Eval Reportbenchmark scores + regression diffs + eval data hash
11Quantized Modelquantized weights + calibration data + accuracy delta vs FP16
12Server Specendpoint + model hash + config + observability hooks

Typing prevents the most common failure, which is using a stage 08 output as a stage 06 input and shipping a DPO-trained model through the SFT path. With typed artifacts and typed stage signatures, that mistake becomes a compile-time failure instead of a day-five one.

The Eval Gate

Shipping does not mean training finished. It means training finished and the eval gate passed. You define the gate before the run starts.

gates:
  mmlu:      >= baseline + 0.5   # no regression
  humaneval: >= baseline + 1.0
  truthfulqa: >= baseline         # no drop
  safety_refusal_rate: <= 0.05
  kl_from_reference: <= 25.0
  cost_total_usd: <= 50000

Each gate is a numeric threshold. There are no "looks good" gates and no subjective sign-offs. If the gates pass, the artifact is marked shippable. If one fails, the run is held until a named reviewer overrides it, and that override is logged in the manifest.

Two gates catch most disasters. A regression gate (the new model must match or beat the previous one on core benchmarks) catches training bugs. A KL budget gate (the aligned policy must stay within X of its reference) catches alignment overcooking. Production pipelines tend to carry both.

The Orchestrator

A small piece of code that reads the manifest, dispatches stages, tracks artifacts, and halts on a contract violation. It is not Airflow and it is not Kubeflow. For pipeline hygiene you want something boring that you wrote yourself.

The job is narrow:

  1. Resolve the DAG from the manifest.
  2. For each stage, check whether the expected output already exists at the correct hash (skip if so).
  3. Run the stage, capture stdout/stderr, and measure wall clock and cost.
  4. Verify the output hash against the downstream stage's expected input hash.
  5. On failure, write a partial manifest with the exact failing stage and exit nonzero.

That is a couple hundred lines of Python, and code/main.py in this lesson is a simulated version of it. In a real pipeline, torchrun or ray executes the individual stages on clusters, while the orchestrator itself runs on a single box.

Experiment Tracking and Artifact Storage

Two external systems anchor the pipeline.

Experiment tracker (wandb, neptune, mlflow). Logs loss curves, eval metrics, and system telemetry per stage. This is where you go to compare run A against run B three weeks later. Teams mostly use a hosted tracker, because writing your own eats time that belongs to training.

Artifact store (S3, R2, GCS). Immutable object store for checkpoints, datasets, tokenizers, and eval reports. Artifacts are addressed by hash, not by filename. A filename like latest.pt is a foot-gun, while ckpt-7b-step-20000-sha256:abc123.safetensors is a contract.

The orchestrator writes to both. The tracker is for humans looking at charts, and the artifact store is for the next stage looking up its inputs.

Costing

A frontier run has a dollar number attached, and budget discipline happens in two places.

Pre-run estimate. From the manifest, compute expected FLOPs (for pre-training: 6 x params x tokens), expected GPU hours (FLOPs / peak throughput / utilization), and dollar cost at the current rental rate. If the estimate exceeds the budget gate, the pipeline refuses to start.

In-run tracking. Log wall clock and cost to the manifest stage by stage, and check the remaining budget after each one. If a stage overran, the next stage's gate is evaluated against the new remaining budget. You do not want to find out you are out of money when the VC calls.

Llama 3's reported cost was $61M. DeepSeek-V3 reported $5.6M for the main pre-training run. The gap is mostly hardware efficiency plus mixture-of-experts, and the specific cost is visible because both teams tracked it per stage, not per run.

Reproducibility vs Determinism

These are different things. Reproducible means the same manifest, code, and infrastructure produce a checkpoint with equivalent downstream metrics. Deterministic means bit-identical output.

Modern LLM training is reproducible but not deterministic. Distributed reduce-order, GPU kernel non-determinism (cuBLAS, flash-attn), and mixed precision rounding combine to give floats that differ at the 1e-5 level between runs. The final metrics do not move, so this is fine. It hurts only if you try to debug with bit-level diffs. The fix is to log each stage's input hash, output hash, and headline metrics. If those match, the run is "reproduced" even when the weights are not bit-identical.

Mermaid diagram

Rollback Plan

Before the run starts, write down what happens when each stage fails. There are three categories.

  • Cheap to re-run (hours): tokenizer, eval, quantization, inference server. Just re-run.
  • Medium (days): SFT, DPO, CAI. Keep the base model and re-run only the alignment stages.
  • Expensive (weeks and millions of dollars): pre-training. Here the plan is not "re-run." It is "use the last good checkpoint and re-run the cheaper downstream stages with revised data."

Because stage dependencies are typed and hashed, the orchestrator can compute the rollback set automatically: invalidate the failed stage plus its descendants. A failure at stage 06 (SFT) invalidates 06, 07, 08, 09, 10, 11, 12. A failure at stage 11 (quantization) invalidates only 11 and 12. Settle this up front so nobody improvises while the team is exhausted at 4am.

Production Recipes Observed in 2026

Most frontier teams converged on the same skeleton.

  • Tokenizer: 128k BPE with byte fallback. Trained on a small, balanced multilingual slice.
  • Pre-training: 10-20T tokens, mostly web plus code plus synthetic. Muon or AdamW optimizer. FSDP2 or DeepSpeed ZeRO-3. Gradient checkpointing. BF16 weights, FP32 master.
  • SFT: 500k-2M instruction pairs, mixed human and synthetic, with strict dedup against the eval set.
  • Alignment: DPO or CAI + GRPO. RLHF only where the preference signal is too multidimensional for DPO.
  • Eval: MMLU-Pro, MATH, HumanEval+, GPQA, SWE-Bench Verified, LiveBench, plus a private held-out set the public never sees.
  • Quantization: 4-bit GPTQ or AWQ for serving, 8-bit for safety evals where accuracy deltas matter.
  • Serving: vLLM, TensorRT-LLM, or in-house. Continuous batching. Speculative decoding. KV cache eviction.

The numbers change every six months. The skeleton does not.

Check: The Concept0/33
1. What is a manifest in this pipeline?Define
The manifest's real fields from The Manifest section: pipeline_version, seed, git_commit, and a stage record with input hash, output hash, wall clock and cost.
Fields exactly as listed in The Manifest section.
2. What does it mean for an artifact store to be content-addressed?Define
Two real stage outputs from the lesson's ArtifactStore, each shown with the actual SHA-256 hash of its content, noting that different content gives a different hash.
Real output_hash values from a run of the lesson's run() with seed 42.
3. What is the orchestrator's job in the pipeline?Define
A manifest feeding a box labelled Orchestrator with its job left blank, which in turn reaches a grid of 12 numbered stage chips.
4. What is an eval gate?Define
A table of the six real metric thresholds from the lesson's DEFAULT_GATES: mmlu, humaneval, truthfulqa, safety_refusal_rate, kl_from_reference and cost_total_usd, each with its comparison operator and value.
Real DEFAULT_GATES dict from main.py.
5. Which gate caps how far an aligned policy may drift from its reference model?Define
A policy box and a reference box with a dashed gap between them labelled drift, next to an alphabetical list of four gate names (cost gate, KL budget gate, regression gate, safety refusal rate gate) with none highlighted.
6. In the lesson's costing discussion, what does MFU measure?Define
The H100's real peak BF16 throughput of 989 TFLOPS from the Costing section, with a note that a real job uses only part of that peak, and MFU left as a blank.
7. What is a rollback plan in this pipeline?Define
The lesson's three real rollback categories: cheap stages (tokenizer, eval, quantization, inference server), medium stages (SFT, DPO, CAI), and the expensive stage (pre-training).
Categories exactly as listed in the Rollback Plan section.
8. What does 'reproducible' mean for LLM training in this lesson?Define
The same manifest, code and infrastructure feeding two separate replays, Replay A and Replay B, each with its result left blank.
9. What is a cost gate?Define
A pre-run estimate box (FLOPs, GPU-hours, dollars) feeding into an in-run tracking box (log cost, check remaining budget after each stage), with a blank for what the combination is called.
10. Per the Costing section, how does the pre-run estimate compute expected FLOPs for a pre-training stage?Define
A four-step flow: params and tokens going into a blank FLOPs formula, then GPU-hours, then dollar cost, with the FLOPs step highlighted and left blank.
11. Which item does the 2026 eval recipe list alongside public benchmarks such as MMLU-Pro and GPQA?Define
Six named public benchmarks from the lesson, MMLU-Pro, MATH, HumanEval+, GPQA, SWE-Bench and LiveBench, in a grid with one more blank item alongside them.
12. Which serving stack does Production Recipes Observed in 2026 name, and with which techniques?Define
A stage 12 inference server box next to three blank technique slots for batching, decoding and KV cache, with the serving stack itself unnamed.
13. Per the Artifact Typing table, what artifact type does stage 07 (reward model training) produce?Define
The real Artifact Typing table with stages 01 through 09 shown, but the Artifact Type and Key Fields for stage 07 both left as blanks.
Real Artifact Typing table, stage 07's row blanked.
14. In the manifest scheme from The Manifest section, what does the output hash of stage N become for stage N+1?Explain
Stage 01's real output hash and stage 02's real first input hash shown side by side as the exact same value, with the relationship between them left blank.
Real output_hash and input_hashes values from a run of run() with seed 42.
15. Why is each stage's output given a named type with a known schema instead of being left as a directory blob?Explain
Two rows of the real Artifact Typing table, Tokenizer for stages 01-02 and Checkpoint for stages 04-05, with a note that each stage's output is a named type and a blank for the benefit of that.
Two rows of the real Artifact Typing table.
16. Why can the eval stage (10) and the quantization stage (11) run in parallel?Explain
The 12-stage DAG with stages 10 and 11 both highlighted the same color, with a blank for why they can run in parallel.
The lesson's real stage dependency graph.
17. Why does the artifact store address checkpoints by hash rather than a filename like latest.pt?Explain
The lesson's two real example artifact names, latest.pt and ckpt-7b-step-20000-sha256:abc123.safetensors, with a blank for why the second is preferred.
Both filenames are quoted directly from the Artifact Storage section.
18. Why is modern distributed LLM training reproducible but not deterministic?Explain
Two replays of the same manifest with illustrative loss values that differ slightly at step 500, 2.3140 versus 2.3141, while final headline metrics are identical, and the cause of the difference left blank.
Illustrative loss values; the lesson gives no exact figures for the float difference.
19. What made the specific training costs of Llama 3 ($61M) and DeepSeek-V3's main run ($5.6M) visible?Explain
A bar chart of two real published training costs, Llama 3 at $61M and DeepSeek-V3 at $5.6M, with a blank for what made both figures visible.
Both figures are stated in the lesson's Costing section.
20. The 2026 production recipes list choices for tokenizer, pre-training, SFT, alignment, eval, quantization and serving. What does the lesson say about them?Explain
Two snapshots of the same 7 recipe categories (tokenizer, pre-training, SFT, alignment, eval, quantization, serving) six months apart, each category's detail marked only as v1 or v2, with a blank for which part stays the same.
The 7 categories are the lesson's own Production Recipes headings.
21. Why does the 2026 recipe quantize to 8-bit for safety evals while serving at 4-bit?Explain
The lesson's two real precision choices, 4-bit for serving and 8-bit for safety evals, with a blank for why they differ.
22. The orchestrator writes to both an experiment tracker and an artifact store. Why does the pipeline need both?Explain
An orchestrator box with arrows to two separate boxes, Experiment tracker and Artifact store, with a blank for why the pipeline needs both.
23. Estimate stage 04 pre-training for a 7B model on 2T tokens: FLOPs = 6 x params x tokens, 40% MFU on H100 at 989 TFLOPs BF16, $2.50 per GPU-hour. What does the estimate come to?Apply
The Exercise 3 setup: a 7B model trained on 2T tokens, FLOPs equal to 6 times params times tokens, 40% MFU on an H100 at 989 TFLOPS peak BF16, at $2.50 per GPU-hour, with GPU-hours and cost both left blank.
24. Per the Rollback Plan section, a failure at stage 06 (SFT) invalidates which stages?Apply
The 12-stage DAG with stage 06 marked failed, and a blank for the full invalidated set.
The lesson's real stage dependency graph.
25. The team adds a new benchmark to the eval stage (10). What has to be treated as invalid?Apply
The 12-stage DAG with stage 10 marked changed, plus a separate ship decision box, with a blank for what must be treated as invalid.
The lesson's real stage dependency graph, plus the ship decision outside it.
26. Your team finds a bug in stage 09's own training recipe (CAI plus GRPO policy). Using the stage graph and the Rollback Plan, which artifacts must be treated as invalid?Apply
The 12-stage DAG with stage 09 marked failed, and a blank for the full invalidated set.
The lesson's real stage dependency graph.
27. A teammate replays your manifest and gets weights that differ at the 1e-5 level, but identical headline metrics at every stage. What is the verdict?Apply
A replay reporting weights that differ at the 1e-5 level but headline metrics identical at every stage, with its classification left blank.
28. A model that came out of the DPO stage was fed into the SFT path and shipped. Which ingredient should have stopped it?Analyze
A stage 08 Policy output wired directly into a stage 06 input slot that expects an SFT Model, with a blank for what should catch this before it ships.
29. A refactor to the training code introduces a bug. Every hash verifies, and the KL, cost and safety gates pass, but the model scores below the previous release on MMLU and HumanEval. Which gate should have held it?Analyze
A refactored run where every hash verifies and the KL, cost and safety gates all pass, but MMLU and HumanEval score below the previous release, with a blank for which gate should have held it.
30. Two teammates pull `latest.pt` on different days for the same experiment and get different eval scores. Which rule from the lesson was broken?Analyze
The filename latest.pt pointing to two real, different content hashes on two different days, with a blank for which rule this breaks.
Real output hashes from simulate_stage with two different seeds.
31. Two days into alignment you find a data bug in the SFT mix (stage 06). The base model from pre-training is fine. Which plan fits the lesson's rollback thinking?Design
A scenario where a data bug is found in the stage 06 SFT mix two days into alignment while the base model from pre-training is fine, with a blank for the best rollback plan.
32. You must stop any run whose training shards overlap the eval set. Which design fits the lesson's approach?Design
A design requirement to stop any run whose training shards overlap the eval set, with a blank for the design that fits the lesson's approach.
33. You do not want to learn mid-run that the pre-training budget is gone. Which design does the lesson prescribe?Design
A design requirement to avoid learning mid-run that the pre-training budget is gone, with a blank for the design the lesson prescribes.

Build It

The code here is an orchestrator and a manifest checker, not twelve training scripts. Each stage is simulated by a placeholder that emits an artifact with the right shape and a real SHA-256 hash. Running the orchestrator end-to-end proves the plumbing works before you spend GPU money on the real stages.

See code/main.py for the full implementation. The key pieces:

  • Manifest dataclass: pipeline version, seed, git commit, stage records, gates, eval metrics, budget, and total cost.
  • StageRecord dataclass: name, type, input hashes, output hash, wall clock, cost, and status.
  • run(): walks the stage list in dependency order, checks that each input hash is in the store, hashes each output, and halts with halted_over_budget when cumulative cost passes the budget.
  • gate(): compares each threshold in the manifest against eval_metrics and returns pass/fail with a reason per gate.
  • ArtifactStore: an in-memory stub with put/get/has by hash, standing in for S3.
  • simulate_stage(): the placeholder. It returns a deterministic blob plus a fixed wall clock and cost per stage type.

demo runs the twelve placeholder stages, prints the manifest summary, then runs the gate twice, once with passing metrics and once with a failing eval, to show what a held run looks like. Swap each placeholder for the real training script from the matching lesson and you have the skeleton of a real pipeline.

Check: Build It0/4
1. In Build It, which component is the in-memory stub with put/get/has by hash that stands in for S3?Define
A code box with its class name blanked to 'class ??? :', showing a real docstring about standing in for an S3/R2/GCS bucket addressed by SHA-256, and put/get/has methods keyed by hash.
Simplified from the real ArtifactStore class in main.py; the class name itself is the blank.
2. While `run()` walks the stages, the cumulative cost passes the manifest's budget. What does it do?Apply
A real run of run() with budget_usd lowered to $500, showing the cumulative cost crossing the budget partway through stage 05_scaled_recipe, with that stage's status left blank.
Real run() output; $500 is an illustrative budget chosen to trigger the halt.
3. A `gate` run reports mmlu=42.0 against >= 65.0 and kl_from_reference=40.0 against <= 25.0, with every other gate passing. What happens next?Apply
A gate run reporting mmlu at 42.0 against a threshold of 65.0, and kl_from_reference at 40.0 against a threshold of 25.0, with every other gate passing, and a blank for what happens next.
4. The toy gate is looser than the YAML in The Eval Gate. Where do the toy's `DEFAULT_GATES` thresholds differ?Analyze
Two real gate specs for the mmlu metric: the lesson's YAML example written relative to a baseline, and main.py's DEFAULT_GATES written as a fixed number, with a blank for the biggest difference.
YAML from The Eval Gate section; 65.0 from the real DEFAULT_GATES dict.

Use It

The canonical workflow has three commands.

python code/main.py plan    # validate manifest, compute cost estimate, print DAG
python code/main.py run     # execute stages, writing to manifest.out.yaml
python code/main.py gate    # read manifest.out.yaml, apply eval gates, ship-or-hold

Run plan first, every time. Most pipeline bugs show up at plan time: missing gate thresholds, stale hashes, budget overruns. plan is free and run is expensive, so catch bugs on the cheap side.

A note on the toy: the comments above describe the full workflow. In main.py, plan prints the DAG, the gates, and the budget (the cost estimate is Exercise 3). run prints the manifest as JSON to stdout, and gate reruns the simulated pipeline before applying the thresholds, so there is no manifest.out.yaml.

The output of gate ends in SHIP or HOLD, with a HOLD: <reason> line for each failed gate. A held run is not a failure. It is a decision point, where a named reviewer either overrides (and the override is logged) or approves the rollback.

Check: Use It0/1
1. Per Use It, why should you run `plan` before every `run`?Explain
A plan box marked free next to a run box marked expensive, with a question mark between them and a blank for what plan catches before run starts.

Ship It

This lesson produces outputs/skill-llm-pipeline-reviewer.md. Feed it a proposed pipeline manifest and it checks the contracts: stage typing, hash chain, gates, rollback plan, and cost estimate. It refuses to approve a manifest with a missing eval gate, an unbounded KL budget, or a run that mixes eval and training data.

Check: Ship It0/1
1. Per Ship It, what does the llm-pipeline-reviewer skill refuse to approve?Define
The llm-pipeline-reviewer skill's real list of checks, stage typing, hash chain, gates, rollback plan and cost estimate, with a blank for which specific problems make it refuse.
Author's Note

I'd start with python code/main.py demo. Nothing trains: each stage hashes a small JSON payload, so you are watching the plumbing, and the output prints the plan, the per-stage table, and both gate outcomes in one go. Stage 09 takes the output hashes of 07 and 08 as its inputs, and every stage's hash folds in the hashes of its inputs, so a change upstream changes everything below it. That is the mechanism behind the Rollback Plan's invalidation rule, in a few lines of run(). The toy never computes the rollback set itself.

The failing gate run in demo drops mmlu to 42.0 and kl_from_reference to 40.0. I'd change those two numbers and a few others to see which gates trip and what the HOLD lines look like.

The toy is looser than the prose in three places, and I'd close them first. The thresholds in DEFAULT_GATES are fixed numbers like mmlu >= 65.0, where the YAML above is relative to a baseline. run() does not skip a stage whose output is already in the store, which is what Exercise 4 adds. And the passing eval_metrics are hardcoded, so a SHIP shows that the gate logic works and says nothing about a model. There is also no reviewer override yet, so a held run just stays held.

Exercises

  1. Extend the orchestrator to support parallel execution of stages 07 and 08. Use the stdlib concurrent.futures module. Confirm the final manifest records both stages' outputs and that stage 09's input hash is a deterministic combination of both.

  2. Add a "contamination check" gate. Given the eval dataset hash and the training dataset shards, compute the overlap (exact string match or 13-gram match). The gate fails if overlap exceeds 0.1%. Feed it a contaminated training set and confirm the gate holds the run.

  3. Implement a cost estimator from first principles. For stage 04 (pre-training), estimate FLOPs as 6 x params x tokens, assume 40% MFU (model FLOPs utilization) on H100 at 989 TFLOPs BF16, at $2.50/GPU-hour. Report the estimate for a 7B model trained on 2T tokens. Compare to published Llama 2 numbers.

  4. Build a partial rollback. Simulate a failure at stage 09 (CAI), then re-run stages 09 through 12 while leaving 01-08 cached. The orchestrator should detect the cached artifacts by hash and skip them. Measure wall-clock saved versus full re-run.

  5. Add observability. Emit OpenTelemetry spans for each stage, with attributes for params, tokens seen, loss, and cost. Pipe the spans to a local collector. The point is not dashboards; the point is that every stage's health is traceable from a single trace ID.

Key Terms

TermWhat people sayWhat it actually means
Manifest"The recipe file"YAML or JSON describing pipeline version, seed, per-stage config, and gate thresholds, enough to replay a run
Content-addressed"By hash not name"Artifacts stored by SHA-256 of their contents, so you can never confuse version A with version B
Eval gate"The ship criteria"Numeric thresholds on benchmark metrics and safety scores that must pass before an artifact is marked shippable
KL budget"How far alignment drifted"A cap on cumulative KL(policy
MFU"How much of the GPU you used"Model FLOPs Utilization: achieved FLOPs divided by theoretical peak. 40% is typical at 70B scale, 55% at 7B
Rollback plan"What we do when it breaks"Pre-written set of actions per stage on failure: re-run, fall back, retrain with revised inputs
Orchestrator"The conductor"The process that reads the manifest, dispatches stages, verifies hashes, halts on any contract violation
Artifact store"Versioned S3 for weights"Immutable content-addressed object store. Single source of truth for checkpoints, datasets, eval reports
Reproducible"Same metrics on replay"Different bit-level weights but equivalent downstream metrics. The realistic target for distributed LLM training
Cost gate"You cannot exceed X"Pre-run cost estimate plus in-run tracker, the pipeline refuses to start if the estimate exceeds budget

Further Reading

Code

Ships With