-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[Feature]: improve distributed backend selection #8683
Comments
@youkaichao I looked into this a bit, and it doesn't seem straightforward. Let me know if you have a particular method in mind. Another idea:
(for reference, this was a related PR where I was changing the default: #8576) |
then maybe you can add this. I think it can be enough. |
OK - you can assign this to me. |
I thought this was interesting. While testing out the behavior of different scenarios, I see that Python already does a nice job of detecting the case where
|
🚀 The feature, motivation and pitch
We have three ways to start a new process:
fork
spawn
by default, we use ray for multi-node serving, and multiprocessing by
fork
for single node setting.however, if users initialize cuda context, multiprocessing by
fork
will not work.if we set multiprocessing by
spawn
by default, it will not work when users don't haveif __name__ == "__main__"
.if we can figure out whether users have
if __name__ == "__main__"
automatically, we can improve the default user experience.the proposed solution is:
if we find that cuda is initialized, we inspect the current function call stack, and trace back the stack until we reach the
__main__
module, check the current line to see if we are underif __name__ == "__main__"
, if yes, switch the multiprocessing method fromfork
tospawn
.cc @russellb
Alternatives
No response
Additional context
No response
Before submitting a new issue...
The text was updated successfully, but these errors were encountered: