Skip to content
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 Request for MultiProcessExecutor #1229

Open
Schteve-Earl opened this issue Feb 27, 2024 · 2 comments
Open

Feature Request for MultiProcessExecutor #1229

Schteve-Earl opened this issue Feb 27, 2024 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@Schteve-Earl
Copy link

Hey ya'll,
I've recently run into some fundamental issues regarding the use of the MultiThreadedExecutor. In my project, I have multiple services that I need to call concurrently. I've designed my system such that only one service node of each type needs to be launched, and that service uses a multi-threaded executor to handle a bunch of CPU processing tasks in parallel. This paradigm works fine for the nodes that I've written in CPP, but they are being bottle-necked by the nodes that I've written in Python. I understand the rationale in implementing the threading library in the MultiThreadedExecutor, and I think it still has a place for when a node has multiple I/O bound processes without much CPU-based processing. But, in this instance, it would be nice to have an executor that mimics the functionality of the CPP MultiThreadedExecutor, and allows the node to take full advantage of modern processors to parallelize work that is CPU intensive, without having to rewrite the node (and supporting libraries) in CPP. Therefore, I propose the creation of a MultiProcessExecutor. This new type would mimic the functionality of the MultiThreadedExecutor, but would replace the usage of the concurrent.futures ThreadPoolExecutor with the ProcessPoolExecutor. Obviously, care would needed to be taken to ensure that creating new memory spaces doesn't nuke the user's machine. Additionally, I haven't dug too far into the code yet, so I don't know if inter-process communication needs to occur, and how difficult this would be to add to the context. Is this something that the community would like to see?

@clalancette
Copy link
Contributor

I think it would probably be pretty difficult to do, because you would have to share a ton of state between the various processes. That said, if you are interested in giving it a shot, it would be interesting to see what it looks like.

We won't have time to work on it, but I'll leave this open in case you want to leave updates.

@clalancette clalancette added the help wanted Extra attention is needed label Feb 29, 2024
@ruthvik92
Copy link

I think it would probably be pretty difficult to do, because you would have to share a ton of state between the various processes. That said, if you are interested in giving it a shot, it would be interesting to see what it looks like.

We won't have time to work on it, but I'll leave this open in case you want to leave updates.

I am curious, do you know what are some of the major objects that need to be shared between processes ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants