Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/NODE_RUNTIME.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,12 @@ One shell call reads, in this order:
| ECC | the same query | the volatile uncorrectable ECC count grew since the previous check (a count that went down is the new baseline) |
| NVLink fabric | the `Fabric` blocks of `nvidia-smi -q` | a GPU that has a fabric state is not `Completed/Success` (a PCIe card's `N/A` passes) |
| fabric manager | `systemctl is-active nvidia-fabricmanager` | it was active and is now `inactive` or `failed` (a node without NVSwitch, never active, passes) |
| IB / RoCE ports | `ibstat` (`ibv_devinfo -v` only when ibstat fails) | a port named by `NCCL_IB_HCA` is missing, not `Active`, or slower than at the first check |
| IB / RoCE ports | `ibstat` (`ibv_devinfo -v` only when ibstat fails) | a port named by `NCCL_IB_HCA` is missing, not `Active`, or slower than at the first check or than the node's `min_ib_gbps` in the inventory, whichever is higher; without `NCCL_IB_HCA`, no port of the fabric is active, or, with `min_ib_gbps`, an active one is slower |

The XIDs and the ECC count only count from the second check on. What the kernel log
holds at the first check is history: the preflight judged the node then.
holds at the first check is history: the preflight judged the node then. The nodes of
an island added at run time are judged on their first check by absolute rules instead
([OWN_CLUSTERS.md](OWN_CLUSTERS.md), "Adding an island").

A kernel log without timestamps (dmesg's default has them) is followed by its last
line, how often that line ends the log, and the line before it, so lines that rotate
Expand Down
190 changes: 190 additions & 0 deletions docs/OWN_CLUSTERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -477,3 +477,193 @@ constraint.
it was. `yeto cluster probe` and `yeto cluster check` always print the note.

To drop the rule, delete the `fabric_group` lines.

## Islands that lag, join or leave

A fleet of `ssh:` trainer islands on your own machines uses the same fleet mechanisms as any
other island fleet ([FLEET_TRAINER_ISLANDS.md](FLEET_TRAINER_ISLANDS.md)). This section
covers what is specific to `ssh:` islands: how a slow or stuck island is reported, and what
is checked before an island joins.

### An island that lags

An island can fall behind or stop pushing while its process and its connection stay up: a
slow node, a hung collective, a trainer that waits on something. The syncer does not wait
for it. When a round's quorum deadline passes, the syncer merges the pushes that arrived and
records the silent island as absent. Later rounds do not wait for it either. Once the island
delivers again, its late push is carried into a later round with a discount, or refused when
it lags past `--rl-sync-max-base-lag`. The island then catches up to the newest merged
weights and answers rounds again. The other islands keep merging the whole time.

The island's fleet controller reports such an island. It reads the syncer's merges, and
when none of the island's pushes was merged in `N` merge cycles it writes:

- `island_straggler` in the launch's `fleet.jsonl`, with `missed_cycles`, `merges`,
`fragments`, `last_merged_step`, `newest_step`, `absent` and `action`;
- the same fields under `straggler` in the island's record (`fleet/trainers/<k>/state.json`,
shown by `yeto island status`).

A merge cycle is one outer step of every fragment, so with 4 fragments and `N = 3` the
island is reported after 12 merges without it. A push the syncer refused does not count as
merged. Counting starts when the island joins the syncer:

- A launch counts only what the syncer records after the launch started. A relaunched or
moved island's new launch never counts the merges an earlier launch of it missed. Records
stamped up to 10 minutes before the launch started still count, in case the syncer host's
clock runs behind.
- An island also counts as joined once a merge lists it `absent`: the syncer expects it. An
island that a restarted launcher adopted joined before that launcher started, and is
counted this way.
- Only the island's controller restarts the count. When the island stops running (its
controller relaunches it, or it is stopped), its count starts again once it runs again: at
its next join after a relaunch, so the time it takes to start is not counted.
- A reconnect of the same trainer, or a syncer that takes over, writes a new join to the
syncer's tape. That join keeps the count and the report: an island whose link keeps
dropping and that never delivers is still reported.

The report is written once per stretch. `island_straggler_cleared` closes the stretch, and its
`reason` says why: a push of the island is merged again, it was `relaunched`, it was stopped
or removed (island STOP), it is no longer running, or `controller restarted`. The last one is
written by a launcher that starts, or adopts the island, while its record still holds a
report from an earlier launcher; the new launcher then judges the island again. The
record's `straggler` is set back to `null` at the same time.

