已合并
refactor: 清理 dflow 中未使用的 include、using 别名、废弃函数和结构体 #3846
lining23666创建于 7月3日
refactor: 清理 dflow 中未使用的 include、using 别名、废弃函数和结构体 #3846
已合并
lining23666创建于 7月3日
39 个文件变更+11-202
Mdflow/base/deploy/deploy_planner.cc+0-5
@@ -51,7 +51,6 @@ bool IsNeedDeviceQueue(const DeployPlan::SubmodelInfo &submodel_info) {
51 51 
52std::atomic<int64_t> DeployPlannerBase::endpoint_name_id_gen_{};52std::atomic<int64_t> DeployPlannerBase::endpoint_name_id_gen_{};
53std::atomic<int64_t> DeployPlannerBase::plan_id_gen_{};53std::atomic<int64_t> DeployPlannerBase::plan_id_gen_{};
54-using DynamicSchedInfo = std::map<std::string, DeployPlan::SubmodelInfo>;
55 54 
56const std::vector<DeployPlan::QueueInfo> &DeployPlan::GetQueueInfoList() const {55const std::vector<DeployPlan::QueueInfo> &DeployPlan::GetQueueInfoList() const {
57 return queues_;56 return queues_;
@@ -1594,10 +1593,6 @@ DeployPlan::SubmodelInfo &DeployPlannerBase::MutableSubmodelInfo(const std::stri
1594 }1593 }
1595}1594}
1596 1595 
1597-bool DeployPlannerBase::IsHeadOrTail(const std::string &name) const {
1598- return (name == head_model_queue_info_.model_name) || (name == tail_model_queue_info_.model_name);
1599-}
1600- 
1601const std::string &DeployPlannerBase::GetSubmodelType(const std::string &name) {1596const std::string &DeployPlannerBase::GetSubmodelType(const std::string &name) {
1602 if (name == head_model_queue_info_.model_name || name == tail_model_queue_info_.model_name) {1597 if (name == head_model_queue_info_.model_name || name == tail_model_queue_info_.model_name) {
1603 return PNE_ID_CPU;1598 return PNE_ID_CPU;
Mdflow/base/deploy/deploy_planner.h+0-1
@@ -266,7 +266,6 @@ class DeployPlannerBase {
266 DeployPlan::SubmodelInfo &MutableSubmodelInfo(const std::string &name);266 DeployPlan::SubmodelInfo &MutableSubmodelInfo(const std::string &name);
267 static Status ValidateModelAndRelation(const std::map<std::string, PneModelPtr> &models,267 static Status ValidateModelAndRelation(const std::map<std::string, PneModelPtr> &models,
268 const ModelRelation &model_relation);268 const ModelRelation &model_relation);
269- bool IsHeadOrTail(const std::string &name) const;
270 Status CreateEndpointInfo(const DeployPlan::QueueInfo &queue_info);269 Status CreateEndpointInfo(const DeployPlan::QueueInfo &queue_info);
271 Status CreateEndpointInfo(const DeployPlan::QueueInfo &queue_info, int32_t &queue_idx);270 Status CreateEndpointInfo(const DeployPlan::QueueInfo &queue_info, int32_t &queue_idx);
272 Status CreateGroupEntry(const DeployPlan::QueueInfo &queue_info, int32_t &entry_index);271 Status CreateGroupEntry(const DeployPlan::QueueInfo &queue_info, int32_t &entry_index);
Mdflow/base/model/flow_model_om_loader.cc+0-12
@@ -225,18 +225,6 @@ Status LoadSerializedModel(flow_model::proto::SubmodelDef &flow_submodel_def, co
225}225}
226} // namespace226} // namespace
227 227 
228-Status FlowModelOmLoader::LoadToFlowModelDesc(const ge::ModelData &model_data, const FlowModelPtr &flow_model) {
229- OmFileLoadHelper om_file_load_helper;
230- GE_CHK_STATUS_RET(om_file_load_helper.Init(model_data), "Om file load helper init failed.");
231- const auto &model_partitions = om_file_load_helper.GetModelPartitions(0);
232- GE_CHK_STATUS_RET(CheckModelPartitions(model_partitions), "Check model partitions failed.");
233- std::vector<string> submodel_names;
234- GE_CHK_STATUS_RET(
235- LoadFlowModelPartition(model_partitions[kFlowModelPartitionsFlowModelIdx], flow_model, submodel_names),
236- "Load flow model partition failed.");
237- return SUCCESS;
238-}
239- 
240bool FlowModelOmLoader::CheckFilePathValid(const std::string &base_dir, const std::string &check_dir) {228bool FlowModelOmLoader::CheckFilePathValid(const std::string &base_dir, const std::string &check_dir) {
241 const auto real_check_dir = RealPath(check_dir.c_str());229 const auto real_check_dir = RealPath(check_dir.c_str());
242 return real_check_dir.find(base_dir) == 0UL;230 return real_check_dir.find(base_dir) == 0UL;
Mdflow/base/model/flow_model_om_loader.h+0-1
@@ -21,7 +21,6 @@ class FlowModelOmLoader {
21 static Status TransModelDataToComputeGraph(const ge::ModelData &model_data, ge::ComputeGraphPtr &root_graph);21 static Status TransModelDataToComputeGraph(const ge::ModelData &model_data, ge::ComputeGraphPtr &root_graph);
22 static Status LoadToFlowModel(const ge::ModelData &model_data, FlowModelPtr &flow_model,22 static Status LoadToFlowModel(const ge::ModelData &model_data, FlowModelPtr &flow_model,
23 const std::string &split_om_data_path = "");23 const std::string &split_om_data_path = "");
24- static Status LoadToFlowModelDesc(const ge::ModelData &model_data, const FlowModelPtr &flow_model);
25 static Status RefreshModel(const FlowModelPtr &flow_model, const std::string &model_path, const uint64_t session_id,24 static Status RefreshModel(const FlowModelPtr &flow_model, const std::string &model_path, const uint64_t session_id,
26 const uint32_t graph_id);25 const uint32_t graph_id);
27 static bool CheckFilePathValid(const std::string &base_dir, const std::string &check_dir);26 static bool CheckFilePathValid(const std::string &base_dir, const std::string &check_dir);
Mdflow/base/model/flow_model_om_saver.cc+0-11
@@ -178,17 +178,6 @@ Status FlowModelOmSaver::SaveToOm(const std::string &output_file, const std::str
178 return SUCCESS;178 return SUCCESS;
179}179}
180 180 
181-Status FlowModelOmSaver::SaveToModelData(ModelBufferData &model_buff) {
182- GE_ASSERT_SUCCESS(AddModelDefPartition(), "[Add][ModelPartition] failed.");
183- GE_ASSERT_SUCCESS(AddFlowModelPartition(), "[Add][FlowModelPartition] failed.");
184- GE_ASSERT_SUCCESS(AddFlowSubModelPartitions(), "[Add][FlowSubModelPartition] failed.");
185- GE_ASSERT_SUCCESS(UpdateModelHeader(), "[Update][Header] failed.");
186- GE_ASSERT_SUCCESS(SaveFlowModelToDataBuffer(model_buff), "[Save][FlowModelToBuffer] failed.");
187- buffers_.clear();
188- GELOGI("save to model data buffer success.");
189- return SUCCESS;
190-}
191- 
192Status FlowModelOmSaver::AddModelDefPartition() {181Status FlowModelOmSaver::AddModelDefPartition() {
193 const auto &root_graph = flow_model_->GetRootGraph();182 const auto &root_graph = flow_model_->GetRootGraph();
194 GE_CHECK_NOTNULL(root_graph);183 GE_CHECK_NOTNULL(root_graph);
Mdflow/base/model/flow_model_om_saver.h+0-1
@@ -24,7 +24,6 @@ class FlowModelOmSaver {
24 ~FlowModelOmSaver() = default;24 ~FlowModelOmSaver() = default;
25 // split om data dir is not empty in cache function. split_om_data_base_dir = ./cache_dir/graph_key25 // split om data dir is not empty in cache function. split_om_data_base_dir = ./cache_dir/graph_key
26 Status SaveToOm(const std::string &output_file, const std::string &split_om_data_base_dir = "");26 Status SaveToOm(const std::string &output_file, const std::string &split_om_data_base_dir = "");
27- Status SaveToModelData(ModelBufferData &model_buff);
28 27 
29 private:28 private:
30 Status AddModelDefPartition();29 Status AddModelDefPartition();
Mdflow/base/model/model_relation.cc+0-9
@@ -367,15 +367,6 @@ const Endpoint *ModelRelationReader::GetEndpoint(const std::string &queue_name)
367 return it->second;367 return it->second;
368}368}
369 369 
370-void ModelRelationReader::LogDebugString(const ModelRelation &model_relation) {
371- GELOGD("endpoints.size: %zu.", model_relation.endpoints.size());
372- GELOGD("root_model_endpoint_info.model_name: %s.", model_relation.root_model_endpoint_info.model_name.c_str());
373- GELOGD("root_model_endpoint_info.input_endpoint_names.size: %zu.",
374- model_relation.root_model_endpoint_info.input_endpoint_names.size());
375- GELOGD("root_model_endpoint_info.output_endpoint_names.size: %zu.",
376- model_relation.root_model_endpoint_info.output_endpoint_names.size());
377-}
378- 
379Status ModelRelationReader::Initialize() {370Status ModelRelationReader::Initialize() {
380 for (const auto &endpoint : model_relation_.endpoints) {371 for (const auto &endpoint : model_relation_.endpoints) {
381 (void)endpoints_.emplace(endpoint.GetName(), &endpoint);372 (void)endpoints_.emplace(endpoint.GetName(), &endpoint);
Mdflow/base/model/model_relation.h+0-1
@@ -107,7 +107,6 @@ class ModelRelationReader {
107 const Endpoint *GetEndpoint(const std::string &queue_name) const;107 const Endpoint *GetEndpoint(const std::string &queue_name) const;
108 108 
109 const ModelRelation::ModelEndpointInfo *GetSubmodelQueueInfo(const std::string &model_name) const;109 const ModelRelation::ModelEndpointInfo *GetSubmodelQueueInfo(const std::string &model_name) const;
110- static void LogDebugString(const ModelRelation &model_relation);
111 110 
112 private:111 private:
113 const ModelRelation &model_relation_;112 const ModelRelation &model_relation_;
Mdflow/compiler/data_flow_graph/compile_config_json.cc+0-2
@@ -11,9 +11,7 @@
11#include "dflow/compiler/data_flow_graph/compile_config_json.h"11#include "dflow/compiler/data_flow_graph/compile_config_json.h"
12#include <fstream>12#include <fstream>
13#include "graph/utils/type_utils.h"13#include "graph/utils/type_utils.h"
14-#include "mmpa/mmpa_api.h"
15#include "graph/ge_global_options.h"14#include "graph/ge_global_options.h"
16-#include "graph/ge_context.h"
17#include "framework/common/ge_types.h"15#include "framework/common/ge_types.h"
18 16 
19namespace {17namespace {
Mdflow/compiler/data_flow_graph/data_flow_graph_auto_deployer.cc+0-2
@@ -15,10 +15,8 @@
15#include "common/checker.h"15#include "common/checker.h"
16#include "common/string_util.h"16#include "common/string_util.h"
17#include "graph/debug/ge_attr_define.h"17#include "graph/debug/ge_attr_define.h"
18-#include "graph/ge_context.h"
19#include "dflow/flow_graph/data_flow_attr_define.h"18#include "dflow/flow_graph/data_flow_attr_define.h"
20#include "mmpa/mmpa_api.h"19#include "mmpa/mmpa_api.h"
21-#include "graph/ge_local_context.h"
22 20 
23namespace ge {21namespace ge {
24namespace {22namespace {
Mdflow/compiler/data_flow_graph/data_flow_graph_auto_deployer.h+0-1
@@ -15,7 +15,6 @@
15#include "dflow/compiler/data_flow_graph/compile_config_json.h"15#include "dflow/compiler/data_flow_graph/compile_config_json.h"
16 16 
17namespace ge {17namespace ge {
18-using AutoDeployFunc = Status (*)(const std::map<std::string, std::string> &, const ComputeGraphPtr &);
19 18 
20class DataFlowGraphAutoDeployer {19class DataFlowGraphAutoDeployer {
21 public:20 public:
Mdflow/compiler/model/flow_model_builder.cc+0-1
@@ -15,7 +15,6 @@
15#include "ge/ge_api_types.h"15#include "ge/ge_api_types.h"
16#include "graph/ge_context.h"16#include "graph/ge_context.h"
17#include "graph/ge_local_context.h"17#include "graph/ge_local_context.h"
18-#include "graph/manager/util/graph_rebuild_state_ctrl.h"
19#include "dflow/compiler/pne/process_node_engine_manager.h"18#include "dflow/compiler/pne/process_node_engine_manager.h"
20#include "dflow/compiler/pne/npu/npu_process_node_engine.h"19#include "dflow/compiler/pne/npu/npu_process_node_engine.h"
21#include "dflow/inc/data_flow/model/flow_model_helper.h"20#include "dflow/inc/data_flow/model/flow_model_helper.h"
Mdflow/compiler/pne/process_node_engine_manager.cc+0-10
@@ -110,16 +110,6 @@ ProcessNodeEnginePtr ProcessNodeEngineManager::GetEngine(const std::string &engi
110 return nullptr;110 return nullptr;
111}111}
112 112 
113-bool ProcessNodeEngineManager::IsEngineRegistered(const std::string &engine_id) const {
114- const std::lock_guard<std::mutex> lock(mutex_);
115- const auto iter = engines_map_.find(engine_id);
116- if (iter != engines_map_.end()) {
117- return true;
118- }
119- GELOGW("ProcessNodeEngine id:%s is not registered", engine_id.c_str());
120- return false;
121-}
122- 
123Status ProcessNodeEngineManager::RegisterEngine(const std::string &engine_id, const ProcessNodeEnginePtr &engine,113Status ProcessNodeEngineManager::RegisterEngine(const std::string &engine_id, const ProcessNodeEnginePtr &engine,
124 CreateFn const fn) {114 CreateFn const fn) {
125 const std::lock_guard<std::mutex> lock(mutex_);115 const std::lock_guard<std::mutex> lock(mutex_);
Mdflow/compiler/pne/process_node_engine_manager.h+0-1
@@ -38,7 +38,6 @@ class ProcessNodeEngineManager {
38 inline const std::map<std::string, ProcessNodeEnginePtr> &GetEngines() const {38 inline const std::map<std::string, ProcessNodeEnginePtr> &GetEngines() const {
39 return engines_map_;39 return engines_map_;
40 }40 }
41- bool IsEngineRegistered(const std::string &engine_id) const;
42 41 
43 private:42 private:
44 ProcessNodeEngineManager() = default;43 ProcessNodeEngineManager() = default;
Mdflow/compiler/pne/udf/udf_model_builder.cc+0-13
@@ -200,19 +200,6 @@ Status UdfModelBuilder::BuildUdfDef(const OpDescPtr &op_desc, udf::UdfDef &udf_d
200 return SUCCESS;200 return SUCCESS;
201}201}
202 202 
203-Status UdfModelBuilder::SetBin(const OpDescPtr &op_desc, udf::UdfDef &udf_def) const {
204- std::string bin_path;
205- GE_CHK_BOOL_RET_STATUS(AttrUtils::GetStr(op_desc, kUdfAttrNameBinPath, bin_path), FAILED,
206- "Failed to get %s attr from op[%s].", kUdfAttrNameBinPath.c_str(), op_desc->GetName().c_str());
207- char_t *bin_buff = nullptr;
208- int32_t length = 0;
209- GE_CHK_BOOL_RET_STATUS(ReadBytesFromBinaryFile(bin_path.c_str(), &bin_buff, length), FAILED,
210- "Failed to read bin from %s.", bin_path.c_str());
211- udf_def.set_bin(bin_buff, length);
212- delete[] bin_buff;
213- return SUCCESS;
214-}
215- 
216Status UdfModelBuilder::SetBinName(const OpDescPtr &op_desc, udf::UdfDef &udf_def) const {203Status UdfModelBuilder::SetBinName(const OpDescPtr &op_desc, udf::UdfDef &udf_def) const {
217 std::string bin_path;204 std::string bin_path;
218 GE_CHK_BOOL_RET_STATUS(AttrUtils::GetStr(op_desc, kUdfAttrNameBinPath, bin_path), FAILED,205 GE_CHK_BOOL_RET_STATUS(AttrUtils::GetStr(op_desc, kUdfAttrNameBinPath, bin_path), FAILED,
Mdflow/compiler/pne/udf/udf_model_builder.h+0-2
@@ -36,8 +36,6 @@ class UdfModelBuilder {
36 36 
37 Status BuildUdfDef(const OpDescPtr &op_desc, udf::UdfDef &udf_def) const;37 Status BuildUdfDef(const OpDescPtr &op_desc, udf::UdfDef &udf_def) const;
38 38 
39- Status SetBin(const OpDescPtr &op_desc, udf::UdfDef &udf_def) const;
40- 
41 Status SetBinName(const OpDescPtr &op_desc, udf::UdfDef &udf_def) const;39 Status SetBinName(const OpDescPtr &op_desc, udf::UdfDef &udf_def) const;
42 40 
43 Status SetFuncNameAndInputOutputMaps(const OpDescPtr &op_desc, udf::UdfDef &udf_def) const;41 Status SetFuncNameAndInputOutputMaps(const OpDescPtr &op_desc, udf::UdfDef &udf_def) const;
Mdflow/deployer/common/config/configurations.cc+0-22
@@ -36,28 +36,6 @@ void Configurations::Finalize() {
36 GELOGI("Finalize success, remote node size = %zu", information_.remote_node_config_list.size());36 GELOGI("Finalize success, remote node size = %zu", information_.remote_node_config_list.size());
37}37}
38 38 
39-Status Configurations::GetConfigDir(std::string &config_dir) {
40- const char_t *file_path = nullptr;
41- MM_SYS_GET_ENV(MM_ENV_HELPER_RES_FILE_PATH, file_path);
42- if (file_path != nullptr) {
43- const std::string real_path = RealPath(file_path);
44- if (real_path.empty()) {
45- GELOGE(ACL_ERROR_GE_PARAM_INVALID, "The path[%s] of env[%s] is invalid", file_path, kHelperResFilePath);
46- return ACL_ERROR_GE_PARAM_INVALID;
47- }
48- if (ProcessUtils::IsValidPath(real_path) != SUCCESS) {
49- GELOGE(ACL_ERROR_GE_PARAM_INVALID, "env %s config value[%s] real path[%s] is invalid", kHelperResFilePath,
50- file_path, real_path.c_str());
51- return ACL_ERROR_GE_PARAM_INVALID;
52- }
53- config_dir = real_path;
54- GEEVENT("Get config dir[%s] success from env[%s]", config_dir.c_str(), kHelperResFilePath);
55- return SUCCESS;
56- }
57- GELOGE(ACL_ERROR_GE_PARAM_INVALID, "Env HELPER_RES_FILE_PATH doesn't exist.");
58- return ACL_ERROR_GE_PARAM_INVALID;
59-}
60- 
61Status Configurations::GetWorkingDir(std::string &working_dir) const {39Status Configurations::GetWorkingDir(std::string &working_dir) const {
62 if (!information_.node_config.deploy_res_path.empty()) {40 if (!information_.node_config.deploy_res_path.empty()) {
63 working_dir = information_.node_config.deploy_res_path;41 working_dir = information_.node_config.deploy_res_path;
Mdflow/deployer/common/config/configurations.h+0-2
@@ -95,8 +95,6 @@ class Configurations {
95 95 
96 static Status GetResourceConfigPath(std::string &config_dir);96 static Status GetResourceConfigPath(std::string &config_dir);
97 97 
98- static Status GetConfigDir(std::string &config_dir);
99- 
100 static std::vector<std::string> GetHeterogeneousEnvs();98 static std::vector<std::string> GetHeterogeneousEnvs();
101 99 
102 private:100 private:
Mdflow/deployer/deploy/deployer/master_model_deployer.h+0-1
@@ -42,7 +42,6 @@ class MasterModelDeployer : public ModelDeployer {
42 Status GetValidLogicDeviceId(std::string &device_id) override;42 Status GetValidLogicDeviceId(std::string &device_id) override;
43 43 
44 private:44 private:
45- using ConstSubmodelInfoPtr = const DeployPlan::SubmodelInfo *;
46 struct DeployedModel {45 struct DeployedModel {
atomgit-bot
atomgit-botatomgit-bot7月3日
已过期

🟡 Medium Priority

变更在 master_model_deployer.h 中删除了 private using ConstSubmodelInfoPtr = const DeployPlan::SubmodelInfo *;,但测试文件 tests/dflow/runner/ut/ge/runtime/heterogeneous/deploy/deployer/master_model_deployer_unittest.cc:142 仍然引用该别名:

MOCK_METHOD3(DeployRemoteVarManager, Status(const DeployPlan &, const std::map<int32_t, std::vector> &, MasterModelDeployer::DeployedModel &));

该测试文件在 CMakeLists.txt 中被列为构建目标(tests/dflow/runner/ut/ge/CMakeLists.txt:74),删除别名后测试文件将编译失败。

建议:要么将 ConstSubmodelInfoPtr 保留并移为 public/protected,要么同步修改测试文件 master_model_deployer_unittest.cc:142 将 ConstSubmodelInfoPtr 替换为 const DeployPlan::SubmodelInfo *。

likedislike
lining23666
7月3日 评论:
47 uint32_t model_id = UINT32_MAX;46 uint32_t model_id = UINT32_MAX;
48 // key: device_id, value: model_name47 // key: device_id, value: model_name
Mdflow/deployer/deploy/execfwk/pne_executor_client.cc+0-4
@@ -33,10 +33,6 @@ int32_t PneExecutorClient::GetDeviceId() const {
33 return device_id_;33 return device_id_;
34}34}
35 35 
36-int32_t PneExecutorClient::GetProcessId() const {
37- return context_.process_id;
38-}
39- 
40int32_t PneExecutorClient::GetDeployerPid() const {36int32_t PneExecutorClient::GetDeployerPid() const {
41 return context_.deployer_pid;37 return context_.deployer_pid;
42}38}
Mdflow/deployer/deploy/execfwk/pne_executor_client.h+0-2
@@ -56,8 +56,6 @@ class PneExecutorClient {
56 56 
57 int32_t GetDeviceId() const;57 int32_t GetDeviceId() const;
58 58 
59- int32_t GetProcessId() const;
60- 
61 int32_t GetDeployerPid() const;59 int32_t GetDeployerPid() const;
62 60 
63 const ClientContext &GetContext() const;61 const ClientContext &GetContext() const;
Mdflow/deployer/deploy/flowrm/heterogeneous_exchange_deployer.cc+0-3
@@ -579,9 +579,6 @@ Status HeterogeneousExchangeDeployer::UpdateExceptionRoutes(
579const ExchangeRoute *HeterogeneousExchangeDeployer::GetRoute() const {579const ExchangeRoute *HeterogeneousExchangeDeployer::GetRoute() const {
580 return &deploying_;580 return &deploying_;
581}581}
582-ExchangeRoute *HeterogeneousExchangeDeployer::MutableRoute() {
583- return &deploying_;
584-}
585 582 
586std::vector<deployer::EndpointBinding> HeterogeneousExchangeDeployer::GetBindingsAfterLoad() const {583std::vector<deployer::EndpointBinding> HeterogeneousExchangeDeployer::GetBindingsAfterLoad() const {
587 std::vector<deployer::EndpointBinding> bindings(route_plan_.bindings().cbegin(), route_plan_.bindings().cend());584 std::vector<deployer::EndpointBinding> bindings(route_plan_.bindings().cbegin(), route_plan_.bindings().cend());
Mdflow/deployer/deploy/flowrm/heterogeneous_exchange_deployer.h+0-1
@@ -61,7 +61,6 @@ class HeterogeneousExchangeDeployer {
61 static Status Undeploy(ExchangeService &exchange_service, const ExchangeRoute &deployed,61 static Status Undeploy(ExchangeService &exchange_service, const ExchangeRoute &deployed,
62 FlowGwClientManager &client_manager);62 FlowGwClientManager &client_manager);
63 const ExchangeRoute *GetRoute() const;63 const ExchangeRoute *GetRoute() const;
64- ExchangeRoute *MutableRoute();
65 static Status UpdateExceptionRoutes(ExchangeRoute &deployed, FlowGwClientManager &client_manager,64 static Status UpdateExceptionRoutes(ExchangeRoute &deployed, FlowGwClientManager &client_manager,
66 const std::vector<FlowGwClient::ExceptionDeviceInfo> &exception_devices);65 const std::vector<FlowGwClient::ExceptionDeviceInfo> &exception_devices);
67 66 
Mdflow/deployer/deploy/flowrm/network_manager.cc+0-8
@@ -120,14 +120,6 @@ Status NetworkManager::GetDataPanelIp(std::string &host_ip) const {
120 return SUCCESS;120 return SUCCESS;
121}121}
122 122 
123-std::string NetworkManager::GetCtrlPanelIp() const {
124- return Configurations::GetInstance().GetHostInformation().host_info.ctrl_panel.ipaddr;
125-}
126- 
127-std::string NetworkManager::GetCtrlPanelPorts() const {
128- return Configurations::GetInstance().GetHostInformation().host_info.ctrl_panel.available_ports;
129-}
130- 
131Status NetworkManager::Initialize() {123Status NetworkManager::Initialize() {
132 return SUCCESS;124 return SUCCESS;
133}125}
Mdflow/deployer/deploy/flowrm/network_manager.h+0-14
@@ -54,20 +54,6 @@ class NetworkManager {
54 */54 */
55 Status GetDataPanelPort(int32_t &port);55 Status GetDataPanelPort(int32_t &port);
56 56 
57- /*
58- * @ingroup ge
59- * @brief get ctrl panel ip
60- * @return: ctrl ip address
61- */
62- std::string GetCtrlPanelIp() const;
63- 
64- /*
65- * @ingroup ge
66- * @brief get ctrl panel ports
67- * @return: ctrl port range
68- */
69- std::string GetCtrlPanelPorts() const;
70- 
71 private:57 private:
72 NetworkManager() = default;58 NetworkManager() = default;
73 ~NetworkManager() = default;59 ~NetworkManager() = default;
Mdflow/deployer/deploy/model_send/flow_model_sender.cc+0-3
@@ -12,14 +12,11 @@
12#include <fstream>12#include <fstream>
13#include <algorithm>13#include <algorithm>
14#include "common/thread_pool/thread_pool.h"14#include "common/thread_pool/thread_pool.h"
15-#include "graph/manager/graph_var_manager.h"
16#include "graph/ge_context.h"15#include "graph/ge_context.h"
17#include "graph/debug/ge_attr_define.h"16#include "graph/debug/ge_attr_define.h"
18-#include "graph/utils/graph_utils.h"
19#include "graph/utils/tensor_utils.h"17#include "graph/utils/tensor_utils.h"
20#include "common/file_constant_utils/file_constant_utils.h"18#include "common/file_constant_utils/file_constant_utils.h"
21#include "framework/common/framework_types_internal.h"19#include "framework/common/framework_types_internal.h"
22-#include "securec.h"
23#include "deploy/deployer/deployer_proxy.h"20#include "deploy/deployer/deployer_proxy.h"
24#include "deploy/flowrm/flow_route_planner.h"21#include "deploy/flowrm/flow_route_planner.h"
25#include "common/data_flow/queue/heterogeneous_exchange_service.h"22#include "common/data_flow/queue/heterogeneous_exchange_service.h"
Mdflow/deployer/deploy/resource/resource_manager.cc+0-3
@@ -149,7 +149,4 @@ int32_t ResourceManager::GetLocalNodeId() const {
149 return local_node_id_;149 return local_node_id_;
150}150}
151 151 
152-const std::map<std::string, std::vector<DeviceInfo>> &ResourceManager::GetDeviceIp2DevicesMap() const {
153- return device_ip_2_devices_;
154-}
155} // namespace ge152} // namespace ge
Mdflow/deployer/deploy/resource/resource_manager.h+0-1
@@ -39,7 +39,6 @@ class ResourceManager {
39 int32_t GetLocalNodeId() const;39 int32_t GetLocalNodeId() const;
40 40 
41 static void ClearWorkingDir();41 static void ClearWorkingDir();
42- const std::map<std::string, std::vector<DeviceInfo>> &GetDeviceIp2DevicesMap() const;
43 const ModelCompileResource &GetCompileResource() const {42 const ModelCompileResource &GetCompileResource() const {
44 return compile_resource_;43 return compile_resource_;
45 }44 }
Mdflow/deployer/executor/cpu_id_resource_manager.cc+0-20
@@ -41,26 +41,6 @@ Status CpuIdResourceManager::DeAllocate(std::vector<uint32_t> &ids) {
41 return SUCCESS;41 return SUCCESS;
42}42}
43 43 
44-Status CpuIdResourceManager::GenerateAicpuStreamId(uint32_t &id) {
45- const std::lock_guard<std::mutex> lock(mutex_);
46- auto iter = std::find(streams_.begin(), streams_.end(), false);
47- if (iter == streams_.end()) {
48- GELOGE(FAILED, "Failed to generate available stream id.");
49- return FAILED;
50- }
51- id = std::distance(streams_.begin(), iter);
52- streams_[id] = true;
53- return SUCCESS;
54-}
55- 
56-Status CpuIdResourceManager::FreeAicpuStreamId(const std::vector<uint32_t> &ids) {
57- const std::lock_guard<std::mutex> lock(mutex_);
58- for (auto id : ids) {
59- streams_[id] = false;
60- }
61- return SUCCESS;
62-}
63- 
64Status AicpuModelIdResourceManager::GenerateAicpuModelId(uint32_t &id) {44Status AicpuModelIdResourceManager::GenerateAicpuModelId(uint32_t &id) {
65 GE_CHK_STATUS_RET(Allocate(id), "Fail to allocate stream id");45 GE_CHK_STATUS_RET(Allocate(id), "Fail to allocate stream id");
66 return SUCCESS;46 return SUCCESS;
Mdflow/deployer/executor/cpu_id_resource_manager.h+0-2
@@ -24,8 +24,6 @@ class CpuIdResourceManager {
24 24 
25 Status Allocate(uint32_t &id);25 Status Allocate(uint32_t &id);
26 Status DeAllocate(std::vector<uint32_t> &ids);26 Status DeAllocate(std::vector<uint32_t> &ids);
27- Status GenerateAicpuStreamId(uint32_t &id);
28- Status FreeAicpuStreamId(const std::vector<uint32_t> &ids);
29 27 
30 private:28 private:
31 std::vector<bool> resources_ = std::vector<bool>(kMaxResourceId, false);29 std::vector<bool> resources_ = std::vector<bool>(kMaxResourceId, false);
Mdflow/deployer/executor/executor_context.cc+0-6
@@ -236,12 +236,6 @@ Status ExecutorContext::SyncSharedVarManager(const deployer::ExecutorRequest &re
236 return SUCCESS;236 return SUCCESS;
237}237}
238 238 
239-void ExecutorContext::UpdateGraphOptions(const std::string &key, const std::string &value) {
240- std::map<std::string, std::string> graph_options = GetThreadLocalContext().GetAllGraphOptions();
241- graph_options[key] = value;
242- GetThreadLocalContext().SetGraphOption(graph_options);
243-}
244- 
245void ExecutorContext::UpdateOptions(const deployer::Options &options) {239void ExecutorContext::UpdateOptions(const deployer::Options &options) {
246 std::map<std::string, std::string> global_options = GetThreadLocalContext().GetAllGlobalOptions();240 std::map<std::string, std::string> global_options = GetThreadLocalContext().GetAllGlobalOptions();
247 for (const auto &item : options.global_options()) {241 for (const auto &item : options.global_options()) {
Mdflow/deployer/executor/executor_context.h+0-1
@@ -138,7 +138,6 @@ class ExecutorContext {
138 Status ParseModelEschedPriority(const deployer::ExecutorRequest_LoadModelRequest &request, ModelHandle &handle) const;138 Status ParseModelEschedPriority(const deployer::ExecutorRequest_LoadModelRequest &request, ModelHandle &handle) const;
139 static Status ParseInputAlignAttrs(const deployer::ExecutorRequest_LoadModelRequest &request,139 static Status ParseInputAlignAttrs(const deployer::ExecutorRequest_LoadModelRequest &request,
140 InputAlignAttrs &input_align_attrs);140 InputAlignAttrs &input_align_attrs);
141- static void UpdateGraphOptions(const std::string &key, const std::string &value);
142 141 
143 // root_model_id, model_id, model_handle142 // root_model_id, model_id, model_handle
144 std::mutex mu_;143 std::mutex mu_;
Mdflow/executor/flow_model_manager.cc+0-5
@@ -69,11 +69,6 @@ FlowModelPtr FlowModelManager::GetFlowModelByModelId(uint32_t model_id) {
69 return iter->second->GetFlowModel();69 return iter->second->GetFlowModel();
70}70}
71 71 
72-bool FlowModelManager::IsLoadedByFlowModel(uint32_t model_id) {
73- const std::lock_guard<std::mutex> lk(map_mutex_);
74- return heterogeneous_model_map_.find(model_id) != heterogeneous_model_map_.cend();
75-}
76- 
77Status FlowModelManager::StopAndUnloadModel(const std::shared_ptr<HeterogeneousModelExecutor> &executor,72Status FlowModelManager::StopAndUnloadModel(const std::shared_ptr<HeterogeneousModelExecutor> &executor,
78 uint32_t deployed_model_id) const {73 uint32_t deployed_model_id) const {
79 if (executor != nullptr) {74 if (executor != nullptr) {
Mdflow/executor/flow_model_manager.h+0-2
@@ -26,8 +26,6 @@ class FlowModelManager {
26 Status ExecuteFlowModel(uint32_t model_id, const std::vector<GeTensor> &inputs, std::vector<GeTensor> &outputs);26 Status ExecuteFlowModel(uint32_t model_id, const std::vector<GeTensor> &inputs, std::vector<GeTensor> &outputs);
27 FlowModelPtr GetFlowModelByModelId(uint32_t model_id);27 FlowModelPtr GetFlowModelByModelId(uint32_t model_id);
28 28 
29- bool IsLoadedByFlowModel(uint32_t model_id);
30- 
31 /// @ingroup domi_ome29 /// @ingroup domi_ome
32 /// @brief unload model and free resources30 /// @brief unload model and free resources
33 /// @param [in] model_id model id31 /// @param [in] model_id model id
Mdflow/executor/heterogeneous_model_executor.h+0-5
@@ -105,11 +105,6 @@ class HeterogeneousModelExecutor {
105 }105 }
106 106 
107 private:107 private:
108- struct RunAsyncRequest {
109- RunAsyncCallback callback;
110- const void *shared_buffer = nullptr;
111- };
112- 
113 struct ModelIndices {108 struct ModelIndices {
114 std::vector<int32_t> inputs;109 std::vector<int32_t> inputs;
115 std::vector<int32_t> outputs;110 std::vector<int32_t> outputs;
Mdflow/flow_graph/flow_graph.cc+0-1
@@ -24,7 +24,6 @@
24 24 
25namespace ge {25namespace ge {
26namespace dflow {26namespace dflow {
27-using ComputeGraphPtr = std::shared_ptr<ComputeGraph>;
28 27 
29FlowOperator::FlowOperator(const char *name, const char *type) : ge::Operator(name, type) {}28FlowOperator::FlowOperator(const char *name, const char *type) : ge::Operator(name, type) {}
30FlowOperator::~FlowOperator() = default;29FlowOperator::~FlowOperator() = default;
Mdflow/flow_graph/process_point.cc+0-4
@@ -378,10 +378,6 @@ class FunctionPpImpl {
378 return attrs_.SetByName(name, std::forward<T>(value));378 return attrs_.SetByName(name, std::forward<T>(value));
379 }379 }
380 380 
381- const ge::AttrStore &GetAttrMap() const {
382- return attrs_;
383- }
384- 
385 void UpdataProcessPoint(dataflow::ProcessPoint &process_point) {381 void UpdataProcessPoint(dataflow::ProcessPoint &process_point) {
386 AddInvokedPps(process_point);382 AddInvokedPps(process_point);
387 AddFunctionPpInitPara(process_point);383 AddFunctionPpInitPara(process_point);
Mdflow/udf/flow_func/flow_func_processor.h+0-1
@@ -236,7 +236,6 @@ class FLOW_FUNC_VISIBILITY FlowFuncProcessor {
236 volatile bool wait_schedule_flag_ = false;236 volatile bool wait_schedule_flag_ = false;
237 237 
238 std::mutex queue_event_guard_;238 std::mutex queue_event_guard_;
239- // std::mutex writerGuard_;
240 volatile bool not_empty_event_ = false;239 volatile bool not_empty_event_ = false;
241 volatile bool wait_not_empty_event_ = false;240 volatile bool wait_not_empty_event_ = false;
242 volatile bool not_full_event_ = false;241 volatile bool not_full_event_ = false;
Mtests/dflow/runner/ut/ge/runtime/heterogeneous/deploy/deployer/master_model_deployer_unittest.cc+11-18
@@ -135,13 +135,6 @@ class MockRuntimeNoLeaks : public RuntimeStub {
135 std::vector<void *> mem_bufs_;135 std::vector<void *> mem_bufs_;
136};136};
137 137 
138-class MockMasterModelDeployer : public MasterModelDeployer {
139- public:
140- MOCK_CONST_METHOD2(DeployLocalExchangePlan, Status(const deployer::FlowRoutePlan &, ExchangeRoute &));
141- MOCK_METHOD3(DeployRemoteVarManager,
142- Status(const DeployPlan &, const std::map<int32_t, std::vector<ConstSubmodelInfoPtr>> &,
143- MasterModelDeployer::DeployedModel &));
144-};
145} // namespace138} // namespace
146 139 
147class MasterModelDeployerTest : public testing::Test {140class MasterModelDeployerTest : public testing::Test {
@@ -200,7 +193,7 @@ TEST_F(MasterModelDeployerTest, TestDeployModel_Success) {
200 AttrUtils::SetBool(flow_model->GetRootGraph(), "_inputs_align_dropout", true);193 AttrUtils::SetBool(flow_model->GetRootGraph(), "_inputs_align_dropout", true);
201 194 
202 MasterModelDeployer::DeployedModel deployed_model;195 MasterModelDeployer::DeployedModel deployed_model;
203- MockMasterModelDeployer model_deployer;196+ MasterModelDeployer model_deployer;
204 DeployResult deploy_result;197 DeployResult deploy_result;
205 auto mock_runtime = std::make_shared<MockRuntimeNoLeaks>();198 auto mock_runtime = std::make_shared<MockRuntimeNoLeaks>();
206 RuntimeStub::SetInstance(mock_runtime);199 RuntimeStub::SetInstance(mock_runtime);
@@ -216,7 +209,7 @@ TEST_F(MasterModelDeployerTest, TestDeployModel_Success) {
216}209}
217 210 
218TEST_F(MasterModelDeployerTest, SetTrimmingModelInstanceNames) {211TEST_F(MasterModelDeployerTest, SetTrimmingModelInstanceNames) {
219- MockMasterModelDeployer model_deployer;212+ MasterModelDeployer model_deployer;
220 std::map<std::string, std::vector<std::string>> org_model_instance_names;213 std::map<std::string, std::vector<std::string>> org_model_instance_names;
221 org_model_instance_names["name1"] = {"name2", "name3"};214 org_model_instance_names["name1"] = {"name2", "name3"};
222 org_model_instance_names["name2"] = {"name4"};215 org_model_instance_names["name2"] = {"name4"};
@@ -242,7 +235,7 @@ TEST_F(MasterModelDeployerTest, TestInitinalize) {
242TEST_F(MasterModelDeployerTest, TestFinalize) {235TEST_F(MasterModelDeployerTest, TestFinalize) {
243 auto flow_model = StubModels::BuildFlowModel(StubModels::BuildGraphWithoutNeedForBindingQueues());236 auto flow_model = StubModels::BuildFlowModel(StubModels::BuildGraphWithoutNeedForBindingQueues());
244 MasterModelDeployer::DeployedModel deployed_model;237 MasterModelDeployer::DeployedModel deployed_model;
245- MockMasterModelDeployer model_deployer;238+ MasterModelDeployer model_deployer;
246 DeployResult deploy_result;239 DeployResult deploy_result;
247 ASSERT_EQ(model_deployer.DeployModel(flow_model, deploy_result), SUCCESS);240 ASSERT_EQ(model_deployer.DeployModel(flow_model, deploy_result), SUCCESS);
248 ASSERT_EQ(model_deployer.deployed_models_.size(), 1);241 ASSERT_EQ(model_deployer.deployed_models_.size(), 1);
@@ -259,7 +252,7 @@ TEST_F(MasterModelDeployerTest, TestWithErrorHostCompileRes) {
259 flow_model->SetCompileResource(compile_resource);252 flow_model->SetCompileResource(compile_resource);
260 253 
261 MasterModelDeployer::DeployedModel deployed_model;254 MasterModelDeployer::DeployedModel deployed_model;
262- MockMasterModelDeployer model_deployer;255+ MasterModelDeployer model_deployer;
263 DeployResult deploy_result;256 DeployResult deploy_result;
264 ASSERT_EQ(model_deployer.DeployModel(flow_model, deploy_result), FAILED);257 ASSERT_EQ(model_deployer.DeployModel(flow_model, deploy_result), FAILED);
265}258}
@@ -269,7 +262,7 @@ TEST_F(MasterModelDeployerTest, TestGetDeviceMeshIndex) {
269 DeviceInfo local_device(0, NPU, 0);262 DeviceInfo local_device(0, NPU, 0);
270 local_device.SetNodeMeshIndex({0, 0});263 local_device.SetNodeMeshIndex({0, 0});
271 ResourceManager::GetInstance().device_info_map_[0][0][NPU] = &local_device;264 ResourceManager::GetInstance().device_info_map_[0][0][NPU] = &local_device;
272- MockMasterModelDeployer model_deployer;265+ MasterModelDeployer model_deployer;
273 std::vector<int32_t> device_mesh_index;266 std::vector<int32_t> device_mesh_index;
274 ASSERT_EQ(model_deployer.GetDeviceMeshIndex(0, device_mesh_index), SUCCESS);267 ASSERT_EQ(model_deployer.GetDeviceMeshIndex(0, device_mesh_index), SUCCESS);
275 ASSERT_EQ(device_mesh_index.size(), 4);268 ASSERT_EQ(device_mesh_index.size(), 4);
@@ -278,7 +271,7 @@ TEST_F(MasterModelDeployerTest, TestGetDeviceMeshIndex) {
278}271}
279 272 
280TEST_F(MasterModelDeployerTest, TestGetValidLogicDeviceId) {273TEST_F(MasterModelDeployerTest, TestGetValidLogicDeviceId) {
281- MockMasterModelDeployer model_deployer;274+ MasterModelDeployer model_deployer;
282 std::string logic_device_id = "0:0:0:0";275 std::string logic_device_id = "0:0:0:0";
283 ASSERT_EQ(model_deployer.GetValidLogicDeviceId(logic_device_id), SUCCESS);276 ASSERT_EQ(model_deployer.GetValidLogicDeviceId(logic_device_id), SUCCESS);
284}277}
@@ -295,7 +288,7 @@ TEST_F(MasterModelDeployerTest, TestWithDeviceCompileRes) {
295 ResourceManager::GetInstance().compile_resource_.logic_dev_id_to_res_type["0"] = "Arrch";288 ResourceManager::GetInstance().compile_resource_.logic_dev_id_to_res_type["0"] = "Arrch";
296 289 
297 MasterModelDeployer::DeployedModel deployed_model;290 MasterModelDeployer::DeployedModel deployed_model;
298- MockMasterModelDeployer model_deployer;291+ MasterModelDeployer model_deployer;
299 DeployResult deploy_result;292 DeployResult deploy_result;
300 ASSERT_EQ(model_deployer.DeployModel(flow_model, deploy_result), FAILED);293 ASSERT_EQ(model_deployer.DeployModel(flow_model, deploy_result), FAILED);
301 294 
@@ -320,7 +313,7 @@ TEST_F(MasterModelDeployerTest, TestWithDeviceCompileResMoreErr) {
320 ResourceManager::GetInstance().compile_resource_.logic_dev_id_to_res_type["0"] = "Ascend";313 ResourceManager::GetInstance().compile_resource_.logic_dev_id_to_res_type["0"] = "Ascend";
321 314 
322 MasterModelDeployer::DeployedModel deployed_model;315 MasterModelDeployer::DeployedModel deployed_model;
323- MockMasterModelDeployer model_deployer;316+ MasterModelDeployer model_deployer;
324 DeployResult deploy_result;317 DeployResult deploy_result;
325 ASSERT_EQ(model_deployer.DeployModel(flow_model, deploy_result), FAILED);318 ASSERT_EQ(model_deployer.DeployModel(flow_model, deploy_result), FAILED);
326 319 
@@ -471,7 +464,7 @@ TEST_F(MasterModelDeployerTest, TestDynamicSchedDeployModel_Success) {
471 464 
472 auto flow_model = StubModels::BuildFlowModel(StubModels::BuildGraphWithoutNeedForBindingQueues());465 auto flow_model = StubModels::BuildFlowModel(StubModels::BuildGraphWithoutNeedForBindingQueues());
473 MasterModelDeployer::DeployedModel deployed_model;466 MasterModelDeployer::DeployedModel deployed_model;
474- MockMasterModelDeployer model_deployer;467+ MasterModelDeployer model_deployer;
475 DeployResult deploy_result;468 DeployResult deploy_result;
476 (void)AttrUtils::SetBool(flow_model->GetRootGraph(), "dynamic_schedule_enable", true);469 (void)AttrUtils::SetBool(flow_model->GetRootGraph(), "dynamic_schedule_enable", true);
477 auto mock_runtime = std::make_shared<MockRuntimeNoLeaks>();470 auto mock_runtime = std::make_shared<MockRuntimeNoLeaks>();
@@ -509,7 +502,7 @@ TEST_F(MasterModelDeployerTest, TestExceptionClearDeployModel_Success) {
509 502 
510 auto flow_model = StubModels::BuildFlowModel(StubModels::BuildGraphWithoutNeedForBindingQueues());503 auto flow_model = StubModels::BuildFlowModel(StubModels::BuildGraphWithoutNeedForBindingQueues());
511 MasterModelDeployer::DeployedModel deployed_model;504 MasterModelDeployer::DeployedModel deployed_model;
512- MockMasterModelDeployer model_deployer;505+ MasterModelDeployer model_deployer;
513 DeployResult deploy_result;506 DeployResult deploy_result;
514 (void)AttrUtils::SetBool(flow_model->GetRootGraph(), "dynamic_schedule_enable", true);507 (void)AttrUtils::SetBool(flow_model->GetRootGraph(), "dynamic_schedule_enable", true);
515 ASSERT_EQ(model_deployer.DeployModel(flow_model, deploy_result), SUCCESS);508 ASSERT_EQ(model_deployer.DeployModel(flow_model, deploy_result), SUCCESS);
@@ -551,7 +544,7 @@ TEST_F(MasterModelDeployerTest, TestExceptionClearDeployModelOneModel_Success) {
551 544 
552 auto flow_model = StubModels::BuildFlowModel(StubModels::BuildGraphWithoutNeedForBindingQueues());545 auto flow_model = StubModels::BuildFlowModel(StubModels::BuildGraphWithoutNeedForBindingQueues());
553 MasterModelDeployer::DeployedModel deployed_model;546 MasterModelDeployer::DeployedModel deployed_model;
554- MockMasterModelDeployer model_deployer;547+ MasterModelDeployer model_deployer;
555 DeployResult deploy_result;548 DeployResult deploy_result;
556 (void)AttrUtils::SetBool(flow_model->GetRootGraph(), "dynamic_schedule_enable", true);549 (void)AttrUtils::SetBool(flow_model->GetRootGraph(), "dynamic_schedule_enable", true);
557 ASSERT_EQ(model_deployer.DeployModel(flow_model, deploy_result), SUCCESS);550 ASSERT_EQ(model_deployer.DeployModel(flow_model, deploy_result), SUCCESS);