# sweep

`sexpgpu sweep <file.sx> <sweep>` enumerates a declared
[`defsweep`](https://sexpgpu.041.io/docs/knobs.md#defsweep) and runs its points in order, each as a
[`run`](https://sexpgpu.041.io/docs/run.md) in this process.

```console
$ sexpgpu sweep my-run.sx lr-scan --dry-run
0  lr=0.5  my-run-lr=0.5
1  lr=0.25  my-run-lr=0.25
```

| flag | meaning |
|---|---|
| `--dry-run` | print the enumeration (index, selection, slug) on standard output and run nothing |
| `--only N` | run one point; past the end exits `2` |
| `--set k=v` | pin a knob for every point; pinning an axis of the sweep exits `2` |
| `--variant V` | the base variant, when the sweep names none |
| `--diagnostics G` | the diagnostics selection of every point |

- Each point's line goes to standard error as it starts; a table of point,
  slug, final evaluation (`eval/loss` when reported) and metrics location
  closes the sweep.
- `--set` and `--variant` appear in every point's line and slug.
- Every selection is compiled and checked before it runs.
- The first failure stops the sweep and names the point.
- A JSONL metrics target and a status file each get `-<index>` before the
  extension, one per point: `status.json` becomes `status-0.json`,
  `status-1.json`.
- A sweep the file does not declare exits `2`.

Related: [knobs](https://sexpgpu.041.io/docs/knobs.md), [run](https://sexpgpu.041.io/docs/run.md), [the status file](https://sexpgpu.041.io/docs/status.md).

---

SexpGPU documentation. Every page: https://sexpgpu.041.io/llms.txt
