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][Pipeline Executor] Add the map logic of global input and subgraph input. #9751

Merged
merged 4 commits into from
Dec 17, 2021

Conversation

huajsj
Copy link
Contributor

@huajsj huajsj commented Dec 16, 2021

User can use "global input name" to feed input data for pipeline runtime. The name like
"data_a" will be mapped into a input interface of subgraph. In this PR, we
create the related logic to do the following things.

  1. building the input map configuration
  2. in runtime c++ module, parseing the input connection configuration then
    creating related data structure to record the said connection map.
  3. providing the function to return the map information for verification.

Thanks for contributing to TVM! Please refer to guideline https://tvm.apache.org/docs/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from Reviewers by @ them in the pull request thread.

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
python/tvm/contrib/pipeline_executor.py Outdated Show resolved Hide resolved
@huajsj huajsj requested a review from liangfu December 16, 2021 02:48
src/runtime/pipeline/pipeline_executor.h Outdated Show resolved Hide resolved
src/runtime/pipeline/pipeline_struct.h Outdated Show resolved Hide resolved
@liangfu
Copy link
Member

liangfu commented Dec 16, 2021

Thanks for the update @huajsj , I have left additional change requests, otherwise good to me.

@huajsj
Copy link
Contributor Author

huajsj commented Dec 16, 2021

Thanks @liangfu, all review comments addressed, please take a look.

@huajsj
Copy link
Contributor Author

huajsj commented Dec 16, 2021

all review comments addressed, thanks @liangfu.

…bgraph input.

User can use "global input name" to feed input data for pipeline runtime. The name like
"data_a" will be mapped into a input interface of subgraph. In this PR, we
create the related logic to do the following things.
 1. building the input map configuration
 2. in runtime c++ module, parseing the input connection configuration then
    creating related data structure to record the said connection map.
 3. providing the function to return the map information for verification.
@liangfu liangfu merged commit a374cdd into apache:main Dec 17, 2021
@liangfu
Copy link
Member

liangfu commented Dec 17, 2021

Thanks for contributing and the updates @huajsj. This is now merged.

ylc pushed a commit to ylc/tvm that referenced this pull request Jan 7, 2022
…bgraph input. (apache#9751)

* [Runtime][Pipeline Executor] Add the map logic of global input and subgraph input.
User can use "global input name" to feed input data for pipeline runtime. The name like
"data_a" will be mapped into a input interface of subgraph. In this PR, we
create the related logic to do the following things.
 1. building the input map configuration
 2. in runtime c++ module, parseing the input connection configuration then
    creating related data structure to record the said connection map.
 3. providing the function to return the map information for verification.

* address review comments.

* addres review comments.

* address review comments.
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 13, 2022
…bgraph input. (apache#9751)

* [Runtime][Pipeline Executor] Add the map logic of global input and subgraph input.
User can use "global input name" to feed input data for pipeline runtime. The name like
"data_a" will be mapped into a input interface of subgraph. In this PR, we
create the related logic to do the following things.
 1. building the input map configuration
 2. in runtime c++ module, parseing the input connection configuration then
    creating related data structure to record the said connection map.
 3. providing the function to return the map information for verification.

* address review comments.

* addres review comments.

* address review comments.
@HungYangChang
Copy link

HungYangChang commented Feb 17, 2022

Hello @huajsj

I have questions regarding how to set continuous stream inputs into the pipeline module.
In your example, there are continuous stream inputs (input1 ~ input4, ...) that are fed into the pipeline module.

image

In the test_pipeline_executor.py, I noticed there is set_input function to set input data.

pipeline_module_test.set_input("data_a", data)
pipeline_module_test.set_input("data_b", data)
input_data = pipeline_module_test.get_input("data_a")
tvm.testing.assert_allclose(data, input_data.numpy())
# Running the pipeline executor in sequential mode.
pipeline_module_test.run(True)

As far as I understand, multiple inputs are essential to utilize the advantage of pipeline executor.
However, it seems like it only feeds single input instead of multiple stream inputs.
I am wondering in your pipeline implementation, do you have any codes to support such multiple stream inputs feeding?

Thanks :)

@HungYangChang
Copy link

HungYangChang commented Feb 17, 2022

This is a follow-up question from the last question.

After re-reading your code

I notice you created data as batch data for pipeline computation and feed data into the pipeline module.
image
image

However, from my understanding, It looks like 5 multiple stream inputs are fed to the pipeline module one by one, and each of them runs in sequential mode as the below figure shown.

image

I think this implementation is different from what you claim in your example (running in pipeline format).

image

I am wondering do I misunderstand anything?
Or when pipeline_module_test.run("False"). Does it mean the pipeline executor executes these 5 multiple stream inputs one by one in pipeline format to utilize the advantage of the pipeline executor?

qsqqsqqsq-intellif pushed a commit to qsqqsqqsq-intellif/tvm that referenced this pull request Apr 29, 2022
…bgraph input. (apache#9751)

* [Runtime][Pipeline Executor] Add the map logic of global input and subgraph input.
User can use "global input name" to feed input data for pipeline runtime. The name like
"data_a" will be mapped into a input interface of subgraph. In this PR, we
create the related logic to do the following things.
 1. building the input map configuration
 2. in runtime c++ module, parseing the input connection configuration then
    creating related data structure to record the said connection map.
 3. providing the function to return the map information for verification.

* address review comments.

* addres review 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.

3 participants