已合并
refactor: 清理 dflow 中未使用的 include、using 别名、废弃函数和结构体 #3846
lining23666创建于 7月3日
refactor: 清理 dflow 中未使用的 include、using 别名、废弃函数和结构体 #3846
已合并
共 39 个文件变更+11-202
| @@ -51,7 +51,6 @@ bool IsNeedDeviceQueue(const DeployPlan::SubmodelInfo &submodel_info) { | |||
| 51 | 51 | ||
| 52 | std::atomic<int64_t> DeployPlannerBase::endpoint_name_id_gen_{}; | 52 | std::atomic<int64_t> DeployPlannerBase::endpoint_name_id_gen_{}; |
| 53 | std::atomic<int64_t> DeployPlannerBase::plan_id_gen_{}; | 53 | std::atomic<int64_t> DeployPlannerBase::plan_id_gen_{}; |
| 54 | -using DynamicSchedInfo = std::map<std::string, DeployPlan::SubmodelInfo>; | ||
| 55 | 54 | ||
| 56 | const std::vector<DeployPlan::QueueInfo> &DeployPlan::GetQueueInfoList() const { | 55 | const 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 | - | ||
| 1601 | const std::string &DeployPlannerBase::GetSubmodelType(const std::string &name) { | 1596 | const 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; |
| @@ -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); |
| @@ -225,18 +225,6 @@ Status LoadSerializedModel(flow_model::proto::SubmodelDef &flow_submodel_def, co | |||
| 225 | } | 225 | } |
| 226 | } // namespace | 226 | } // 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 | - | ||
| 240 | bool FlowModelOmLoader::CheckFilePathValid(const std::string &base_dir, const std::string &check_dir) { | 228 | bool 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; |
| @@ -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); |
| @@ -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 | - | ||
| 192 | Status FlowModelOmSaver::AddModelDefPartition() { | 181 | Status 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); |
| @@ -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_key | 25 | // 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(); |
| @@ -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 | - | ||
| 379 | Status ModelRelationReader::Initialize() { | 370 | Status 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); |
| @@ -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_; |
| @@ -11,9 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | - | ||
| 15 | 14 | ||
| 16 | - | ||
| 17 | 15 | ||
| 18 | 16 | ||
| 19 | namespace { | 17 | namespace { |
| @@ -15,10 +15,8 @@ | |||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | - | ||
| 19 | 18 | ||
| 20 | 19 | ||
| 21 | - | ||
| 22 | 20 | ||
| 23 | namespace ge { | 21 | namespace ge { |
| 24 | namespace { | 22 | namespace { |
| @@ -15,7 +15,6 @@ | |||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | namespace ge { | 17 | namespace ge { |
| 18 | -using AutoDeployFunc = Status (*)(const std::map<std::string, std::string> &, const ComputeGraphPtr &); | ||
| 19 | 18 | ||
| 20 | class DataFlowGraphAutoDeployer { | 19 | class DataFlowGraphAutoDeployer { |
| 21 | public: | 20 | public: |
| @@ -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 | - | ||
| 123 | Status ProcessNodeEngineManager::RegisterEngine(const std::string &engine_id, const ProcessNodeEnginePtr &engine, | 113 | Status 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_); |
| @@ -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; |
| @@ -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 | - | ||
| 216 | Status UdfModelBuilder::SetBinName(const OpDescPtr &op_desc, udf::UdfDef &udf_def) const { | 203 | Status 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, |
| @@ -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; |
| @@ -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 | - | ||
| 61 | Status Configurations::GetWorkingDir(std::string &working_dir) const { | 39 | Status 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; |
| @@ -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: |
| @@ -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 { |
| 47 | uint32_t model_id = UINT32_MAX; | 46 | uint32_t model_id = UINT32_MAX; |
| 48 | // key: device_id, value: model_name | 47 | // key: device_id, value: model_name |
| @@ -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 | - | ||
| 40 | int32_t PneExecutorClient::GetDeployerPid() const { | 36 | int32_t PneExecutorClient::GetDeployerPid() const { |
| 41 | return context_.deployer_pid; | 37 | return context_.deployer_pid; |
| 42 | } | 38 | } |
| @@ -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; |
| @@ -579,9 +579,6 @@ Status HeterogeneousExchangeDeployer::UpdateExceptionRoutes( | |||
| 579 | const ExchangeRoute *HeterogeneousExchangeDeployer::GetRoute() const { | 579 | const ExchangeRoute *HeterogeneousExchangeDeployer::GetRoute() const { |
| 580 | return &deploying_; | 580 | return &deploying_; |
| 581 | } | 581 | } |
| 582 | -ExchangeRoute *HeterogeneousExchangeDeployer::MutableRoute() { | ||
| 583 | - return &deploying_; | ||
| 584 | -} | ||
| 585 | 582 | ||
| 586 | std::vector<deployer::EndpointBinding> HeterogeneousExchangeDeployer::GetBindingsAfterLoad() const { | 583 | std::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()); |
| @@ -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 | ||
| @@ -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 | - | ||
| 131 | Status NetworkManager::Initialize() { | 123 | Status NetworkManager::Initialize() { |
| 132 | return SUCCESS; | 124 | return SUCCESS; |
| 133 | } | 125 | } |
| @@ -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; |
| @@ -12,14 +12,11 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | - | ||
| 16 | 15 | ||
| 17 | 16 | ||
| 18 | - | ||
| 19 | 17 | ||
| 20 | 18 | ||
| 21 | 19 | ||
| 22 | - | ||
| 23 | 20 | ||
| 24 | 21 | ||
| 25 | 22 | ||
| @@ -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 ge | 152 | } // namespace ge |
| @@ -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 | } |
| @@ -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 | - | ||
| 64 | Status AicpuModelIdResourceManager::GenerateAicpuModelId(uint32_t &id) { | 44 | Status 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; |
| @@ -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); |
| @@ -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 | - | ||
| 245 | void ExecutorContext::UpdateOptions(const deployer::Options &options) { | 239 | void 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()) { |
| @@ -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_handle | 142 | // root_model_id, model_id, model_handle |
| 144 | std::mutex mu_; | 143 | std::mutex mu_; |
| @@ -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 | - | ||
| 77 | Status FlowModelManager::StopAndUnloadModel(const std::shared_ptr<HeterogeneousModelExecutor> &executor, | 72 | Status 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) { |
| @@ -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_ome | 29 | /// @ingroup domi_ome |
| 32 | /// @brief unload model and free resources | 30 | /// @brief unload model and free resources |
| 33 | /// @param [in] model_id model id | 31 | /// @param [in] model_id model id |
| @@ -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; |
| @@ -24,7 +24,6 @@ | |||
| 24 | 24 | ||
| 25 | namespace ge { | 25 | namespace ge { |
| 26 | namespace dflow { | 26 | namespace dflow { |
| 27 | -using ComputeGraphPtr = std::shared_ptr<ComputeGraph>; | ||
| 28 | 27 | ||
| 29 | FlowOperator::FlowOperator(const char *name, const char *type) : ge::Operator(name, type) {} | 28 | FlowOperator::FlowOperator(const char *name, const char *type) : ge::Operator(name, type) {} |
| 30 | FlowOperator::~FlowOperator() = default; | 29 | FlowOperator::~FlowOperator() = default; |
| @@ -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); |
| @@ -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 | } // namespace | 138 | } // namespace |
| 146 | 139 | ||
| 147 | class MasterModelDeployerTest : public testing::Test { | 140 | class 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 | ||
| 218 | TEST_F(MasterModelDeployerTest, SetTrimmingModelInstanceNames) { | 211 | TEST_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) { | |||
| 242 | TEST_F(MasterModelDeployerTest, TestFinalize) { | 235 | TEST_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 | ||
| 280 | TEST_F(MasterModelDeployerTest, TestGetValidLogicDeviceId) { | 273 | TEST_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); |
🟡 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 *。