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
Add _multiprocessing stub #2094
Conversation
Is the issue with importing |
Good point. This is for Joblib has |
If the specific issue is for joblib, I would rather be +1 to for now patch joblib, and then try to contribute Pyodide compatible code upstream. I know joblib devs and it's likely they would accept it. There are fairly few parallelism specific libraries such as joblib where this would happen. I'm a bit wary of patching threading or multiprocessing stdlib code with custom implementation since as #796 showed it can lead to even harder to debug issues down the road. Also I'm not sure that having 4 extra failing stdlib tests (even if technically they were in part skipped before) is worth this potential fix for other packages, until we get at least some bug report that this is indeed an issue people encounter. |
They were entirely skipped before, they have guards at the top of the file that skip the test if |
But I think you are correct that this is the wrong approach. The problem is in joblib, we should patch joblib and submit a PR. |
Ah well the problem is really with from .externals.loky import wrap_non_picklable_objects and |
That's OK, we can patch externals.loky. Loky is done by some of the same people, they just decided to vendor it, so a fix would take more time to propagate.. |
I am going to open a PR on joblib adding a test. For 0.19, maybe we should just revert to the old version of joblib. |
Yeah, that would be the easiest. |
Probably we should try to do these package updates some time other than right before the release. If we had a bot or something to periodically whine about out of date packages... |
Opened a PR on joblib: joblib/joblib#1246 |
Different systems feature detect
multiprocessing
in different ways. There are three different behaviors:The type 3 systems that detect runtime errors are the best behaved (e.g.,
joblib
). Most packages seem to be type 1 (fearless top level imports). We can't simultaneously support both 1 and 2. The only type 2 system is the core Python multiprocessing tests. My thought was it is better to manually xfail the core multiprocessing tests than to patch all type 1 packages.It might be a good idea to try to convince some of the type 1 packages to do something a bit smarter, or to get rid of the top level import.