-
Notifications
You must be signed in to change notification settings - Fork 63
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
Embedded Python interpreter spawns multiple forks of ngen/test_routing_pybind on macOS #505
Comments
This smells familiar. Python 3.8 changed the semantics of new processes creation on macOS. Previously this was accomplished using
If possible, I think the easiest way to determine if |
Uh, so is macOS a subset of Unix, or not? 😵 |
MacOS was handled like Unix in the past since it made... you know... sense (like you pointed out), but Apple changed up how processes are handled several years ago (I can't remember if they chucked pthreads out or something). As a result, you had to set the default process creation mode or else the whole thing would/could crash and burn. The devs behind Python later rolled their eyes and changed how it's handled on mac by default so... you know... programs work. |
I am guessing this caveat also applies to binaries that embed the Python interpreter with pybind11 (or CPython for that matter):
|
HMM! This is maybe what will need to be done...or part of it at least.
|
This has cropped up again, so it appears the |
This commit in PR #502 was required to make the t-route integration test pass on the macOS runner. Without it, the test executable recursively forked itself. This was reproduced on a Mac (macOS 13, Python 3.11) and the behavior was the same when trying to run an ngen executable with routing with
cpu_pool
> 1. This was tested withparallel_compute_method
of bothby-subnetwork-jit-clustered
andby-network
. Also, an attempt was made after changing the backend in t-route fromloky
tothreading
, but the behavior persisted. This could be related to Python 3.11 or the new PyBind11 version 2.10.Current behavior
See above. It seems as though joblib is forking the current executable which it expects to be Python, but in this case is not. Or if this is supposed to work, then the executable's
main
is getting executed instead of whatever other starting point is supposed to begin executing.Expected behavior
Parallelization in t-route seemed to work previously (ngen branch) without forking multiple test_routing_pybind or ngen processes. This seems to be Mac-specific, Linux is not doing this.
Steps to replicate behavior (include URLs)
cpu_pool
parameter in the test YAML file to 2 or more.Screenshots
The text was updated successfully, but these errors were encountered: