Browse Source

!152 bugfix for plugin load.

Merge pull request !152 from yangyongqiang/dev_bugfix
pull/152/MERGE
i-robot Gitee 5 years ago
parent
commit
866d6a2b45
2 changed files with 18 additions and 3 deletions
  1. +10
    -2
      parser/common/acl_graph_parser_util.cc
  2. +8
    -1
      parser/common/parser_api.cc

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

@@ -220,11 +220,19 @@ 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;
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) {
(void)OpRegistrationTbe::Instance()->Finalize(reg_data, false);
domi::OpRegistry::Instance()->Register(reg_data);
if (std::to_string(reg_data.GetFrameworkType()) == fmk_type) {
(void)OpRegistrationTbe::Instance()->Finalize(reg_data, false);
(void)domi::OpRegistry::Instance()->Register(reg_data);
}
} }


// set init status // set init status


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

@@ -38,10 +38,17 @@ Status ParserInitialize(const std::map<std::string, std::string> &options) {
// load custom op plugin // load custom op plugin
TBEPluginLoader::Instance().LoadPluginSo(options); TBEPluginLoader::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;
}
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) {
(void)OpRegistrationTbe::Instance()->Finalize(reg_data, true);
if (std::to_string(reg_data.GetFrameworkType()) == fmk_type) {
(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);


Loading…
Cancel
Save