Browse Source

restore code

pull/145/head
y00500818 4 years ago
parent
commit
118afdc74f
3 changed files with 4 additions and 24 deletions
  1. +2
    -12
      parser/common/acl_graph_parser_util.cc
  2. +1
    -10
      parser/common/parser_api.cc
  3. +1
    -2
      parser/common/register_tbe.cc

+ 2
- 12
parser/common/acl_graph_parser_util.cc View File

@@ -27,7 +27,6 @@


#include "ge/ge_api_types.h" #include "ge/ge_api_types.h"
#include "graph/opsproto_manager.h" #include "graph/opsproto_manager.h"
#include "graph/utils/type_utils.h"
#include "omg/parser/parser_inner_ctx.h" #include "omg/parser/parser_inner_ctx.h"
#include "framework/common/debug/ge_log.h" #include "framework/common/debug/ge_log.h"
#include "parser/common/register_tbe.h" #include "parser/common/register_tbe.h"
@@ -207,20 +206,11 @@ domi::Status AclGrphParseUtil::AclParserInitialize(const std::map<std::string, s
return FAILED; return FAILED;
} }


auto it = options.find(ge::FRAMEWORK_TYPE);
if (it == options.end()) {
GELOGE(FAILED, "Can not find ge.frameworkType in options");
return FAILED;
}
std::string fmk_type = it->second;
GELOGD("frameworkType is %s", fmk_type.c_str());
std::vector<OpRegistrationData> registrationDatas = op_registry->registrationDatas; std::vector<OpRegistrationData> registrationDatas = op_registry->registrationDatas;
GELOGI("The size of registrationDatas in parser is: %zu", registrationDatas.size()); GELOGI("The size of registrationDatas in parser is: %zu", registrationDatas.size());
for (OpRegistrationData &reg_data : registrationDatas) { for (OpRegistrationData &reg_data : registrationDatas) {
if (std::to_string(reg_data.GetFrameworkType()) == fmk_type) {
(void)OpRegistrationTbe::Instance()->Finalize(reg_data, false);
(void)domi::OpRegistry::Instance()->Register(reg_data);
}
(void)OpRegistrationTbe::Instance()->Finalize(reg_data, false);
domi::OpRegistry::Instance()->Register(reg_data);
} }


// set init status // set init status


+ 1
- 10
parser/common/parser_api.cc View File

@@ -19,7 +19,6 @@


#include "common/ge/tbe_plugin_manager.h" #include "common/ge/tbe_plugin_manager.h"
#include "framework/common/debug/ge_log.h" #include "framework/common/debug/ge_log.h"
#include "graph/utils/type_utils.h"
#include "parser/common/register_tbe.h" #include "parser/common/register_tbe.h"
#include "framework/omg/parser/parser_inner_ctx.h" #include "framework/omg/parser/parser_inner_ctx.h"
#include "external/ge/ge_api_types.h" #include "external/ge/ge_api_types.h"
@@ -39,18 +38,10 @@ Status ParserInitialize(const std::map<std::string, std::string> &options) {
// load custom op plugin // load custom op plugin
TBEPluginManager::Instance().LoadPluginSo(options); TBEPluginManager::Instance().LoadPluginSo(options);


std::string fmk_type = std::to_string(domi::TENSORFLOW);
auto it = options.find(ge::FRAMEWORK_TYPE);
if (it != options.end()) {
fmk_type = it->second;
}
GELOGD("frameworkType is %s", fmk_type.c_str());
std::vector<OpRegistrationData> registrationDatas = domi::OpRegistry::Instance()->registrationDatas; std::vector<OpRegistrationData> registrationDatas = domi::OpRegistry::Instance()->registrationDatas;
GELOGI("The size of registrationDatas in parser is: %zu", registrationDatas.size()); GELOGI("The size of registrationDatas in parser is: %zu", registrationDatas.size());
for (OpRegistrationData &reg_data : registrationDatas) { for (OpRegistrationData &reg_data : registrationDatas) {
if (std::to_string(reg_data.GetFrameworkType()) == fmk_type) {
(void)OpRegistrationTbe::Instance()->Finalize(reg_data, true);
}
(void)OpRegistrationTbe::Instance()->Finalize(reg_data, true);
} }


auto iter = options.find(ge::OPTION_EXEC_ENABLE_SCOPE_FUSION_PASSES); auto iter = options.find(ge::OPTION_EXEC_ENABLE_SCOPE_FUSION_PASSES);


+ 1
- 2
parser/common/register_tbe.cc View File

@@ -124,8 +124,7 @@ bool OpRegistrationTbe::RegisterParser(const OpRegistrationData &reg_data) {


PARSER_CREATOR_FN func = CustomParserAdapterRegistry::Instance()->GetCreateFunc(reg_data.GetFrameworkType()); PARSER_CREATOR_FN func = CustomParserAdapterRegistry::Instance()->GetCreateFunc(reg_data.GetFrameworkType());
if (func == nullptr) { if (func == nullptr) {
GELOGE(INTERNAL_ERROR,
"Get custom parser adapter failed for fmk type %s.",
GELOGW("Get custom parser adapter failed for fmk type %s.",
TypeUtils::FmkTypeToSerialString(reg_data.GetFrameworkType()).c_str()); TypeUtils::FmkTypeToSerialString(reg_data.GetFrameworkType()).c_str());
return false; return false;
} }


Loading…
Cancel
Save