Add warning on ParallelRunner about serialization/pickling errors - #5734
Open
lrcouto wants to merge 11 commits into
Open
Add warning on ParallelRunner about serialization/pickling errors#5734lrcouto wants to merge 11 commits into
lrcouto wants to merge 11 commits into
Conversation
…n using cloud-based datasets Signed-off-by: Laura Couto <laurarccouto@gmail.com>
Signed-off-by: Laura Couto <laurarccouto@gmail.com>
Signed-off-by: Laura Couto <laurarccouto@gmail.com>
Signed-off-by: Laura Couto <laurarccouto@gmail.com>
merelcht
approved these changes
Aug 21, 2026
merelcht
left a comment
Member
There was a problem hiding this comment.
Thanks @lrcouto, this looks good to me 👍
One thing I was wondering is if we could also suggest using SequentialRunner? Or is the assumption the user wants some sort of optimisation and that's why they picked ParallelRunner in the first place?
Contributor
Author
I was working under the assumption that if user picks ParallelRunner it's because they want some sort of optimization, since SequentialRunner is the default option. But I don't see an issue in adding it to the suggestions. |
Signed-off-by: Laura Couto <laurarccouto@gmail.com>
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.
#4690
Add warning on ParallelRunner about serialization/pickling errors when using cloud-based datasets
What it does
Datasets backed by remote/cloud storage using
fsspecfrequently hold non-picklable internal states, like a cached filesystem client for example, and these do not play nice withParallelRunner. It multiprocesses by running separate OS processes that don't share memory. Because these processes do not share memories, apipeis needed to to communicate and share bytes between those processes. For this to happen, objects need to be serialized/pickled (multiprocessing.reduction.ForkingPickler), so no pickling, no multiprocessing.This PR adds a warning to
ParallelRunnerin case one of these cloud protocols (s3, gcs, hdfs, etc) is being used, suggesting that they chooseThreadRunnerinstead. It uses threading instead of forking processes, so it doesn't have this same limitation.Why not change the Datasets themselves?
It would be possible to change the
self._fs = fsspec.filesystem(...)line on the "offending" datasets with a different pattern that avoids this issue. The problem is that this change would have to be done on around 40 different datasets, which would have to be either one massive PR that alters a lot of files, or many separate PRs that alter few files each, and would widen the scope of the original issue. Something that we might want to address in the future.Checklist
RELEASE.mdfile