Browse Source

Add aicore_task_compiler.cc

pull/1978/head
zhangxiaokun 3 years ago
parent
commit
85b1a4acd2
2 changed files with 54 additions and 52 deletions
  1. +1
    -1
      ge/CMakeLists.txt
  2. +53
    -51
      ge/graph/label/while_label_maker.h

+ 1
- 1
ge/CMakeLists.txt View File

@@ -401,7 +401,7 @@ set(EXECUTOR_SRC_LIST
"hybrid/node_executor/aicore/aicore_node_executor.cc"
"hybrid/node_executor/aicore/aicore_op_task.cc"
"hybrid/node_executor/aicore/aicore_task_builder.cc"
#"hybrid/node_executor/aicore/aicore_task_compiler.cc"
"hybrid/node_executor/aicore/aicore_task_compiler.cc"
"hybrid/node_executor/aicpu/aicpu_ext_info.cc"
"hybrid/node_executor/aicpu/aicpu_node_executor.cc"
"hybrid/node_executor/compiledsubgraph/known_node_executor.cc"


+ 53
- 51
ge/graph/label/while_label_maker.h View File

@@ -19,57 +19,59 @@

#include "graph/node.h"
#include "graph/label/label_maker.h"
/*******************************************************************************
+------------+
| Node |
+------------+
| Node |
+------------+
| While |
+------------+
+-----------+
| Node | +------------+
+-----------+ | LabelSet |\
| Node | +------------+ \
+-----------+ |StreamActive| \
| Node | +------------+ A
+-----------+ | c | |
| While | +------------+ |
+-----------+ | o | |
| Node | +------------+ |
+-----------+ | n | |
| Node | +------------+ |
+-----------+ | d | |
| Node | +------------+ |
+-----------+ /|SwitchByIdx | |
/ +------------+ |
====> / |
| \ +------------+ |
| \|LabelSet(1) | |
| +------------+ |
| |StreamActive| |
| +------------+ |
+-----------+ +-----------+ | | b | |
| c | | b | | +------------+ |
+-----------+ +-----------+ | | o | |
| o | | o | | +------------+ |
+-----------+ +-----------+ | | d | |
| n | | d | | +------------+ |
+-----------+ +-----------+ | | y | /
| d | | y | V +------------+ /
+-----------+ +-----------+ \ | LabelGoto |/
\ +------------+
\|LabelSet(0) |
+------------+

+------------+
| Node |
+------------+
| Node |
+------------+
| Node |
+------------+
*******************************************************************************/
/***********************************************************************************************************************
+------------+ Step0: DavinciModel::InitNodes
| Node |
+------------+ rtLabelCreateExV2
| Node |
+------------+
| Node |
+------------+
| While |
+------------+
+-----------+ Step1: TaskInfo::Init
| Node | +------------+
+-----------+ | LabelSet(0)|\ LabelSetTaskInfo --> id=0
| Node | +------------+ \
+-----------+ |StreamActive| \ If active_stream_list empty, not task.
| Node | +------------+ A
+-----------+ | c | |
| While | +------------+ |
+-----------+ | o | |
| Node | +------------+ |
+-----------+ | n | |
| Node | +------------+ |
+-----------+ | d | |
| Node | +------------+ |
+-----------+ /|SwitchByIdx | | LabelSwitchByIndexTaskInfo --> rtLabelListCpy({1,2})
/ +------------+ |
====> / |
| \ +------------+ |
| \| LabelSet(1)| | LabelSetTaskInfo --> id=1
| +------------+ |
| |StreamActive| | If active_stream_list empty, not task.
| +------------+ |
+-----------+ +-----------+ | | b | |
| c | | b | | +------------+ |
+-----------+ +-----------+ | | o | |
| o | | o | | +------------+ |
+-----------+ +-----------+ | | d | |
| n | | d | | +------------+ |
+-----------+ +-----------+ | | y | /
| d | | y | V +------------+ /
+-----------+ +-----------+ \ | LabelGoto |/ LabelGotoExTaskInfo --> GetLabelGotoAddr(id=0)
\ +------------+
\| LabelSet(2)| LabelSetTaskInfo --> id=2
+------------+
Step2: TaskInfo::Distribute
+------------+
| Node | LabelSetTaskInfo --> rtLabelSet
+------------+ LabelSwitchByIndexTaskInfo --> rtLabelSwitchByIndex
| Node | LabelSetTaskInfo --> rtLabelSet
+------------+ LabelGotoExTaskInfo --> rtLabelSwitchByIndex
| Node | LabelSetTaskInfo --> rtLabelSet
+------------+
***********************************************************************************************************************/
namespace ge {
class WhileOpLabelMaker : public LabelMaker {
public:


Loading…
Cancel
Save