!32009 Ascend710 offline convert mindir models to "nhwc" ms
Merge pull request !32009 from chenping/model_zoo
This commit is contained in:
commit
19a9372190
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -155,10 +155,10 @@ STATUS AclPassImpl::PreProcGraph(const FuncGraphPtr &func_graph) {
|
|||
}
|
||||
|
||||
STATUS AclPassImpl::PostProcGraph(const FuncGraphPtr &func_graph) {
|
||||
#ifdef ENABLE_ONLINE_MODEL_INFER
|
||||
if (!user_options_cfg_.offline) {
|
||||
MS_LOG(DEBUG) << "Online model infer no need to change to nhwc format.";
|
||||
return lite::RET_OK;
|
||||
#endif
|
||||
}
|
||||
if (fmk_type_ == converter::kFmkTypeTf) {
|
||||
MS_LOG(DEBUG) << "Tf no need to change to nhwc format.";
|
||||
return lite::RET_OK;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue