Skip to content

DAOS-19058 pydaos: torch surface worker errors in parallel_list#18414

Open
enakta wants to merge 4 commits into
masterfrom
0xe0f/DAOS-19058
Open

DAOS-19058 pydaos: torch surface worker errors in parallel_list#18414
enakta wants to merge 4 commits into
masterfrom
0xe0f/DAOS-19058

Conversation

@enakta
Copy link
Copy Markdown
Contributor

@enakta enakta commented Jun 3, 2026

Worker processes spawned by _Dfs.parallel_list may raise exceptions that never reached the calling process. This results in indefinite hang during Dataset and IterableDataset construction with no surfaced error to the user.

Replacing manual Process + Queue scheme and its queued/processed counter with a multiprocessing.Pool driven by imap_unordered. Pool re-raises worker exceptions in the parent when their results are consumed, so a worker error now propagates as a raised OSError instead of a deadlock, and the Pool context manager reaps all workers on any exit path.

concurrent.futures.ProcessPoolExecutor would be even better but its initializer/initargs arguments are unavailable before Python 3.7, and the target runtime includes EL8.8 / Python 3.6.

Features: pytorch

Steps for the author:

  • Commit message follows the guidelines.
  • Appropriate Features or Test-tag pragmas were used.
  • Appropriate Functional Test Stages were run.
  • At least two positive code reviews including at least one code owner from each category referenced in the PR.
  • Testing is complete. If necessary, forced-landing label added and a reason added in a comment.

After all prior steps are complete:

  • Gatekeeper requested (daos-gatekeeper added as a reviewer).

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Ticket title is 'pytorch parallel_list does not surface worker process errors, causing silent hangs'
Status is 'In Progress'
Labels: 'request_for_2.8'
https://daosio.atlassian.net/browse/DAOS-19058

Worker processes spawned by _Dfs.parallel_list may raise exceptions that
never reached the calling process. This results in indefinite hang during Dataset
and IterableDataset construction with no surfaced error to the user.

Replacing manual Process + Queue scheme and its queued/processed
counter with a multiprocessing.Pool driven by imap_unordered. Pool
re-raises worker exceptions in the parent when their results are
consumed, so a worker error now propagates as a raised OSError instead
of a deadlock, and the Pool context manager reaps all workers on any
exit path.

`concurrent.futures.ProcessPoolExecutor` would be even better
but its initializer/initargs arguments are unavailable before
Python 3.7, and the target runtime includes EL8.8 / Python 3.6.

Features: pytorch

Signed-off-by: Denis Barakhtanov <dbarahtanov@enakta.com>
@daosbuild3
Copy link
Copy Markdown
Collaborator

Comment thread src/client/pydaos/torch/torch_api.py Outdated
Comment thread src/client/pydaos/torch/torch_api.py Outdated
Comment thread src/client/pydaos/torch/torch_api.py
Copy link
Copy Markdown
Contributor

@daltonbohning daltonbohning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your branch is ~150 commits behind master so you should merge latest master

enakta and others added 3 commits June 4, 2026 10:46
Co-authored-by: Dalton Bohning <dalton.bohning@hpe.com>
Signed-off-by: enakta <140368024+enakta@users.noreply.github.com>
Features: pytorch

Signed-off-by: Denis Barakhtanov <dbarahtanov@enakta.com>
@enakta enakta changed the title DAOS-19058 pydaos.torch: surface worker errors in parallel_list DAOS-19058 pydaos: torch surface worker errors in parallel_list Jun 4, 2026
@enakta enakta marked this pull request as ready for review June 4, 2026 01:07
@enakta enakta requested review from a team as code owners June 4, 2026 01:07
@daosbuild3
Copy link
Copy Markdown
Collaborator

@daosbuild3
Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants