-
Notifications
You must be signed in to change notification settings - Fork 26.3k
DataLoader: add error detection for worker_init_fn #20150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fb41e26 to
66a8005
Compare
|
@apaszke Do you plan to review this or should I find someone else? |
apaszke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, but here's an idea: instead of guarding every single place where an error might be raised inside the worker function, wrap it in another one and have a catch-all for any errors that might get thrown. The code used to transmit exceptions to the master process can get isolated and called from both places to avoid duplication.
|
@apaszke Thanks for the suggestion. I've given your proposal some thought. It is a nice idea, but for implementation we seem to have to try-catch in initialization or specialize the first iteration. I don't think it is worthwhile since we only need to cover this particular worker loop pattern. If in future we need to have another similar loop, we should definitely make this more general. :) |
|
@pytorchbot merge this please |
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ezyang is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
This is an attempt to isolate unrelated changes from #19228 for easier review.