Skip to content

Forward worker exceptions and exit with it#1003

Closed
priyaramani wants to merge 13 commits intomainfrom
forwarderror
Closed

Forward worker exceptions and exit with it#1003
priyaramani wants to merge 13 commits intomainfrom
forwarderror

Conversation

@priyaramani
Copy link
Contributor

@priyaramani priyaramani commented Feb 9, 2023

When a worker thread fails in PrototypeMultiProcessingReadingService, exception was silently neglected and the thread hanged. This PR fixes that by catching and propagating exception to response queue, showing that to user and exiting the process instead of hanging.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 9, 2023
Copy link
Contributor

@ejguan ejguan left a comment

Choose a reason for hiding this comment

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

For lint error, can you please follow https://github.com/pytorch/data/blob/main/CONTRIBUTING.md#code-style to fix them automatically?

Copy link
Contributor

@ejguan ejguan left a comment

Choose a reason for hiding this comment

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

You might want to rebase onto main branch again. I have already renamed PrototypeMultiProcessingReadingService to MultiProcessingReadingService

Copy link
Contributor

@NivekT NivekT left a comment

Choose a reason for hiding this comment

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

LGTM overall with some questions:

dp = MakeMistakeDataPipe(dp)
for worker_prefetch_cnt in [0, 5, 10]:
for num_workers in [1, 4]:
rs = MultiProcessingReadingService(num_workers=num_workers, worker_prefetch_cnt=worker_prefetch_cnt)
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if there is a DataPipe after Prefetcher? Does it still work properly?

e.g. dp.map().prefetch().map()

@facebook-github-bot
Copy link
Contributor

@priyaramani has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@priyaramani merged this pull request in b717187.

@NivekT NivekT mentioned this pull request Mar 20, 2023
@andrewkho andrewkho deleted the forwarderror branch September 26, 2024 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants