Skip to content

[WIP][Runtime]Pipeline Executor For Compute graph pipeline#7892

Closed
huajsj wants to merge 28 commits into
apache:mainfrom
huajsj:main
Closed

[WIP][Runtime]Pipeline Executor For Compute graph pipeline#7892
huajsj wants to merge 28 commits into
apache:mainfrom
huajsj:main

Conversation

@huajsj

@huajsj huajsj commented Apr 20, 2021

Copy link
Copy Markdown
Contributor

Issue:
SOC hardware plarform have multiple types compute chipset like
GPU,FPGA,APU,RPU etc, there is a requirement that use these compute
unit in parallel to reach best performance.

Solution:
In these pipeline solution, we first split the compute graph into
a group of subgraph, then run these subgraph in a pipeline module
to make the GPU/FPGA/APU/RPU parallel running become possible.

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.

@huajsj huajsj changed the title Pipeline Compute Graph With New Subgraph Executor [Runtime]Pipeline Compute Graph With New Subgraph Executor Apr 21, 2021
@tqchen

tqchen commented Apr 26, 2021

Copy link
Copy Markdown
Member

cc @comaniac @areusch @tmoreau89

@huajsj

huajsj commented Apr 26, 2021

Copy link
Copy Markdown
Contributor Author

Thanks @tqchen for the follow up, I proposed a RFC(https://discuss.tvm.apache.org/t/rfc-compute-graph-pipeline-with-new-subgraph-executor/9839) to explain the motivation and solution architecture as reference.

@huajsj huajsj changed the title [Runtime]Pipeline Compute Graph With New Subgraph Executor [WIP][Runtime]Pipeline Compute Graph With New Subgraph Executor Apr 28, 2021
@huajsj huajsj changed the title [WIP][Runtime]Pipeline Compute Graph With New Subgraph Executor [Runtime]Pipeline Executor For Compute graph pipeline May 1, 2021

@comaniac comaniac left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the test for APIs and user interfaces, but it needs lots of changes so I'll stop here for now.

Comment thread tests/python/relay/test_analysis_pipeline.py Outdated
Comment thread tests/python/relay/test_analysis_pipeline.py Outdated
Comment thread tests/python/relay/test_analysis_pipeline.py Outdated
Comment thread tests/python/relay/test_analysis_pipeline.py Outdated
Comment thread tests/python/relay/test_analysis_pipeline.py Outdated
Comment thread tests/python/relay/test_analysis_pipeline.py Outdated
Comment thread tests/python/relay/test_analysis_pipeline.py Outdated
Comment thread tests/python/relay/test_analysis_pipeline.py Outdated
Comment thread tests/python/relay/test_analysis_pipeline.py Outdated
Comment thread tests/python/relay/test_analysis_pipeline.py Outdated
@huajsj

huajsj commented Jun 1, 2021

Copy link
Copy Markdown
Contributor Author

@comaniac @areusch @tmoreau89

@comaniac comaniac left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread cmake/config.cmake Outdated
Comment thread python/tvm/contrib/pipeline_executor.py Outdated
Comment thread python/tvm/contrib/pipeline_executor.py Outdated
Comment thread python/tvm/contrib/pipeline_executor.py Outdated
Comment thread python/tvm/contrib/pipeline_executor.py Outdated
Comment thread python/tvm/contrib/pipeline_executor.py
Comment thread python/tvm/contrib/pipeline_executor.py Outdated
Comment thread python/tvm/contrib/pipeline_executor.py Outdated
params : dict of str to NDArray
Additional arguments
"""
if key is not None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why key and value are allowed to be None?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Didn't see the fix? Why we need if key is not None?

Comment thread src/runtime/pipeline/pipeline_executor.cc Outdated
Comment thread src/runtime/pipeline/pipeline_executor.cc Outdated
@huajsj huajsj force-pushed the main branch 4 times, most recently from 6061ae2 to 1c67a87 Compare June 16, 2021 21:52
@huajsj huajsj requested a review from comaniac June 16, 2021 23:01
@huajsj

huajsj commented Jun 17, 2021

Copy link
Copy Markdown
Contributor Author

@comaniac

@comaniac

Copy link
Copy Markdown
Contributor

@comaniac

I'm busy with other tasks in recent days. Will try to take another look when I got a chance.

Comment thread cmake/config.cmake
Comment thread python/tvm/contrib/graph_executor.py Outdated
Comment thread python/tvm/contrib/pipeline_executor.py
Comment thread python/tvm/contrib/pipeline_executor.py Outdated
Comment thread python/tvm/contrib/pipeline_executor.py Outdated
Comment thread src/runtime/pipeline/pipeline_executor.h Outdated
Comment thread src/runtime/pipeline/pipeline_executor.cc Outdated
Comment thread src/runtime/pipeline/pipeline_executor.cc Outdated
Comment thread src/runtime/pipeline/pipeline_executor.cc Outdated
Comment thread src/runtime/pipeline/pipeline_executor.h
@huajsj huajsj force-pushed the main branch 2 times, most recently from 2947327 to 62e4d5f Compare June 30, 2021 06:17
@huajsj huajsj requested a review from comaniac July 6, 2021 18:53
@huajsj

huajsj commented Jul 7, 2021

Copy link
Copy Markdown
Contributor Author

@comaniac

@huajsj

huajsj commented Jul 9, 2021

Copy link
Copy Markdown
Contributor Author

@comaniac, if you have time , could you help for a review. thanks.


template <typename SLOT_TYPE = SLOT>
void deleteQueue(squeue<SLOT_TYPE>* q) {
free(q);

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.

use delete

#include <assert.h>
#include <sched.h>
#include <string.h>
#include <sys/syscall.h>

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.

Only compiles on linux

@masahi

masahi commented Sep 3, 2021

Copy link
Copy Markdown
Member

Thanks @huajsj. Please respect our coding style and standard good programming practices:

  • For C++ code: Variable names should be snake_case and function / class names should be CamelCase
  • Do not use using namespace without good reason
  • Do not introduce complicated typedef like typedef unordered_map<int, unordered_map<int, unordered_map<int, string>>> PIPELINE_CONF;. Introducing a class should be more readable.
  • Do not use weird type name like RUNTIME_PIPELINE_OUTPUT_CONF.

huajsj added 6 commits October 1, 2021 18:34
[Finding]
the final output is same with constant value, seems like input data is
0, this is because the get input index have a '+1' operation, but the
input index already start from 0. the means when doing setinput('x',..) it
should get convert to setinput(0, ..), but the wrong logic is
setinput(1,..).
@comaniac

comaniac commented Nov 2, 2021

Copy link
Copy Markdown
Contributor

IIUC, this PR should be out-of-date? Should we close?

@huajsj

huajsj commented Nov 5, 2021

Copy link
Copy Markdown
Contributor Author

@comaniac , yes we should close this PR, closed it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants