Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 10 files with indirect coverage changes 🚀 New features to boost your workflow:
|
…ublic A rank without a build error notes the eval set and split on a failed broadcast of rank 0's outcome, and rank 0 sends an error it cannot format by its type's name. scripts/eval.py imports the helper as broadcast_hf_eval_set, whose docstring states its devices; the codebase map and the Hugging Face data page describe it.
amazloumi
marked this pull request as ready for review
December 6, 2026 11:08
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
eval.hf_dataset_nameset,build_eval_dataloaderbuilt the eval set on rank 0 alone, then every rank met in a broadcast of the number of packed sequences, and nothing told the other ranks when rank 0's build raised: a tokenizer, dataset, config or split that does not resolve, a Hub or network error, an eval set without thedata.hf_dataset_text_fieldcolumn, or a split too short to fill one sequence. Once NCCL had connected the ranks, as tensor parallelism does, they waited in that broadcast untildistributed.nccl_timeout_sec(1800 s by default) and NCCL's watchdog ended them, or until the launcher killed them (about 30 s undertorchrunandsrun --kill-on-bad-exit=1), and where they failed sooner, as under data parallelism alone, their error did not name rank 0's. Rank 0 now catches its build error and broadcasts its outcome, the number of sequences or the error, before the sequences, as_newest_saveinscripts/eval.pyandCheckpointManager._broadcast_train_statealready do. Rank 0 raises its own error; every other rank raisesRuntimeError: Rank 0 could not build the eval set from <name> (<split>): <rank 0's error>. When rank 0's error cannot be formatted, as with a malformedSyntaxError, the others get its type's name alone (<unprintable SyntaxError>), so formatting it never keeps rank 0 out of the broadcast.broadcast_object_liston the default process group, in place of the count's tensor broadcast. torch runs object collectives on the CPU over Gloo under the defaultdistributed.backend(cpu:gloo,cuda:nccl), and on the current GPU when the backend is NCCL alone; the sequences still go out with the samedist.broadcaston the run's device. A healthy build gains one small collective (the object broadcast sends the payload's size, then the payload). Without a process group nothing changes: the process builds the set and raises its own error.Rank 0's outcome for the eval set from <name> (<split>) could not be broadcast.scripts/eval.pybuilds its Hugging Face eval set through the same helper,broadcast_hf_eval_setinkempnerforge/training/data_pipeline.py, in place of its copy of the block, so an error there fails every rank the same way. The helper is public because a script imports it, andcodebase-map.jsonlists it. Its docstring states the devices: the outcome on torch's object-collective device, the sequences on the given device, the result on the CPU.docs/data/huggingface.mdsays what a build error on rank 0 does.Testing
Every tier below ran at the head,
c8112fcc, which branches from main atbdaf4a4c. The two GPU runs of the eval-set build at the end ran at9c546cf1, the commit before the head, whose changes leave both paths they take unchanged.ruff check .: all checks passed;ruff format --check .: 353 files already formatted;pyright kempnerforge/: 0 errorssphinx-build -W --keep-going -b html docs ...: build succeeded, withbroadcast_hf_eval_setin the generated API referencepytest tests/unit --timeout=60 --cov --cov-branch): 6700 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 ran past the 60 s limit and passed alone here, under coverage, at the 60 s limit and with a longer one.[muon-pp3]timeout, which passed alone here with a longer limit, in 88 s.scripts/check_dependency_floors.py --group videopasses): 6699 passed, 15 skipped (13 need CUDA, 1 needs the network, 1 needsmlflow.telemetry, which the mlflow floor lacks), and the same[muon-pp3]timeout, which passed alone here, at the 60 s limit and with a longer one.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/tests9 passed, on each.pytest tests/integration: 157 passedpytest tests/e2e --e2e --slow: 54 passedtorchrun --nproc_per_node=4 -m pytest tests/distributed --slow: 213 passed on every rankbdaf4a4cwith this head's test files and pass here:TestHuggingFaceEvalSetAcrossRanks::test_an_error_building_it_on_rank_zero_raises_on_every_rankintests/unit/test_train_entry.py(two gloo ranks runbuild_eval_dataloader; rank 0'sHuggingFaceDatasetcannot reach its eval set, and each rank catches what it raises and stays in the group, as a rank's NCCL peers keep waiting for it): there rank 1 is still in the build 30 s after both ranks entered it; here rank 0 raises itsConnectionErrorand rank 1RuntimeError: Rank 0 could not build the eval set from no-such-org/no-such-eval-set (validation): ConnectionError: ...within that time.TestEvalScriptHuggingFaceEvalSet::test_an_error_building_it_on_rank_zero_raises_on_every_rankintests/unit/test_eval_script.py, the same throughscripts/eval.py'smainon two gloo ranks: there rank 1 is still inmain30 s after both ranks entered it; here both ranks raise as above.TestEvalDataloaderBuilder::test_rank_zero_raises_its_own_build_error_when_it_cannot_send_it,test_a_rank_without_a_build_error_raises_a_failed_send_naming_the_eval_set(on rank 0 after a good build and on rank 1) andtest_rank_zero_sends_a_build_error_it_cannot_format: there rank 0 sends no outcome at all. The last two also fail on9c546cf1, the commit before the head: there a failed send reaches a rank without a build error with no note, and formatting the malformedSyntaxErrorraises before rank 0 enters the broadcast.bdaf4a4cas here:test_every_rank_gets_the_rows_rank_zero_built(two gloo ranks get the same rows) andtest_hf_eval_raises_its_build_error_when_not_distributed.bdaf4a4crank 1 of the two-process launch exits with status 134 about 110 s after rank 0 raises, andtorchrunexits about 30 s after it; on9c546cf1both ranks of the two-process launch, andtorchrun, exit with status 1 about 0 s after rank 0 raises, rank 1 withRuntimeError: Rank 0 could not build the eval set from no-such-org/no-such-eval-set (validation): ConnectionError: Couldn't reach 'no-such-org/no-such-eval-set' on the Hub (OfflineModeIsEnabled).scripts/train.pybuilds the same 486 sequences as onbdaf4a4cand logs the sameeval/lossat steps 10 and 20, andscripts/eval.pyreports the sameeval/lossand perplexity as onbdaf4a4cfor the same checkpoint.kempnerforge/is covered bytests/unit/test_train_entry.py, the gloo ranks it spawns included.Closes #778