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

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

Merged
merged 5 commits into from
Mar 14, 2022

Conversation

huajsj
Copy link
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
Contributor Author

huajsj commented Mar 10, 2022

@masahi , @comaniac , please take a look.

include/tvm/runtime/spsc_queue.h Outdated Show resolved Hide resolved
src/runtime/pipeline/pipeline_struct.h Outdated Show resolved Hide resolved
src/runtime/pipeline/pipeline_struct.h Outdated Show resolved Hide resolved
src/runtime/pipeline/pipeline_struct.h Outdated Show resolved Hide resolved
src/runtime/pipeline/pipeline_struct.h Outdated Show resolved Hide resolved
src/runtime/pipeline/pipeline_struct.h Outdated Show resolved Hide resolved
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
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
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