Skip to content

fleet: report an island none of whose pushes is merged in N merge cycles (island_straggler); ssh: island join/leave/lag e2e - #891

Open
michaellchung wants to merge 12 commits into
mainfrom
own/island-straggler
Open

michaellchung wants to merge 12 commits into
mainfrom
own/island-straggler

Conversation

@michaellchung

@michaellchung michaellchung commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

own-cluster-fleet-stability tasks 9.1 and 9.2: ssh: islands that lag, join or leave a running fleet.

What changes

  • island_straggler (9.1). The syncer already merges the other islands at each quorum deadline and excuses a silent island (syncer: a pool round merges what arrived at the quorum deadline; a connected but silent island is absent, not awaited #865), but nothing said that an island had stopped contributing. The fleet controller now reads the syncer's merges and, when no push of a running island was merged in N merge cycles (one outer step of every fragment), writes island_straggler once per stretch: in fleet.jsonl and under straggler in the island's record (fleet/trainers/<k>/state.json; its at is wall time, as the record's updated). island_straggler_cleared closes the stretch with a reason: a push of the island is merged again, recovering, relaunched (running again as a new launch), stopped or removed (island STOP), no longer running, or controller restarted.

    • New module yeto/launch/island_straggler.py: the tracker (folds outer_step / pool_join), the sources (the syncer's tape file on this host for a head-mode syncer, or the copy the per-island syncer launch uploads to an object run store under tapes/syncer/), and the watch.
    • FleetController(straggler=..., straggler_policy=...): one _poll_stragglers() call per poll, in its own section of fleet.py. The policy answers wait (default: nothing is stopped or relaunched) or replace (handed to the policy's own replace); the replacement itself is the spare-node work (task group 4), this PR only signals.
    • --rl-island-straggler-cycles N (default 3, 0 off), checked with the island pool options.
  • What is counted (reviews H1, REV-891b H-A, M-B, REV-891c L-1, L-2). A launch counts only what the syncer records after it started: each source starts at the tape's end when the watch starts (the local file at its offset; the run store's copy at the tail of every syncer incarnation there), so no clock is compared and a syncer host whose clock is off (a test runs one an hour behind) is counted as usual. Only an incarnation the store lists later is read from its start, without its records stamped more than 10 minutes before the watch's start (a test runs one 300 s behind, still counted). Only the controller restarts a count: when the island's launch token changes (relaunch, move) or the island leaves running (recovering, draining). A pool_join only marks the island joined: a link that reconnects (a new connection generation under the same token) or a new syncer term keeps the island's misses and its mark, so an island that keeps reconnecting without pushing is still reported and its report does not flip. An island the syncer lists in an outer_step's absent counts as joined from that merge on, so an island adopted by a restarted launcher (no pool_join read) is counted at once. A join read while the controller holds the island recovering counts; a relaunch never seen away is counted from the first join read after the poll that saw it.

  • A restarted controller (REV-891b M-C, REV-891c M-2). When the controller starts or takes over, each island record that still carries a straggler mark gets one island_straggler_cleared with reason controller restarted, and the mark is set to none; the island is then judged again from the new watch's start. A record that does not read (a 503) is read again at each poll until it does, and a mark this watch wrote meanwhile is never taken for a left one.

  • A new launch catches up first (coordinator decision with REV-891c). A large model's catch-up can span many merge cycles. A launch its controller relaunched (new machines, a spare node, a move) or a new island whose pool_join the watch read is not counted until its first push is merged, for at most the controller's recover timeout (--recover-timeout, from when the controller holds the new launch running; 20 minutes when relaunch is off). A push merged while the island was away (its earlier launch's last push, a drain before island start, before a remove and add) is the earlier launch's and does not take the new launch's grace (REV-891d H-1). After its first merged push it is counted as usual; if none is merged by the end of the recover timeout it is counted from then on, reported N merge cycles later, and its reason says the catch-up grace ran out. An adopted island has no grace: a join of an island already in the pool is a reconnect (REV-891d M-1). A reconnect's join neither starts nor extends a grace, and the same launch back from recovering has none.

  • Store reads (review M2, REV-891b M-D, REV-891c H-1). No syncer incarnation is picked as the current one: a restarted syncer may resume an earlier step (from its checkpoint), keep its term, or write only its own records (round opens, connections) in its last chunk, and two may be level. The first read lists every incarnation and keeps each one's tail; only when every listing succeeds is the tail established (after a failure the next read is a first read again, so the history is never read). Each later read lists the known incarnations after their cursors (start_after) within half the poll's budget, those that grew at their last listing first and the others in turn (REV-891d L-3, L-8), and reads the new chunks of those that grew, one chunk of each (the one read longest ago first) before a second of any, at most 16 GETs per read, the rest at the next read; the cursor moves per chunk read, and a failed GET returns what was already read (nothing is lost or read twice). A full listing every 10 reads adds only incarnations it did not know (a known one keeps its cursor); those are read from their start. The first read and the full listings go on across reads within the budget (REV-891d L-4). Per controller poll: at most one listing per known incarnation + at most 16 GETs, plus listing pages every 10 reads, within a 5 s budget; the store is read at most every 30 s. Known limits (docs): a join written before the first read finished is not read (that island is counted like an adopted one); an uploader rewriting a chunk already read adds lines that are not read; a late-listed syncer whose clock runs more than 10 minutes behind is skipped and reported silent.

  • Report delay (REV-891b L-H). Usually about one store read (30 s) plus the controller poll, about 1 minute after the Nth missed cycle. A watch behind the tape reads at most 16 chunks (about 8 minutes of tape) per read, so after a one-hour store outage it catches up in about 4 minutes. A new syncer incarnation is found within 10 reads (about 5 minutes).

  • Not watchable (review L1, REV-891b L-F, REV-891c M-1). When the watch cannot work, each trainer island of the launch gets one island_straggler_unavailable event with the reason: turned off (--rl-island-straggler-cycles 0), no object run store, the tape upload off, a synced group whose syncer runs on a VM of its own (L2: that syncer's tape is never uploaded), or no record read for two of the syncer's longest rounds plus two upload intervals, at least 5 minutes. A round short of the pushes its soft deadline needs runs to its quorum timeout, so the longest round is the larger of --rl-sync-soft-deadline-s and the quorum timeout (--rl-elastic-quorum-timeout-s, else the syncer's 900 s default): 31 minutes with the defaults; derived from the launch's args (REV-891d M-2). The silence counts only after the first record about the launch's islands, so a slow start is never said unavailable; a fleet of 900 s rounds read every 30 s never is either. When a record is read again, island_straggler_available is written.

  • Dashboard (review M3, REV-891b L-I; minimal, the full view is 4.5). Since fleet.jsonl: learner id as island_id, chunked copy into the run store #910 a fleet's island records come from several sources and fold by their own time: the straggler mark follows the newest mark event by its source's time (one source in write order, its clock stepped back included), so a clear read before the report it closes, or one report read from two copies, ends as the newest says; the lifecycle replay never touches the mark, and the mark lands on the island of its learner id (island_id). island_straggler* are fleet events in the reducer that do not change the island's lifecycle state; the event stream shows them (lag / back / info), and a cleared event shows only its reason. The trainer card carries a straggler badge while the island is reported. The mark comes from the island's record in the run store (fleet_islands._trainer_records reads straggler from fleet/trainers/<k>/state.json; an end-to-end test goes from the controller's write through read_fleet_state to the page), else from the newest fleet event. Its "Islands now" row shows straggler in the warn color in place of the island's status (never "ok" next to it), on one line, with rows of equal height at 1440 px; the Fragments rows no longer repeat it. Screenshots at 2540/1920/1440/400 px (plain, reported, cleared, from one consistent run where the stuck merges have no push of island 1) were checked locally.

  • Spare nodes (ssh islands: replace a lost node of a resident trainer island with a spare (own-cluster 4.1-4.4) #885, review L4). Rebased on ssh islands: replace a lost node of a resident trainer island with a spare (own-cluster 4.1-4.4) #885. A reported island that loses a node is recovering: the poll that finds the loss clears its report (recovering), it is not counted while it waits for a spare, and on the spare it is a new launch with its catch-up grace; past its recover timeout it is reported N cycles later. tests/test_island_straggler_spares.py runs the real controller over ssh islands: replace a lost node of a resident trainer island with a spare (own-cluster 4.1-4.4) #885's fake SSH cluster and spares, and the dashboard with the spare events in between.

  • CPU end-to-end test of ssh: islands (9.2). tests/test_ssh_island_fleet_e2e.py: the real Rust syncer, the trainer worker on a local store with the desired state, and for each island launch the launcher's own FleetController over the resident ssh: island ops (SshIslandOps) on the fake SSH cluster; rank 0's start connects a syncer client, its kill drops it. Two ssh:2x8xb300@bm islands train, then one case each:

    • add a third island (fleet_islands.add): it catches up, then its pushes are merged;
    • remove island 1: island STOP, drain, kill on its nodes, merges go on over island 0;
    • island 1 stuck while connected: merged without it at the quorum deadline, island_straggler (action wait) once after 3 cycles, no relaunch, cleared once it pushes again;
    • (review M4) the stuck case over the per-island wiring: each launch's watch is launcher._island_straggler_watch of its parsed argv, reading the run store (DirectoryObjectStore) where the real tape uploaders copy the syncer's tape chunk by chunk, next to an earlier syncer's history in which island 1 missed 40 merges. Island 1 is reported once (never from the history), then one of its ranks fails and its controller relaunches it (cleared: recovering); the new incarnation joins again and stays silent past its recover timeout, so it is reported again only after its catch-up grace ran out and N more cycles (its reason says so); then it pushes and is cleared. The watch reads the store every 0.5 s here only to keep the case short; its silence window is derived from the launch's argv (31 minutes), so no unavailable notice is written.

    Each case asserts: the other islands' processes never restart (one start per node, one launch, no kill before the end), the merged steps are 1..N with no gap or repeat, no push is merged twice, and the resource ledger holds each ssh incarnation exactly once. The limits of these assertions are written next to them (L3).

  • docs/OWN_CLUSTERS.md, section "Islands that lag, join or leave" (lag and remove; what is counted, the clear reasons, the report delay, when the report is unavailable and why for a synced group with its own syncer VM). The add-side checks (9.3) come in the stacked follow-up PR.

Reused, not rebuilt: the syncer's quorum deadline and excuse (#865), per-island STOP, the desired state and yeto fleet island add/remove, per-learner catch-up, the syncer tape uploaders, the resident ssh island ops and their fake cluster.

Tests

  • New: tests/test_island_straggler.py (59 functions), tests/test_island_straggler_spares.py (3, over ssh islands: replace a lost node of a resident trainer island with a spare (own-cluster 4.1-4.4) #885's spare nodes), tests/test_dashboard_island_straggler.py (9), tests/test_ssh_island_fleet_e2e.py (4 cases with the real Rust syncer), tests/test_own_clusters_islands_doc.py (2).
  • REV-891d tests: a push merged while away (its last push after it was recovering, pushes merged while it drained, removed then added again) leaves the new launch its grace; the same launch back with a reconnect read while away has none (H-1); an adopted straggler that reconnects or sees a new syncer term keeps its report, with no grace and no false clear (M-1); soft 60 s with a 1800 s quorum timeout and a round every 10 minutes is never said unavailable (M-2); without a recover timeout a new island has the 20 minute grace (L-2); twenty incarnations growing at once each get a chunk before any gets a second (L-3); the first read keeps every tail across reads within its budget, and the paged root listing goes on across reads (L-4); the mark is stamped with wall time, as the record (L-7); a relaunch between two checks is cleared and has its grace (L-8, M06); a live syncer is listed however many stopped ones sort before it (L-8, M11).
  • Since fleet.jsonl: learner id as island_id, chunked copy into the run store #910 (fleet.jsonl from several sources): straggler events out of order across sources end as the newest says (a clear before its report, one report from two copies, a lifecycle replay in between); one source's clock stepped back folds in write order; the mark lands on the island of its learner id.
  • Head 9028167, rebased on main e896ad8 (with fleet.jsonl: learner id as island_id, chunked copy into the run store #910, ssh islands: replace a lost node of a resident trainer island with a spare (own-cluster 4.1-4.4) #885 and node smoke: take full option names only (fixes main's exact-parser coverage test) #927). Related tests (this PR's files, fleet.jsonl: learner id as island_id, chunked copy into the run store #910's fleet log store tests, the dashboard fleet and trainer island tests): 373 passed. The full suite is left to CI. On the previous base (main 1a5d22f) the four CI shards run locally gave 18548 passed, 1 failed: test_ssh_island_spares_recovery.py::test_an_owed_stop_retry_that_races_release_node_leaves_the_node_released (a race in the directory store's read, outside this change).
  • tests/test_ssh_island_fleet_e2e.py 10 consecutive runs at this head (port 0): 4/4 each.
  • Mutations, all fail the tests (then reverted): 21 of REV-891d, 7 of REV-891c, 7 of the catch-up grace (the controller passing no grace included), 7 still applicable of REV-891b, _trainer_records dropping the mark, and 3 of the reducer's order (marks in arrival order, raw time instead of the source's time, marks in the lifecycle replay).

Customer gate

  • 52 customer goldens pass (tests/test_k31_customer_plan_golden.py, tests/golden/breakers) at head 9028167.
  • examples/k31 dry runs (run.agentic-262k, run.baremetal-b300-262k with their preflight logs, pool.nc-mi355x-agentic-262k), normalized, are identical line by line to main e896ad8.
  • No change under tests/golden, tests/fixtures/k31_customer_kit or examples/k31.

🤖 Generated with Claude Code

michaellchung and others added 12 commits November 27, 2026 06:37
…reported (island_straggler)

The syncer already merges the other islands at each quorum deadline and excuses a silent
island (#865); nobody said that the island had stopped contributing. The fleet controller
now reads the syncer's merges (its tape on this host, or the copy the syncer launch uploads
to the run store, tapes/syncer/) and writes island_straggler once per stretch, in
fleet.jsonl and in the island's record, when no push of a running island was merged in N
merge cycles (one outer step of every fragment; --rl-island-straggler-cycles, default 3,
0 off). island_straggler_cleared follows once a push of it is merged again. Counting starts
at the island's join after a (re)launch. A policy decides what to do: wait by default
(nothing is stopped or relaunched), or a replacement its provider offers.

Tests: the tracker and its sources (local tape, store chunks across syncer incarnations);
the controller's event, record and policy; and an end-to-end CPU test of ssh: trainer
islands (the launcher's fleet controller over the resident ssh ops on a fake SSH cluster,
the trainer worker on a local store, the real syncer): a third island added, one removed,
and one stuck while connected. In each case the other islands' processes never restart,
the merged steps run without a gap or a repeat, no push is merged twice and the resource
ledger holds each ssh incarnation once. docs/OWN_CLUSTERS.md: "Islands that lag, join or
leave".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- count only records of this launch: a watch starts at the current syncer
  incarnation's tail and ignores records older than its start; a new pool_join
  (generation or syncer term) restarts an island's count
- bounded store reads: list after a cursor, at most 16 GETs per poll, a time
  budget, partial reads kept on a failed GET
- a flagged island that stops running is cleared, naming why
- island_straggler_unavailable names why stragglers cannot be watched
- dashboard: straggler events in the event stream, a straggler mark on the
  trainer card and in Islands now

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… run store

- an island's count restarts when it leaves running, so a join its next
  incarnation writes before the controller holds it running is counted
- e2e: the stuck case over the per-island wiring (the launcher's watch of each
  launch's argv, the tape uploaded to the run store in chunks next to an earlier
  syncer's history, a relaunch while reported); assertion limits noted
- docs: what is counted, the clear reasons, island_straggler_unavailable and
  why a synced group with its own syncer VM has no report

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rom its return

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ds, restarts, tails, clocks

- a reconnect (new connection generation) or a syncer that took over (new
  term) keeps the count and the mark; only leaving running or a relaunch
  restarts them
- an island a merge lists absent is in the pool (an adopted island is counted)
- a launcher that starts on a record holding a report closes it
  (controller restarted) and judges the island again
- the store tail is established once every request of the first read worked;
  the newest incarnation is the furthest syncer (term, step), not a name
- the watch-start filter allows 10 minutes of clock skew; no other decision
  reads a clock
- silence is said only after the first record about this launch's islands,
  and taken back (island_straggler_available) when records come again
- dashboard: "straggler" in warn colour in place of "ok", on one line; the
  cleared event shows its reason only; no mark in the Fragments rows
- docs: what restarts a count, how late a report can be

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_trainer_records dropped the record's straggler, so island_now.straggler
was always None on the production path and the card never showed it.
Test the path end to end: the controller writes the mark, read_fleet_state
reads the run store, the card and its Islands now row show it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…irst merged push

A relaunched island (a spare node, a move) or a new island whose join the
watch read is not counted before its first merged push, for at most the
controller's recover timeout; past that it is counted from then on and the
report says the grace ran out. An adopted island has no grace, and a
reconnect neither starts nor extends one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… in rounds

REV-891c: the first read no longer picks one syncer incarnation (a restarted
syncer may resume an earlier step, keep its term or write only its own records
at first): it keeps every incarnation's tail and each read lists every known one
and reads those that grew. The clock filter applies only to an incarnation read
from its start. The tape is said silent after two of the syncer's longest rounds
and two upload intervals (at least 5 minutes), derived from the launch's args.
A left mark whose record does not read is retried at the next poll, and this
watch's own mark is never taken for one. A recovering island's mark is cleared
as recovering, a relaunch as relaunched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…; fair store reads

REV-891d: a push merged while the island was away (its earlier launch's last
one, a drain, before a remove) no longer takes the new launch's grace, and the
same launch back keeps no join read meanwhile. A join of an island already in
the pool is a reconnect, so an adopted island never gets a grace. The silence
window uses the longer of the soft deadline and the quorum timeout. Without a
recover timeout a new launch has a 20 minute grace. The store reads list active
incarnations first and the others in turn within half the poll budget, give
each grown incarnation a chunk before any gets a second, and the first read and
full listings go on across reads within the budget. The mark is stamped with
wall time. Known limits written in the docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…are and is replaced

Over #885's spare nodes: the poll that finds the loss clears the report
(recovering), the island is not counted while it waits for a spare, and on
the spare it is a new launch with its catch-up grace; past its recover timeout
it is reported N cycles later. The dashboard keeps the card's mark and state
with the spare events in between.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since #910 a fleet's island records come from several sources (a host's file
and the store copies) and fold by their own time. The straggler mark follows
the newest mark event by its source's time: a clear read before the report it
closes, or a report twice, ends as the newest says; one source's clock stepped
back folds in write order; the lifecycle replay leaves the mark alone. The mark
lands on the island of its learner id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant