From 4b06963e1f3409406b2852070f69b6d7b9d15ea3 Mon Sep 17 00:00:00 2001 From: yefeng Date: Wed, 2 Mar 2022 09:43:18 +0800 Subject: [PATCH] parall predict remove param --- include/api/model_parallel_runner.h | 5 +---- .../lite/src/cxx_api/model_pool/model_parallel_runner.cc | 5 ++--- mindspore/lite/src/cxx_api/model_pool/model_pool.cc | 5 ++--- mindspore/lite/src/cxx_api/model_pool/model_pool.h | 3 +-- mindspore/lite/src/cxx_api/model_pool/model_worker.cc | 4 ++-- mindspore/lite/src/cxx_api/model_pool/model_worker.h | 3 +-- 6 files changed, 9 insertions(+), 16 deletions(-) diff --git a/include/api/model_parallel_runner.h b/include/api/model_parallel_runner.h index 386b342200c..4f34bc2b528 100644 --- a/include/api/model_parallel_runner.h +++ b/include/api/model_parallel_runner.h @@ -38,12 +38,9 @@ class MS_API ModelParallelRunner { /// /// \param[in] model_path Define the model path. /// \param[in] runner_config Define the config used to store options during model pool init. - /// \param[in] dec_key Define the key used to decrypt the ciphertext model. The key length is 16, 24, or 32. - /// \param[in] dec_mode Define the decryption mode. Options: AES-GCM, AES-CBC. /// /// \return Status. - Status Init(const std::string &model_path, const std::shared_ptr &runner_config = nullptr, - const Key &dec_key = {}, const std::string &dec_mode = kDecModeAesGcm); + Status Init(const std::string &model_path, const std::shared_ptr &runner_config = nullptr); /// \brief Obtains all input tensors information of the model. /// diff --git a/mindspore/lite/src/cxx_api/model_pool/model_parallel_runner.cc b/mindspore/lite/src/cxx_api/model_pool/model_parallel_runner.cc index 5cf3a7c871e..af8c2f9c838 100644 --- a/mindspore/lite/src/cxx_api/model_pool/model_parallel_runner.cc +++ b/mindspore/lite/src/cxx_api/model_pool/model_parallel_runner.cc @@ -18,9 +18,8 @@ #include "src/common/log.h" namespace mindspore { -Status ModelParallelRunner::Init(const std::string &model_path, const std::shared_ptr &runner_config, - const Key &dec_key, const std::string &dec_mode) { - auto status = ModelPool::GetInstance()->Init(model_path, runner_config, dec_key, dec_mode); +Status ModelParallelRunner::Init(const std::string &model_path, const std::shared_ptr &runner_config) { + auto status = ModelPool::GetInstance()->Init(model_path, runner_config); if (status != kSuccess) { MS_LOG(ERROR) << "model runner init failed."; return kLiteError; diff --git a/mindspore/lite/src/cxx_api/model_pool/model_pool.cc b/mindspore/lite/src/cxx_api/model_pool/model_pool.cc index d5d7cd11b17..0b8eb95da28 100644 --- a/mindspore/lite/src/cxx_api/model_pool/model_pool.cc +++ b/mindspore/lite/src/cxx_api/model_pool/model_pool.cc @@ -271,8 +271,7 @@ std::vector ModelPool::GetOutputs() { return model_outputs_; } -Status ModelPool::Init(const std::string &model_path, const std::shared_ptr &runner_config, - const Key &dec_key, const std::string &dec_mode) { +Status ModelPool::Init(const std::string &model_path, const std::shared_ptr &runner_config) { auto model_pool_context = CreateModelContext(runner_config); if (model_pool_context.empty()) { MS_LOG(ERROR) << "CreateModelContext failed, context is empty."; @@ -309,7 +308,7 @@ Status ModelPool::Init(const std::string &model_path, const std::shared_ptr(); - auto status = model_thread->Init(graph_buf_, size, model_pool_context[i], dec_key, dec_mode, numa_node_id); + auto status = model_thread->Init(graph_buf_, size, model_pool_context[i], numa_node_id); if (status != kSuccess) { MS_LOG(ERROR) << " model thread init failed."; return kLiteError; diff --git a/mindspore/lite/src/cxx_api/model_pool/model_pool.h b/mindspore/lite/src/cxx_api/model_pool/model_pool.h index 83d540d9ca2..76cba743629 100644 --- a/mindspore/lite/src/cxx_api/model_pool/model_pool.h +++ b/mindspore/lite/src/cxx_api/model_pool/model_pool.h @@ -34,8 +34,7 @@ class ModelPool { static ModelPool *GetInstance(); ~ModelPool(); - Status Init(const std::string &model_path, const std::shared_ptr &runner_config = nullptr, - const Key &dec_key = {}, const std::string &dec_mode = kDecModeAesGcm); + Status Init(const std::string &model_path, const std::shared_ptr &runner_config = nullptr); std::vector GetInputs(); diff --git a/mindspore/lite/src/cxx_api/model_pool/model_worker.cc b/mindspore/lite/src/cxx_api/model_pool/model_worker.cc index 77cf29f6cb7..cc5bdb43d27 100644 --- a/mindspore/lite/src/cxx_api/model_pool/model_worker.cc +++ b/mindspore/lite/src/cxx_api/model_pool/model_worker.cc @@ -60,13 +60,13 @@ void ModelThread::Run(int node_id) { } Status ModelThread::Init(const char *model_buf, size_t size, const std::shared_ptr &model_context, - const Key &dec_key, const std::string &dec_mode, int node_id) { + int node_id) { model_ = std::make_shared(); mindspore::ModelType model_type = kMindIR; if (node_id != -1) { model_->UpdateConfig(lite::kConfigServerInference, {lite::kConfigNUMANodeId, std::to_string(node_id)}); } - auto status = model_->Build(model_buf, size, model_type, model_context, dec_key, dec_mode); + auto status = model_->Build(model_buf, size, model_type, model_context); if (status != kSuccess) { MS_LOG(ERROR) << "model build failed in ModelPool Init"; return status; diff --git a/mindspore/lite/src/cxx_api/model_pool/model_worker.h b/mindspore/lite/src/cxx_api/model_pool/model_worker.h index 302f6801ffe..8618fab2c49 100644 --- a/mindspore/lite/src/cxx_api/model_pool/model_worker.h +++ b/mindspore/lite/src/cxx_api/model_pool/model_worker.h @@ -33,8 +33,7 @@ class ModelThread { ~ModelThread() = default; // the model pool is initialized once and can always accept model run requests - Status Init(const char *model_buf, size_t size, const std::shared_ptr &model_context, - const Key &dec_key = {}, const std::string &dec_mode = kDecModeAesGcm, int node_id = -1); + Status Init(const char *model_buf, size_t size, const std::shared_ptr &model_context, int node_id = -1); std::vector GetInputs();