Repository navigation
A bad swarm sidecar on one rank is refused on every rank, before anything is restored (#974) - #1146
Merged
Merged
Conversation
…hing is restored (#974) A disk snapshot's swarm sidecars are per rank, and their checks (the rank count, the variable set, each variable's shape) were made by each rank on its own sidecar, after the mesh variables had been restored and after the rank had cleared its particles: a sidecar damaged on one rank raised there while the others returned from load_state as if the restore had succeeded. The sidecars are now read and checked with the other restore checks (#1041's), before anything is restored, and the verdict is agreed (_agreed_problem): every rank raises the same error, carrying the failing rank, and the model is left as it was. A shape is checked against the count of the particles the sidecar will re-add. Test: one row dropped from the last rank's sidecar, np 2-4: every rank raises the same error, and the mesh variable, the swarm variable and the particle count are untouched. On development one rank raised and the other returned. Underworld development team with AI support from Claude Code
… variable set both ways H6's review: _read_swarm_sidecar_checked caught only OSError and KeyError, so a sidecar whose coordinates were a scalar (IndexError) or whose variable was an HDF5 group (TypeError) raised on its rank before the agreement, and the job hung at np 2. Reading and checking now cannot raise: any failure is reported as that rank's problem into the agreed verdict. A sidecar lacking one of the swarm's variables was accepted and that rank's variable left unrestored; the variable set is now checked both ways. Coordinates must have the swarm's dimension, and a variable's dtype must cast into the swarm's. Tests: four damages to the last rank's sidecar (a row dropped, scalar coordinates, a variable made a group, a variable missing), np 2-4: every rank raises the same error, nothing restored; d1acb3d hangs. The timeout uses the thread method, which a blocked collective cannot stop. Underworld development team with AI support from Claude Code
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.
Fixes #974. A reviewer from the desks with capacity, as the hub assigns.
What and why
A disk snapshot's swarm data is a per-rank sidecar. Its checks were made by each rank on its own sidecar: the rank count, the rank, the mesh name, the variable set, and each variable's shape. They also came late, after the mesh variables had been restored and after the rank had cleared its own particles.
So a sidecar damaged on one rank raised a
ValueErrorthere, while the other ranks returned fromload_stateas if the restore had succeeded. In the probe, one row was dropped from rank 1's sidecar at np 2: rank 0 returned and rank 1 raised.Now the sidecars are read and checked in the same step as the restore's other checks, the step #1041 added for the meshes and variables. That happens before anything is restored, and the verdict is agreed with
_agreed_problem(#1050's refuse-on-every-rank contract). Every rank raises the same error, naming the failing rank, and the model is left as it was. A variable's shape is checked against the number of particles the sidecar will re-add. The restore then applies the payloads it has already checked.Only
checkpoint/disk_snapshot.pychanges._read_swarm_from_sidecaris split into_read_swarm_sidecar_checked(read and check, rank-local) and_apply_swarm_sidecar. The new_checked_swarm_sidecarsruns in the pre-check.Tests
tests/parallel/test_0974_swarm_sidecar_refused_everywhere_parallel.py. A model with a mesh variable and a swarm variable is saved and then changed. One row is dropped from the last rank's sidecar, andload_stateis called under a timeout. Every rank must raise the same error, and the mesh variable, the swarm variable and the particle count must be as they were before the call.[None, "swarm variable 's' shape mismatch ..."].The serial snapshot files (every test file using
save_state,load_stateordisk_snapshot) give 210 passed and 1 xfailed.Review round 1 (H6)
Medium 1. The read and check caught only
OSErrorandKeyError, so a sidecar whose coordinates were a scalar (anIndexError), or whose variable was an HDF5 group (aTypeError), raised on its own rank before the agreement, and the job hung at np 2. Now any failure in reading or checking this rank's sidecar is reported as that rank's problem into the agreed verdict.Medium 2. A sidecar that lacked one of the swarm's variables was accepted, and that rank's variable was left unrestored. The variable set is now checked both ways.
Low. Coordinates must have the swarm's dimension, and a variable's dtype must cast into the swarm variable's.
The test now covers four kinds of damage to the last rank's sidecar: a row dropped, scalar coordinates, a variable made a group, and a variable missing. At np 2, 3 and 4 every rank raises the same error and nothing is restored; on the previous head the new cases hang. The test's timeout uses the thread method, because a signal timeout cannot interrupt a rank blocked in a collective.
Underworld development team with AI support from Claude Code