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

[WIP] Interpreter Pool Executor #4

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tonybaloney
Copy link
Collaborator

This is a sketch as I'm trying to build it out and this PR can just be a way of highlighting challenges.

Branch of #3

Copy link
Owner

@jsbueno jsbueno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These look great!

Feel free to ask any general questions about the architecture around -
There are a few things I had started, and got stalled because I then decided to pursue another path.

Merge these at will -

# .intno and .id are both set to the interpreter id,
# but .intno is set to None when the interpreter is closed.
self.intno = self.id = None
self.name = name
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you also add name to __repr__ in the same batch?

src/extrainterpreters/executor.py Show resolved Hide resolved
@@ -41,8 +41,8 @@ class FuncData(StructBase):
def _dispatcher(pipe, buffer):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is in a very early stage - but the concept looks fine: a looping listener function in each interpreter tied to a queue which will send different tasks - which could be run a function, spin a thread, and so on.

I am thinking of doing away with the "PipedInterpreter" altogether, and have an optional post-start call which would start such a listenner function. The InterpreterPoolExecutor would do it automatically.

Just let me know if you have a different idea to approach this.

@@ -41,8 +41,8 @@ class FuncData(StructBase):
def _dispatcher(pipe, buffer):
"""the core running function in a PipedInterpreter

This is responsible for watching comunications with the parent
interpreter, dispathing execution, and place the return values
This is responsible for watching communications with the parent
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as you can see, my code editor does not spell check English - :-) I always have a hard time with doubled consonants.

@tonybaloney
Copy link
Collaborator Author

It doesn't work at the moment. I'm still building on it. It's almost a carbon copy of the thread worker pool. The worker queue and callbacks can't be pickled, so we need a way of dispatching work to the pool. The interpreter queue might do the trick

@jsbueno jsbueno force-pushed the main branch 3 times, most recently from 64ee87e to ce004a7 Compare September 28, 2024 18:45
@jsbueno jsbueno force-pushed the main branch 6 times, most recently from 695aaa7 to fcfa810 Compare November 16, 2024 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants