Browse Source

Add aicore_task_compiler.cc

pull/1978/head
zhangxiaokun 4 years ago
parent
commit
f4c96651e0
2 changed files with 53 additions and 55 deletions
  1. +2
    -2
      ge/CMakeLists.txt
  2. +51
    -53
      ge/graph/label/while_label_maker.h

+ 2
- 2
ge/CMakeLists.txt View File

@@ -141,7 +141,7 @@ set(EXECUTOR_SRC_LIST
"common/profiling/ge_profiling.cc" "common/profiling/ge_profiling.cc"
#"common/profiling/ge_runner_profiling.cc" #"common/profiling/ge_runner_profiling.cc"
"common/profiling/profiling_manager.cc" "common/profiling/profiling_manager.cc"
#"engine_manager/dnnengine_manager.cc"
"engine_manager/dnnengine_manager.cc"
"executor/ge_executor.cc" "executor/ge_executor.cc"
"ge_local_engine/engine/host_cpu_engine.cc" "ge_local_engine/engine/host_cpu_engine.cc"
#"ge_opt_info/ge_opt_info.cc" #"ge_opt_info/ge_opt_info.cc"
@@ -415,7 +415,7 @@ set(EXECUTOR_SRC_LIST
"hybrid/node_executor/rts/rts_node_task.cc" "hybrid/node_executor/rts/rts_node_task.cc"
"hybrid/node_executor/rts/rts_task_factory.cc" "hybrid/node_executor/rts/rts_task_factory.cc"
"hybrid/node_executor/task_context.cc" "hybrid/node_executor/task_context.cc"
#"init/gelib.cc"
"init/gelib.cc"
#"ir_build/attr_options/keep_dtype_option.cc" #"ir_build/attr_options/keep_dtype_option.cc"
#"ir_build/attr_options/utils.cc" #"ir_build/attr_options/utils.cc"
#"ir_build/attr_options/weight_compress_option.cc" #"ir_build/attr_options/weight_compress_option.cc"


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

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


#include "graph/node.h" #include "graph/node.h"
#include "graph/label/label_maker.h" #include "graph/label/label_maker.h"
/***********************************************************************************************************************
+------------+ 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
+------------+
***********************************************************************************************************************/
/*******************************************************************************
+------------+
| 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 |
+------------+
*******************************************************************************/
namespace ge { namespace ge {
class WhileOpLabelMaker : public LabelMaker { class WhileOpLabelMaker : public LabelMaker {
public: public:


Loading…
Cancel
Save