huajsj commented on a change in pull request #14: URL: https://github.com/apache/tvm-rfcs/pull/14#discussion_r683086623
########## File path: rfcs/0012-pipeline-executor.md ########## @@ -0,0 +1,367 @@ +<!--- Licensed to the Apache Software Foundation (ASF) under one --> +<!--- or more contributor license agreements. See the NOTICE file --> +<!--- distributed with this work for additional information --> +<!--- regarding copyright ownership. The ASF licenses this file --> +<!--- to you under the Apache License, Version 2.0 (the --> +<!--- "License"); you may not use this file except in compliance --> +<!--- with the License. You may obtain a copy of the License at --> + +<!--- http://www.apache.org/licenses/LICENSE-2.0 --> + +<!--- Unless required by applicable law or agreed to in writing, --> +<!--- software distributed under the License is distributed on an --> +<!--- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --> +<!--- KIND, either express or implied. See the License for the --> +<!--- specific language governing permissions and limitations --> +<!--- under the License. --> +- Feature Name: (fill me in with a unique identifier, `my_awesome_feature`) +- Start Date: (fill me in with today's date, YYYY-MM-DD) +- RFC PR: [apache/tvm-rfcs#0014](https://github.com/apache/tvm-rfcs/pull/0014) +- GitHub Issue: [apache/tvm#8596](https://github.com/apache/tvm/issues/8596) + +## 1. Summary + + +This proposal introduces Pipeline Executor: A runtime executor that by scheduling +splitted subgraph of relay graph in pipeline to implement task level parallism to +reduce compute latency. + +## 2. Motivation + + + +Currently more and more edge device inference deployment cases happens on SOC device, +SOC device have heterogenous chipset like GPU, FPGA, CPU, DSP…, to reach the best +performance there is a requirement to run the ML network parallel in these heterogenous +chipset, however currently graph executor solution only doing the serialize operator +execution without papalism logic and the existing data papalism solution only support +parallel on same chipset(device), then only way to do batch processing on heterogenous +device with tvm is that treat whole ML network as schedule unit and running them on +different heterogenous device but that would cause latency issue(low speed chipset +generate big latency for single data processing) . + +Therefore, we need an runtime executor that can provide papalism scheduling function +with a smaller schedule unit like subgraph (a group of operator with dependency relation) +to be more efficient to use SOC heterogenous hardware resource and get better performance. + + +### Benefits of Pipeline Executor + +There are three benefit for Pipeline Executor + +Pipeline Executor provides: +* Compute single network on Multiple backend in parallel to improve performance. + +* With RPC help do ML network distribute computation cross multiple remote device + +* User can use Pipeline Executor to integrate pre-compute processing and pos-processing with + network compute together and compute in same executor. Review comment: let's take yolov3-tiny deploy as a example, before run yolov3-tiny tvm build library, user need to prepare the data that include #1 image format transfer(for example YUV to RGB) #2 , image reshape to match network size #3. data normalization as network required, all these I called it as pre-compute processing, after yolov3-tiny tvm build library run, user can get a [1, 3, 85, 13,13], [1, 3,85,26,26] array, user need to parse these 2 array to NMS sort to get bunding box, this I called it post-processing. Currently pre-processing and post-processing not handled/scheduled by TVM, Pipeline executor provide such scheduling solution to involve these 2 part with network compute together to provide complete solution for model deploy. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