The dashboard shows both events in its event stream. While the island is reported, its
trainer card carries a `straggler` badge and its row in "Islands now" says `straggler`.

`action` is what the controller does about it. The default is `wait`: nothing is stopped or
relaunched, because the syncer already merges without the island. A lost or unhealthy node
is handled by the island's own launch, not by this report.

Set `N` in `fleet.trainer_argv`, so every island launch gets the same value:

```json
"trainer_argv": ["...", "--rl-island-straggler-cycles", "3"]
```

`3` is the default. `0` turns the report off. The value must be a whole number of 0 or more;
`yeto launch --dry-run` refuses anything else.

The controller reads the syncer's tape in one of two places:

- from the syncer's own file, when the syncer runs on the same host as the controller
(`--controller head`);
- otherwise, in a fleet launched island by island (`fleet.launch: per_island`), from its
copy in the run store, `tapes/syncer/<incarnation>/<seq>.jsonl`. The syncer launch
uploads it every 30 s (`YETO_RL_TAPE_UPLOAD_S`) when `--rl-checkpoint-store` is an
`s3://` store. Each island launch reads it every 30 s. Its first read starts at the end of
the syncer incarnation that got furthest (the newest syncer term, then the newest step).

How late the report can be, with the store copy:

- Normally one upload interval and one read interval after the merges it counts (about
1 minute).
- One read takes at most 16 chunks, about 8 minutes of tape. A backlog left by a store
outage is read in about one fifteenth of the outage's length: 1 hour of outage is caught
up in about 4 minutes.
- A restarted syncer writes to a new incarnation. The launch finds it at its next full
listing, which comes every 10 reads (about 5 minutes), and reads it from its start.
- If the first read fails, every later read tries it again. Until one works nothing is
read, and the syncer's earlier records are never read.

When the report cannot work, the launch prints `island straggler watch off` and writes
`island_straggler_unavailable` once, with the `reason`, in `fleet.jsonl`. Nothing is
reported then, and training is not affected. This happens:

- with `--rl-island-straggler-cycles 0`;
- in a per-island fleet whose run store is not an object store, or with the upload off
(`YETO_RL_TAPE_UPLOAD_S=0`);
- in a fleet launched as one launch (`fleet.launch: synced_group`) whose syncer runs on a VM
of its own (any `--controller` other than `head`). That syncer's tape stays on its VM:
the launch does not upload it to the run store, so the controller has nothing to read.
Run the syncer on the controller's host (`--controller head`) or launch the fleet island
by island to get the report.
- when the launch reads no syncer record for 10 reads in a row (the store copy is missing
or stale). This is counted only after the first record about the launch's islands, so a
fleet whose trainers are still starting is not reported. Once records are read again,
the launch writes `island_straggler_available`.

### Adding an island

With `fleet.launch: per_island`, add an `ssh:` island with its own node inventory. Its
inventory lists the island's trainer nodes, in the format of `--rl-node-inventory`:

```bash
yeto fleet island add --config run.json --name north --gpu ssh:2x8xb300@bm --usd-per-h 0 \
--samplers north.samplers.json --inventory north.inventory.yaml --dry-run
yeto fleet island add --config run.json --name north --gpu ssh:2x8xb300@bm --usd-per-h 0 \
--samplers north.samplers.json --inventory north.inventory.yaml
```

The island's launch gets `--rl-node-inventory` with the inventory's absolute path. Before
anything is written, and in the dry run too, the command checks the inventory's trainer
nodes and prints the nodes the island takes:

| Check | Refused when |
|---|---|
| Count | Without `lease_store`: the inventory does not list as many trainer nodes as `--gpu` says. With `lease_store` it may list more, as for a launch: the island takes as many as it needs of the free, healthy ones (below). |
| In this fleet | A node is a trainer node of another `ssh:` island whose inventory has no `lease_store`, or another one: the same name, or the same machine (its SSH target without `user@`, or its `address`, in any case). For an island on the same `lease_store` (`file:///x` and `/x` are one store), its launch's lease says which nodes it holds; a lease is taken by node name, so the same machine under another name in its inventory counts as its node. |
| Health | One SSH call per node runs the node health check of its device family, the check the island's launch runs while it trains. A node joining has no earlier check to compare with, so it is judged on absolute rules: a hardware Xid in the kernel log of this boot, a volatile uncorrectable ECC count above 0, NVSwitch GPUs whose `nvidia-fabricmanager` is not `active`, fewer GPUs than `cards_per_node`, an NVLink fabric not `Completed`. A multi-node island also needs its ports `Active`: those of `NCCL_IB_HCA` (the island's own `--island-env` value wins over the node's `env`), else the fabric's ports that NCCL takes. Each port runs at no less than the node's `min_ib_gbps` when the inventory sets it; else at no less than half the fastest of these ports on the island's nodes of the same fabric group. A check that does not read is refused: no answer, `nvidia-smi` or the fabric state timed out, a check still stuck on the node, an output cut off, the IB tools unread, or a kernel log the SSH user cannot read (`dmesg` restricted: add the user to the `adm` or `systemd-journal` group). With `--force` such a check is a WARNING and the node joins. A node found unhealthy is refused with `--force` too. A device family without a health check, or a node with `node_health: off`, is a note. |
| Fabric group | The inventory declares `fabric_group` and no one group holds the island's nodes. An inventory without any `fabric_group` only gets a note. |
| Lease | The inventory's `lease_store` shows a node leased to another run, or to another island of this fleet. A lease of the island's own launch (`<prefix>/trainer`, or `<prefix>-m<n>/trainer` after a move) is not a refusal. A lease that does not read is refused. Without `lease_store` this is not checked, and a note says so. |

With `lease_store`, the nodes held by another run or island are left out, and the island
must fit on the healthy rest (one fabric group in a grouped inventory, else any). When it
does not, the refusal names each node left out and why. The launch picks by leases only,
under a holder of its own (after a move, the nodes the island's earlier incarnation holds
are not its own): it takes the free nodes in the inventory's order (the free and the
earlier incarnation's ones when too few are free), and the rest when those are taken
meanwhile. So:

- any unhealthy candidate refuses, as a pick may come to it: take that node out of the
trainer nodes (`roles`) or clear its fault;
- a node of an island on no or another `lease_store`, or the same machine under another
name, looks free to the launch: a pick that would take it refuses (`launch would take
...`): give both islands the same `lease_store` and one name per machine, or use
inventories without shared nodes.

Limits:

- Two adds on one `lease_store` that run before either island launches see no lease of
the other, so both may list the same nodes. Their launches then take the leases one
after the other: the later one waits for free nodes, up to `--rl-node-lease-wait-s`
(3600 s by default), and fails after that. Add the next island once the previous one
runs, or give the islands inventories without shared nodes.
- On GB200 / GB300 NVL72 racks the NVLink fabric is managed outside the compute tray (on
the NVSwitch trays), so `nvidia-fabricmanager` is not active on the node. The health
check refuses such a node; set `node_health: off` on it and rely on `yeto preflight`.

A refusal exits 2, names every problem, and writes nothing. No learner id is claimed:

```text
fleet island: refused: island north's nodes cannot join: node b300-4 is leased to run other-run; node b300-5 is not healthy: GPU 5 XID 79 (a hardware Xid in the kernel log of this boot: fix the GPU and reboot the node, a new boot starts a new log, then add the island again); 0 of 2 trainer node(s) are free and healthy, 2 needed
```

The checks run again when the island is written, on the desired state then: another
island added since the dry run, or one that took the learner id this add checked under,
refuses the write (exit 3), naming its nodes.

`yeto fleet island move --gpu ssh:...` runs the same checks on the nodes the island moves
onto (`--inventory` replaces the island's inventory; without it the island keeps its own),
with the same `--force`.

Once the island is written, the trainer worker starts its launch. The island joins the
running syncer session, catches up to the newest merged weights, and then answers rounds
like the other islands. The other islands' processes keep running; they are not restarted.

### Removing an island

```bash
yeto fleet island remove --config run.json --name north --dry-run
yeto fleet island remove --config run.json --name north
```

The trainer worker writes the island's STOP. The island's controller drains it, stops the
trainer on every node (and checks that each container is gone), and records the island
`done`. Its incarnation is closed in the run's resource ledger. The syncer sees the island's
connection drop. The round it was asked for waits one island lease and then merges over the
islands left. The island's nodes are free for another island afterwards.

In a fleet launched as one launch (`fleet.launch: synced_group`), islands cannot be added
while it trains. One island can be stopped and started again by its learner id, for example
island 1 with `yeto island stop 1 --config run.json` and `yeto island start 1 --config run.json`.
Loading
Loading