From 6c876edf698812525878dcc37fc9cad5161aa91c Mon Sep 17 00:00:00 2001 From: ling Date: Thu, 22 Apr 2021 14:25:39 +0800 Subject: [PATCH] disable subgraph split --- mindspore/lite/CMakeLists.txt | 2 +- mindspore/lite/src/sub_graph_split.cc | 15 ++++++++++----- mindspore/lite/src/sub_graph_split.h | 1 + 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/mindspore/lite/CMakeLists.txt b/mindspore/lite/CMakeLists.txt index 9ce4ddb182b..cd01134346c 100644 --- a/mindspore/lite/CMakeLists.txt +++ b/mindspore/lite/CMakeLists.txt @@ -35,7 +35,7 @@ option(ENABLE_VERBOSE "" off) option(ENABLE_SSE "if x86_64 support SSE instruction set" off) option(ENABLE_AVX "if x86_64 support SSE instruction set" off) option(ENABLE_MINDRT "if support mindrt" on) -option(SUBGRAPH_SPLIT "if support sub graph split" on) +option(SUBGRAPH_SPLIT "if support sub graph split" off) set(DIR_PREFIX mindspore-lite) set(MS_VERSION ${MS_VERSION_MAJOR}.${MS_VERSION_MINOR}.${MS_VERSION_REVISION}) diff --git a/mindspore/lite/src/sub_graph_split.cc b/mindspore/lite/src/sub_graph_split.cc index ee2fb84d95f..237c3e80513 100644 --- a/mindspore/lite/src/sub_graph_split.cc +++ b/mindspore/lite/src/sub_graph_split.cc @@ -268,13 +268,18 @@ void SearchSubGraph::SubgraphFusion() { return; } +bool SearchSubGraph::ModelValid() { + if (context_->IsNpuEnabled()) { + return false; + } + if (context_->IsGpuEnabled()) { + return false; + } + return false; +} void SearchSubGraph::SubGraphSplitByOutput() { - if (!context_->IsGpuEnabled() || output_nodes_.size() > 4) { - return; - } - - if (context_->IsCpuFloat16Enabled() || context_->IsGpuFloat16Enabled()) { + if (!ModelValid()) { return; } diff --git a/mindspore/lite/src/sub_graph_split.h b/mindspore/lite/src/sub_graph_split.h index 2202293d630..5d9697caf22 100644 --- a/mindspore/lite/src/sub_graph_split.h +++ b/mindspore/lite/src/sub_graph_split.h @@ -63,6 +63,7 @@ class SearchSubGraph { void InitSubgraphDevice(); void SubgraphFusion(); void InitMainGraphDevice(); + bool ModelValid(); private: const InnerContext *context_ = nullptr;