fix(dataset): detect failed streaming packing workers - #10083
Open
MrCapricornLiu wants to merge 2 commits into
Open
fix(dataset): detect failed streaming packing workers#10083MrCapricornLiu wants to merge 2 commits into
MrCapricornLiu wants to merge 2 commits into
Conversation
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.
PR type
PR information
With streaming packing and
strict=True, an encoding error other thanMaxLengthErrorterminates a packing worker. The iterator still waits for onequeue result per submitted sample, so it blocks indefinitely. An unexpected
worker exit has the same effect.
Poll the output queue and check the workers' process sentinels when no result
arrives. Raise a
RuntimeErrorpointing to the worker logs if a worker hasexited. Sentinels also work when a forked DataLoader process inherits the
packing workers; checking
exitcodethere cannot detect processes owned byits parent. Live workers may take longer than the polling interval, and
non-strict errors and
MaxLengthErrorretain their existing skip behavior.Experiment results
CUDA_VISIBLE_DEVICES='' OMP_NUM_THREADS=1 TOKENIZERS_PARALLELISM=false \ HF_HUB_OFFLINE=1 python -m pytest \ tests/general/test_packing_multiprocessing_context.py -qAll 40 tests pass, including seven regressions for strict errors, abrupt exit,
skipped samples, slow workers, and failure/live-worker behavior through a
forked DataLoader consumer. The two original worker-failure regressions fail
without the fix. Changed-file pre-commit and diff checks pass.
Tested on Linux with Python 3.12 and real spawned packing workers. Full model
training, distributed training and Windows/macOS were not run. Workers that
remain alive but are stuck inside an encoder are outside this change.