From 1c550e0a9052dc4a8336508ccfbb855fd6872e06 Mon Sep 17 00:00:00 2001 From: yangyongqiang Date: Tue, 15 Nov 2022 16:08:34 +0000 Subject: [PATCH 1/2] !732 om md5 consistent Merge pull request !732 from yangyongqiang/om_md5_same --- parser/common/thread_pool.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/parser/common/thread_pool.cc b/parser/common/thread_pool.cc index 6f0591f..876d9ff 100644 --- a/parser/common/thread_pool.cc +++ b/parser/common/thread_pool.cc @@ -21,10 +21,22 @@ #include #include "register/register_types.h" +#include "graph/ge_context.h" +#include "mmpa/mmpa_api.h" namespace ge { +namespace { +const char* const kMultiThreadCompile = "MULTI_THREAD_COMPILE"; +const char* const kDisEnableFlag = "0"; +bool IsSingleThreadCompile() { + std::string compile_thread; + return ((ge::GetContext().GetOption(kMultiThreadCompile, compile_thread) == GRAPH_SUCCESS) + && (compile_thread.compare(kDisEnableFlag) == 0)); +} +} + FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ThreadPool::ThreadPool(uint32_t size) : is_stoped_(false) { - idle_thrd_num_ = size < 1 ? 1 : size; + idle_thrd_num_ = ((size < 1U) || IsSingleThreadCompile()) ? 1U : size; for (uint32_t i = 0; i < idle_thrd_num_; ++i) { pool_.emplace_back(ThreadFunc, this); From 7840e56e9f254028d12bb75fb05c182c72922f59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=B6=9B?= Date: Wed, 16 Nov 2022 12:25:51 +0000 Subject: [PATCH 2/2] =?UTF-8?q?!736=20update=20submodule=20Merge=20pull=20?= =?UTF-8?q?request=20!736=20from=20=E7=8E=8B=E6=B6=9B/updatesubmodule?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- metadef | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadef b/metadef index 0dfbec2..c796c53 160000 --- a/metadef +++ b/metadef @@ -1 +1 @@ -Subproject commit 0dfbec2ebe779ef1206f40cb65a182c22c3613cd +Subproject commit c796c53d1971952beb1941fb3699dacc907d9625