From 35622302f398e09c584dfda27f23cab69d70a6cc Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9D=B4=ED=95=9C=EC=A2=85/On-Device=20Lab=28SR=29/Enginee?= =?utf8?q?r/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Thu, 7 Mar 2019 10:17:23 +0900 Subject: [PATCH] [neurun] Introduce Config `EXECUTOR` (#4616) Introduce environment variable `EXECUTOR` to specify which executor to use. Now we can run with Dataflow Executor with these variables. ```bash export CPU_MEMORY_PLANNER=Bump export EXECUTOR=Dataflow ``` Signed-off-by: Hanjoung Lee --- runtimes/neurun/src/compiler/Compiler.cc | 5 ++++- runtimes/neurun/src/util/config/Config.lst | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/runtimes/neurun/src/compiler/Compiler.cc b/runtimes/neurun/src/compiler/Compiler.cc index 6b49159..f469d93 100644 --- a/runtimes/neurun/src/compiler/Compiler.cc +++ b/runtimes/neurun/src/compiler/Compiler.cc @@ -28,6 +28,7 @@ #include "exec/Executor.h" #include "exec/DataflowExecutor.h" #include "exec/interp/Interpreter.h" +#include "util/config/ConfigManager.h" namespace neurun { @@ -67,7 +68,9 @@ void Compiler::compile(void) dot_dumper.dumpIfNeeded("after_lower"); - const bool use_dataflow_executor = false; // TODO Read value from ConfigManager + const std::string executor_str = + config::ConfigManager::instance().get(config::EXECUTOR); + const bool use_dataflow_executor = (executor_str == "Dataflow"); // Compile for DataflowExecutor if (use_dataflow_executor) diff --git a/runtimes/neurun/src/util/config/Config.lst b/runtimes/neurun/src/util/config/Config.lst index ca22f6c..ce995c5 100644 --- a/runtimes/neurun/src/util/config/Config.lst +++ b/runtimes/neurun/src/util/config/Config.lst @@ -25,6 +25,7 @@ CONFIG(OP_BACKEND_ALLOPS , std::string , "none") CONFIG(DISABLE_COMPILE , bool , "0") CONFIG(NEURUN_LOG_ENABLE , bool , "0") CONFIG(CPU_MEMORY_PLANNER , std::string , "FirstFit") +CONFIG(EXECUTOR , std::string , "Linear") // Auto-generate all operations -- 2.7.4