Skip to content

[Runtime][PipelineExecutor] Add the pipeline internal forwarding logic.#10543

Merged
masahi merged 5 commits intoapache:mainfrom
huajsj:queue
Mar 14, 2022
Merged

[Runtime][PipelineExecutor] Add the pipeline internal forwarding logic.#10543
masahi merged 5 commits intoapache:mainfrom
huajsj:queue

Conversation

@huajsj
Copy link
Copy Markdown
Contributor

@huajsj huajsj commented Mar 9, 2022

[RFC] https://github.com/apache/tvm-rfcs/blob/main/rfcs/0014-pipeline-executor.md
[Issue] #8596

This patch use the SPSC lock free queue to forward the parent runtime output data into the child runtime input interface.

There are also some logic to handle data copy and "STOP" state check within some loops for example the loop of
push data .

This patch use the SPSC lock free queue to forward the runtime output data
into the child runtime input interface.
@huajsj
Copy link
Copy Markdown
Contributor Author

huajsj commented Mar 10, 2022

@masahi , @comaniac , please take a look.

Comment thread include/tvm/runtime/spsc_queue.h
Comment thread include/tvm/runtime/spsc_queue.h Outdated
Comment thread src/runtime/pipeline/pipeline_struct.h Outdated
Comment thread src/runtime/pipeline/pipeline_struct.h Outdated
Comment thread src/runtime/pipeline/pipeline_struct.h Outdated
Comment thread src/runtime/pipeline/pipeline_struct.h Outdated
Comment thread src/runtime/pipeline/pipeline_struct.h Outdated
Comment thread src/runtime/pipeline/pipeline_struct.h Outdated
while (!forward_queue->Push<NDArray>(output)) {
if (PipelineIsStop()) {
LOG(INFO) << "The forwarding queue pushing is stopped due to the pipeline state "
<< "is changed into stop.";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Broken english

Copy link
Copy Markdown
Contributor Author

@huajsj huajsj Mar 13, 2022

Choose a reason for hiding this comment

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

fixed.
"The forwarding process is stopped after the pipeline status is changed into stop."

@huajsj huajsj requested a review from masahi March 14, 2022 18:19
@masahi masahi merged commit f9f9f1d into apache:main Mar 14, 2022
pfk-beta pushed a commit to pfk-beta/tvm that referenced this pull request Apr 11, 2022
…c. (apache#10543)

* [Runtime][PipelineExecutor] Add the pipeline internal forwarding logic.

This patch use the SPSC lock free queue to forward the runtime output data
into the child runtime input interface.

* remove debug logic.

* address review comments.

* correct a variable comments.

* address review comments.
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