Repository navigation
node health: remember the fabric manager per boot, so one that stays down is lost - #905
Open
michaellchung wants to merge 7 commits into
Open
michaellchung wants to merge 7 commits into
michaellchung wants to merge 7 commits into
Conversation
michaellchung
force-pushed
the
own/health-fm-sticky
branch
4 times, most recently
from
November 26, 2026 20:14
464fab6 to
db63a32
Compare
…down is lost The cuda checker gave a fabric manager reason only on the check where it went from active to inactive/failed; the next check was ok again, so a node whose fabric manager stayed down never reached two bad checks in a row. Now the checker keeps the boot in which the fabric manager must be active (fm_boot, carried over read failures): once it was active in a boot, every later check of that boot that does not read active is bad. A new boot id forgets it, so a fabric manager never active since a reboot is judged as before. The first read of a new launcher (no memory) on a node with an NVLink fabric reports failed/activating/deactivating at once; inactive there is left to the fabric state (it is also what a node without the unit prints). PCIe nodes are never judged on a fabric manager that was never active. A prev from an older check without fm_boot is read (the boot of its XID cursor). HealthTracker is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ts restarts Review follow-up. - The fabricmanager section also prints the unit's NRestarts and the node's NVSwitch devices (/dev/nvidia-nvswitch<N>, else NVIDIA PCI bridges, class 0680, in lspci). The first judged read of a new launcher is bad on a node with NVSwitch whenever the state is not active (inactive too); a node without NVSwitch (PCIe, an NVL72-class compute tray whose unit may be installed and failed) is not judged on a fabric manager never active in the boot. A probe that does not read judges nothing. - A read whose state or NVSwitch probe did not read is not the first judged read (fm_judged, carried): the next one that reads is. - fabric_manager_absolute(facts) -> (ok|bad|unread, detail): the rule on one check alone, from its own facts (nvswitch, fm_state: never carried), for callers without an earlier check. - On a node that must run it, NRestarts that grew since the previous check of the same boot is a reason for that check, so a restart loop that reads active at every check is still caught. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rt baseline per boot Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…unknown for none Review follow-up. On HGX B200 / B300 the NVSwitches are not PCIe devices of the host (they sit behind a ConnectX bridge reached through NVLSM): no procfs entry, no device file, no class 0680 bridge. The previous probe read that as "no NVSwitch" and judged a failed fabric manager ok there. - FM_SCRIPT probes /proc/driver/nvidia-nvswitch/devices, /dev/nvidia-nvswitch<N>, lspci class 0680 (no count when lspci fails), and the Mellanox devices: how many, how many VPD read, how many name the switch management port (SW_MNG). - nvswitch_of(probe, gpu_names, fabric) -> (yes | no | unread, basis): no only for a GB GPU (NVL72-class tray), no real fabric state (PCIe), or every Mellanox VPD read without SW_MNG; yes for NVSwitch devices, SW_MNG, or B200 / B300 GPUs with a real fabric state; anything else unread, never no. - fabric_manager_absolute reads facts["nvswitch"] (yes / no / unread); unread is never ok. - A node with no NVSwitch of its own is never judged on its fabric manager, even after it was active in the boot. - Fixtures follow an HGX B300 node as a non-root user sees it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-up. - systemctl is-active prints inactive for a unit that does not exist. The fabricmanager section now prints the unit's LoadState right after the state; inactive / failed count only for a loaded unit. A not-found unit (a GPU Operator driver container runs nv-fabricmanager; a shared NVSwitch VM runs it on its service VM) reads active when an nv-fabricmanager process runs, else "not running": a reason only in a boot in which it was seen active, unread at a first read (the fabric state judges the node). - The VPD of every Mellanox function is read (the switch management port may be on any function), each read bounded to 1 s (none without timeout). - B200 / B300 GPUs with a real fabric state are NVSwitch nodes even when the readable VPD does not name the port. - A section cut off after the state line says so in the unread detail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… --value Review follow-up. - The nv-fabricmanager processes are counted whenever systemctl does not say active: a process that runs reads active, also next to a stale host unit that is disabled, inactive or failed (a GPU Operator driver container). No loaded unit and no process reads "not running"; hidden processes (hidepid) read nothing. - LoadState and NRestarts are read with systemctl show -p and the prefix is cut: --value needs systemd 230. - At one check, a fabric manager that is not running is bad when the node shows NVSwitch of its own (a device, a PCI bridge, the VPD port), ok when it does not and every GPU's fabric is Completed (managed off-host: a shared NVSwitch guest), else unread. - A fabric manager without its unit: another process (pid and start time) in the same boot is a restart. - The VPD reads stop after 3 s in all. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ents - Read the unit's ActiveEnterTimestampMonotonic. On a node with soft NVSwitch evidence only (B300 without root, another NVIDIA 0680 bridge) and a Completed fabric, a loaded unit inactive/failed with no process is ok when it was never active in this boot (off-host), bad when it was, unread when unread. - Under hidden processes a loaded unit that failed after being active in this boot stays failed; other hidden stops stay unread with one note. - lspci 0680 devices: NVSwitch ids 10de:1af1 / 10de:22a3 are hard evidence; other NVIDIA bridges are soft (nvswitch yes, never hard). - Container detection by systemd-detect-virt -c output, with /run/systemd/container, /.dockerenv and /run/.containerenv fallbacks. - A unit-less fabric manager restarts only when every process of the previous check is gone. - Each check of a restart streak emits node_health_fm_restarted (island launcher, node runtime log, pool via the health record) instead of a degraded note. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
michaellchung
force-pushed
the
own/health-fm-sticky
branch
from
November 26, 2026 22:47
db63a32 to
c44d2b0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The cuda node health checker gave a fabric manager reason only on the one check where
systemctl is-active nvidia-fabricmanagerwent fromactivetoinactive/failed.The next check saw
failedinprevand judged the node ok again, so a node whose fabricmanager stayed down went
ok -> bad_once -> ok -> okand never reached the two bad checksin a row that make it
lost(and get it replaced). While the NVLink fabric state stillreads
Completed, nothing else catches it.Change (
yeto/hw/node_health.py)fabricmanagersection (FM_SCRIPT) prints first the state (the section's exitcode is still systemctl's), the unit's
LoadStateandActiveEnterTimestampMonotonic(
systemctl show -p, prefix cut:--valueneeds systemd 230), and whether the node'sprocesses are visible (
/proc/1/commreadable, and not in a container: the output ofsystemd-detect-virt -c, wherenoneis not one; without the tool a non-empty/run/systemd/container,/.dockerenv,/run/.containerenvorcontainer=in pid 1'senvironment). Whenever the state is not
activeit counts thenv-fabricmanagerprocesses (
/proc/<pid>/comm, cut at 15 characters) with their pid and start time.Then the unit's
NRestartsand what shows NVSwitch on the node: entries in/proc/driver/nvidia-nvswitch/devices, device files/dev/nvidia-nvswitch<N>, NVIDIAclass
0680devices whenlspciruns (no count when it fails), split into NVSwitch ids(
10de:1af1A100 HGX,10de:22a3H100 / H200 HGX, from pci.ids) and other NVIDIAbridges, and every Mellanox (
15b3) PCI function with how many of their VPD read (1 seach, 3 s in all; none without
timeout) and how many name the NVLink switch managementport (
SW_MNG).read_fabric_manager(section) -> (state, NRestarts, probe), the process first: a statethat is not
activewhile annv-fabricmanagerprocess runs readsactive(a GPUOperator driver container runs it, maybe next to a stale host unit that is disabled,
inactive or failed). Else no unit (
not-found), orinactive/failedof a unitthat is not loaded (
masked), with no process readsnot running; of aloadedunitit stays (it stopped). Hidden processes (hidepid, a container) leave an
inactive/failedstate unread, with onenode_health_degradednote per node, since a drivercontainer's fabric manager would not show; a
loadedunit that was active in this boot(
ActiveEnterTimestampMonotonic> 0) and isfailedstaysfailed. A section cut offafter the state line says
FM section timed out after reading state.nvswitch_of(probe, gpu_names, fabric) -> (yes | no | unread, basis). On HGX B200 /B300 the NVSwitches are not PCIe devices of the host (they sit behind a ConnectX
bridge reached through NVLSM, per the NVIDIA Fabric Manager User Guide; amazon-eks-ami
PR 2840 shows no procfs entry and no class 0680 bridge on p6-b200), so a missing device
is never read as "no NVSwitch". In order: a GB GPU -> no (NVL72-class compute tray,
whatever else it shows; its fabric state judges the topology); NVSwitch devices or an
NVSwitch PCI id -> yes (A100 / Hopper HGX); no real fabric state -> no (PCIe); a VPD with
SW_MNGon any function -> yes; every GPU a B200 / B300 (not GB, not PCIe) with a realfabric state -> yes (the rule without root, since the VPD reads as root only; a VPD
without the port does not overrule it); another NVIDIA
0680bridge -> yes (soft);every Mellanox VPD read without it -> no; anything else (or the fabric state unread) ->
unread.
fm_boot, the boot id (from the XID section'sboot=line) in which the fabric manager must be active. It is set when the fabricmanager reads
active, or at the first judged read on a node with NVSwitch; carriedover read failures; dropped when the boot id changes. In that boot every check whose
state is not
active(inactive,failed,activating,deactivating) is bad untilit reads
activeagain. A systemctl that timed out (no state) judges nothing.HealthWatch.prev, in memory only):on a node with NVSwitch any state but
active(includinginactive) is bad at onceand that boot is remembered, so two such checks make the node
lost. A read where thestate did not read or NVSwitch was not determined judges nothing and does not count as
the first judged read (
fm_judged, carried).and
failed, a VPD without the switch port) is never judged on its fabric manager,even after it was active in the boot. A fabric that is not
Completedstill makes thenode bad by its own reason. A node whose NVSwitch is not determined is judged only on
the per-boot memory (a fabric manager that ran has a fabric to manage).
NRestartsthat grew since theprevious check of the same boot, or, for a fabric manager without its unit, every
process (pid and start time) of the previous check gone (one more process that comes
and goes is no restart). Each check that saw one writes a new
node_health_fm_restartedevent (streak,
NRestartsor the process ids; from the island launcher, the noderuntime log, and the pool from the health record, once per check). A restart is a
reason only at the 3rd check in a row (
FM_RESTART_STREAK), so a loop that goes onmakes the node
lostat about the 4th check (~4 min, on purpose: one or two restartsthat come back lose no node). A check without a restart zeroes the streak; a read
failure keeps it (carried).
NRestartscounts only systemd's own restarts, so it needsRestart=on the unit.fabric_manager_absolute(facts) -> (verdict, detail)withFM_OK/FM_BAD/FM_UNREAD: the rule on one check alone, from that check's own facts (nvswitch,fm_state,nvswitch_hard,fabric_complete, never carried), for callers that judgea node without an earlier check. A fabric manager that is not running is bad when the
node shows hard evidence of NVSwitch (a device, an NVSwitch PCI id, the VPD port; the
GPU names and other NVIDIA bridges are not), ok when it does not and every GPU's fabric
is
Completed/Success(managed off-host: a shared NVSwitch guest VM, or a guest whoseNVSwitch cannot be determined), else unread. A loaded unit
inactive/failedwith noprocess, on a node with soft evidence only and a Completed fabric, goes by
ActiveEnterTimestampMonotonic: 0 (never active in this boot) ok, > 0 bad, unreadunread. NVSwitch not determined is otherwise
FM_UNREAD, neverFM_OK. The checkeruses it for the first judged read.
judged exactly as before (one bad check when it was active before the reboot, on a
node with NVSwitch; then the fabric state judges the node). Checked against the old
code on the same sequences.
prev: a prev withoutfm_bootwhose fabric manager wasactiveis taken as active in the boot of its XID cursor (else the current boot); a prev
without
fm_judgedcounts as judged when it hasfm.HealthTracker(two bad checks in a row ->lost) and the existing events areunchanged.
docs/NODE_RUNTIME.md: the health table row and a section on the fabric manager rule,with the NVSwitch and state tables, their public sources, what is not yet seen on our own
hardware (the VPD keyword on an HGX B300 node, GB300 tray GPU names), and a known limit: on
HGX B300 bare metal checked without root there is no hard evidence of NVSwitch, so a fabric
manager without a loaded unit that dies after the fabric reads
Completed, never seen bythe check, reads as off-host; new CUDA launches then fail with
cudaErrorSystemNotReadyand the trainer reports it.
Tests
tests/test_node_health.py(fixtures follow an HGX B300 node as a non-root user seesit: no NVSwitch device on the host, ten ConnectX devices, VPD unread, a Completed fabric):
three failed checks after active ->
ok, bad_once, lost, lostwith onenode_healthevent; every non-active state sticks; active clears the streak; read failures keep the
memory; PCIe /
N/A/ GB tray / VPD-without-switch nodes never report, even after activein the boot; the NVSwitch table case by case; a new boot behaves as before; a new
launcher on B300 (with and without root) and Hopper reports every non-active state at
once and reaches
lost; first reads that cannot judge are not counted (fabric timedout, then three failed reads ->
ok, bad_once, lost, lost);inactiveat the first readby NVSwitch and fabric; restart counting per boot;
fabric_manager_absoluteon onecheck, including the B300 sample with the fabric unread ->
unread; a unit that is notthere (Hopper, B300 by name, B300 as root with PF VPD readable): with no process
ok, ok, okandunread, with a processactive, a process seen then gone ->bad_once, lost, a fabric not completed still bad; one NVSwitch device; a B-like name(
B40); the section script run under bash against fake systemctl (LoadState) / lspci /timeout / procfs / process comm / device files / sysfs VPD (
SW_MNGon a.1functiononly); the review scenarios (masked unit crashed / with its process, stale disabled or
failed host unit with a driver-container fabric manager, a failed unit with nothing
running on Hopper and on B300 as root, systemd < 230 without
--value); B300 withoutroot by
ActiveEnterTimestampMonotonic(never active -> ok, active before -> lost,unread -> unread); only
lspci 10de:22a3with nothing running -> lost, only anotherNVIDIA
0680bridge -> ok / unread; off-host guests; hidepid and containers (detection bysystemd-detect-virt -coutput and its fallbacks, a failed unit active in the boot stillbad); a unit-less fabric manager whose processes change (a transient extra process is no
restart, all replaced is one); the restart streak and its
node_health_fm_restartedevent (island launcher and pool,
tests/test_node_health_wiring.py); VPD FIFOs that neveranswer (1 s each, 3 s in all); no boot id; older prev formats.
Mutation testing on the new code: the earlier rounds' 89 mutants that still
apply, 89 killed (9 more target code this round rewrote and are replaced by its own); this
round 51 (45 in
node_health.py, 6 in the island and pool event wiring), 51 killed. Onemore was equivalent and its condition removed from the code: the per-boot check on the
restart streak (a new boot's first check never counts a restart, so the streak is zeroed
anyway).
Gates
pool.nc-mi355x-agentic-262k vs origin/main; trainer
yeto launch --dry-runrc=0 on bothsides, pool plan printed, only the offline model_pull / sandbox status checks fail)
test_k31_customer_plan_golden+tests/golden/breakers: 52 passed on main and branch;no golden file changed
test_exact_option_names::test_every_entry_point_under_yeto_parses_full_names_only,which failed on main itself (
yeto/node/smoke.py, fixed by node smoke: take full option names only (fixes main's exact-parser coverage test) #927); after rebasing ontonode smoke: take full option names only (fixes main's exact-parser coverage test) #927 that file and the node health tests pass
The customer path is unaffected: the node health check only runs on resident ssh islands
and node runtimes of the cuda family; it changes no rendered command.
🤖 Generated with Claude Code