-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Executor: need multiple thread support #6319
Comments
I think that we will have a pool of DeviceContext. What Executor do is to take a DeviceContext from the pool to run the operator under the guide of device in operator. The Executor have to handle the dependency between operators. And all operators are launched asynchronizedly. |
As discuess at #6223 , we will convert the graph which user defined to a multi-thread graph as(omit the vars): Note that not all the operators will be run with mutli-threads, and the problem is how the executor know which Op will be execute as multi-threads, we can solve this problem as the following:
|
@Yancey1989 I think the executor execute all OP in the thread pool, so all of them are executed with multi-threads. |
I think at least some OP can not run asynchronous, for example: OP that loads data from disk can not run asynchronous with the next OP that uses the data. Maybe asynchronous is just a special case for GPU OP, because GPU stream handles the synchronization? |
Thread pool concept, IO thread, computation thread. |
We are already discussing concurrency design. This issue is out-of-date, closing. |
Currently our
Executor
implementation is single threaded: it runs theProgramDesc
(actuallyProgramDescBind
, unrelated detail) sequentially.It will have severe performance problem with the
ProgramDesc
that contains OPs that load data from disk or send/recv OPs that reads data from the network. The I/O will block the computation that could run in parallel.The
Executor
needs to be able to analyze the dependency according toProgramDesc
(orExecutionPlan
in future if this PR passes), and schedule the OPs whose dependencies are finished to the thread-pool for parallel execution.This issue is blocked by #6317 , since the
Executor
needs a reliable data structure (ProgramDesc
, notProgramDescBind
) to do dependency analysis.The text was updated successfully, but these errors were encountered: