!32009 Ascend710 offline convert mindir models to "nhwc" ms

Merge pull request !32009 from chenping/model_zoo
This commit is contained in:
i-robot 2022-03-28 08:42:44 +00:00 committed by Gitee
commit 19a9372190
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 10 additions and 9 deletions

View File

@ -52,6 +52,7 @@ char *RuntimeConvert(const char *model_buf, const size_t &buf_size, size_t *size
}
}
}
flag->aclModelOptionCfgParam.offline = false;
flag->aclModelOptionCfgParam.device_id = ascend_info->GetDeviceID();
flag->aclModelOptionCfgParam.output_type = ascend_info->GetOutputType();
flag->aclModelOptionCfgParam.input_shape_map = ascend_info->GetInputShapeMap();

View File

@ -9,10 +9,6 @@ include_directories(${TOP_DIR}/graphengine/third_party/fwkacllib/inc/aicpu)
include_directories(${TOP_DIR}/graphengine/third_party/fwkacllib/inc/toolchain)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
if(MSLITE_ENABLE_RUNTIME_CONVERT)
add_compile_definitions(ENABLE_ONLINE_MODEL_INFER)
endif()
file(GLOB ACL_SRC
${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc
${CMAKE_CURRENT_SOURCE_DIR}/common/*.cc

View File

@ -26,6 +26,7 @@ namespace mindspore {
namespace lite {
namespace acl {
struct AclModelOptionCfg {
bool offline;
int32_t device_id = 0;
DataType output_type;
std::vector<size_t> dynamic_batch_size;

View File

@ -155,10 +155,10 @@ STATUS AclPassImpl::PreProcGraph(const FuncGraphPtr &func_graph) {
}
STATUS AclPassImpl::PostProcGraph(const FuncGraphPtr &func_graph) {
#ifdef ENABLE_ONLINE_MODEL_INFER
MS_LOG(DEBUG) << "Online model infer no need to change to nhwc format.";
return lite::RET_OK;
#endif
if (!user_options_cfg_.offline) {
MS_LOG(DEBUG) << "Online model infer no need to change to nhwc format.";
return lite::RET_OK;
}
if (fmk_type_ == converter::kFmkTypeTf) {
MS_LOG(DEBUG) << "Tf no need to change to nhwc format.";
return lite::RET_OK;

View File

@ -273,7 +273,10 @@ int Flags::InitExtendedIntegrationInfo(const lite::ConfigFileParser &config_file
return RET_OK;
}
void Flags::InitAclDefaultOption() { this->aclModelOptionCfgParam.om_file_path = this->outputFile; }
void Flags::InitAclDefaultOption() {
this->aclModelOptionCfgParam.om_file_path = this->outputFile;
this->aclModelOptionCfgParam.offline = true;
}
int Flags::InitConfigFile() {
lite::ConfigFileParser config_file_parser;