Repository navigation
Conversation
…ails apply_dataloader_state has every rank check the kept data position with its loader's check_state, and _position_refusals shares the verdicts with one all_gather_object on the manager's gloo group. When that gather itself failed, for example with a gloo timeout because another rank reached it only after the group's timeout, a rank whose check had failed or refused raised the gather's error alone. The gather now runs through run_keeping_own_error, with the rank's refusal built as a DataPositionError before it: such a rank raises its own error with the gather's failure in a note, and a rank whose check passed raises the gather's error with a note naming the check. A refusal is kept only where it raises, on a resume: after a warm start or on a carried position it only restarts the data, so there the rank raises the gather's failure. The success path and the path without a process group are unchanged. A two-rank gloo test lets the gather time out on a rank whose check failed or refused, and a test with the gather made to fail covers the warm start.
After a warm start, or on a position carried by checkpoint.ignore_rank_state_mismatch, a refusal only restarts the data, so a rank whose check refused raises the gather's failure when the gather of the checks itself fails, and its refusal showed nowhere. That rank now first logs why its check refused, as a warning that says the run stops. It still raises the gather's failure, and the logs when the gather completes are unchanged. The test with the gather made to fail now covers a resume, a warm start and a position carried onto a changed world size, for a failed check and a refusal, with the warning. The docstring of _position_refusals lists the gather's own failure under Raises.
The warning that a rank whose check refused logs when the gather of the checks fails, after a warm start or on a carried position, went through the training log's handler, which drops a record on any rank but 0 unless it is marked for every rank. Only that rank knows why its check refused, so the warning is now marked every_rank, and the test checks that it passes the rank-0 filter on rank 1.
This branch has not been deployed
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.
Summary
CheckpointManager.apply_dataloader_statehas every rank check the kept position with its loader'scheck_state, and_position_refusalsshares the verdicts withall_gather_objecton the manager's gloo group before any rank applies it. When that gather itself failed, as when another rank reached it only after the group's timeout (distributed.nccl_timeout_sec) or its process exited, a rank whose check had failed (such as one that could not see a data file) or had refused the position raised only the gather's error, so no rank's output said why the position could not be applied. In When the gather of a resumed data position's checks fails, a rank whose check failed or refused raises only the collective's error, not its own #790's reproduction, which gives the group a 5 s timeout, that error is gloo'sTimed out waiting 5000ms for send operation to complete. The gather now runs throughrun_keeping_own_error, with this rank's refusal built as aDataPositionErrorbefore it: that rank raises its own error, with the gather's failure in a note (in the reproduction,Checking the saved data position could not be agreed across ranks: RuntimeError: ... Timed out waiting 5000ms for send operation to complete), and a rank whose check passed raises the gather's failure with the noteChecking the saved data position succeeded on this rank but could not be agreed across ranks.warm_startload, or on a position thatcheckpoint.ignore_rank_state_mismatchcarried onto a changed topology, a refusal only restarts the data on every rank, with a warning, when the gather completes, so a rank whose check refused there raises the gather's failure when it fails, as a rank whose check passed does. So that its reason is not lost, that rank first logs it as a warning that shows on any rank (not only rank 0), names the rank and says the run stops:The saved data position does not carry over to this run on rank 1, and sharing the ranks' checks of it failed, so the run stops: .... A check that failed is kept in every case, since it is raised in every case when the gather completes. The logs when the gather completes are unchanged.apply_dataloader_stateand_position_refusalssay what a rank raises when the gather fails, andcodebase-map.jsonupdates the_position_refusalsentry and counts the new tests.run_keeping_own_errorthat Agree on the data build across ranks and name a refused step-0 data phase #776 adds, and moves to main when Agree on the data build across ranks and name a refused step-0 data phase #776 merges.Testing
Every tier below ran at the head,
84154b7c, which contains #776's head7d61eb9e.ruff check .: clean;ruff format --check .: 353 files formatted;pyright kempnerforge/: 0 errorssphinx-build -W --keep-going -b html docs ...: build succeededpytest tests/unit --timeout=60 --cov --cov-branch): 6788 passed, 14 skipped (13 need CUDA, 1 needs the network), and the cluster-only timeout oftest_pipeline_checkpoint_layouts.py::TestAcrossRanks::test_the_stages_continue_a_run_saved_without_pp[muon-pp3], which runs past the 60 s limit on a busy cluster CPU node and passed alone here with a longer limit.test_pipeline_checkpoint_layouts.py::TestAcrossRanks::test_the_stages_continue_a_run_saved_without_pp[muon-pp3], andtest_streaming_resume.py::test_a_pass_restarted_midway_draws_a_new_base_seed_that_a_resume_keepsandtest_streaming_resume.py::test_a_load_into_a_running_stream_starts_new_workers_from_the_loaded_state, whose stream workers ran past the 60 s limit beside the other unit tiers.scripts/check_dependency_floors.py --group videopasses): 6787 passed, 15 skipped (13 need CUDA, 1 needs the network, 1 needsmlflow.telemetry, which the mlflow floor lacks), and the same cluster-only timeout oftest_pipeline_checkpoint_layouts.py::TestAcrossRanks::test_the_stages_continue_a_run_saved_without_pp[muon-pp3], which passed alone here with a longer limit.ci-example.ymlruns them, on Python 3.14 and 3.12:examples/vlm/tests(withouteval/integration) 407 passed,examples/image_understanding/tests1587 passed andexamples/assembled_run/tests12 passed, on eachpytest tests/integration: 157 passedpytest tests/e2e --e2e --slow: 54 passedtorchrun --nproc_per_node=4 -m pytest tests/distributed --slow: 213 passed on every rank7d61eb9e, with this branch's test file, and pass here:test_a_check_that_failed_or_refused_raises_its_own_error_when_the_gather_times_out(2 cases; two gloo ranks, a 5 s timeout on the checkpoint manager's group; rank 1's check fails at once withFileNotFoundErroror refuses withDataPositionError, and rank 0 checks only once rank 1's wait in the gather has timed out): at Agree on the data build across ranks and name a refused step-0 data phase #776's head rank 1 raises only gloo'sTimed out waiting 5000ms for send operation to complete; here it raises its own error, with the gather's failure in a note, and rank 0's error notes the check.test_a_failed_gather_keeps_a_ranks_own_error_and_logs_a_refusal_that_does_not_raise(6 cases; the gather made to raise after a resume, a warm start and a position thatcheckpoint.ignore_rank_state_mismatchcarried onto a changed world size, for a failed check and a refusal): at Agree on the data build across ranks and name a refused step-0 data phase #776's head all six raise the gather's error with no note; here a failed check raises its own error with the gather's failure in a note after each, as a refusal does on the resume, and after the warm start and on the carried position a refusal is logged as a warning that the training log's rank-0 filter lets through on rank 1, then the gather's failure raised with a note naming the check.tests/unit/test_streaming_resume.py: a flag resume and a warm start restarting every rank when one rank sees a data file at another size, every rank raising without the flag, and every rank stopping when one rank's check fails another way).ce2d5c61rank 1 raises only gloo's timeout in bothlateruns; at84154b7cit raisesFileNotFoundError: [Errno 2] No such file or directory: 'train-00001.jsonl'andDataPositionError: The data changed since the save: a data file changed size, with the timeout in a note, and theon timelines are unchanged.kempnerforge/is covered in one process, bytests/unit/test_data_position.py.Closes #790