!44 Synchronize latest Ascend software suite 16 Jul 2020

Merge pull request !44 from yanghaoran/master
pull/44/MERGE
mindspore-ci-bot 5 years ago committed by Gitee
commit 5464ca134f

@ -204,9 +204,6 @@ const std::string SAVE_ORIGINAL_MODEL = "ge.saveOriginalModel";
// Save original model file name // Save original model file name
const std::string ORIGINAL_MODEL_FILE = "ge.originalModelFile"; const std::string ORIGINAL_MODEL_FILE = "ge.originalModelFile";
// FE enable quant optimize
const std::string QUANT_OPTIMIZE = "ge.quantOptimize";
const char *const OPTION_GE_MAX_DUMP_FILE_NUM = "ge.maxDumpFileNum"; const char *const OPTION_GE_MAX_DUMP_FILE_NUM = "ge.maxDumpFileNum";
const char *const OPTION_GE_MAX_DUMP_FILE_SIZE = "ge.maxDumpFileSize"; const char *const OPTION_GE_MAX_DUMP_FILE_SIZE = "ge.maxDumpFileSize";
const char *const OPTION_GE_MAX_DUMP_OP_NUM = "ge.maxDumpOpNum"; const char *const OPTION_GE_MAX_DUMP_OP_NUM = "ge.maxDumpOpNum";
@ -274,7 +271,6 @@ static const char *const ENABLE_SINGLE_STREAM = ge::ENABLE_SINGLE_STREAM;
static const char *const AICORE_NUM = ge::AICORE_NUM.c_str(); static const char *const AICORE_NUM = ge::AICORE_NUM.c_str();
static const char *const FUSION_SWITCH_FILE = ge::FUSION_SWITCH_FILE.c_str(); static const char *const FUSION_SWITCH_FILE = ge::FUSION_SWITCH_FILE.c_str();
static const char *const ENABLE_SMALL_CHANNEL = ge::ENABLE_SMALL_CHANNEL.c_str(); static const char *const ENABLE_SMALL_CHANNEL = ge::ENABLE_SMALL_CHANNEL.c_str();
static const char *const QUANT_OPTIMIZE = ge::QUANT_OPTIMIZE.c_str();
static const char *const OP_SELECT_IMPL_MODE = ge::OP_SELECT_IMPL_MODE.c_str(); static const char *const OP_SELECT_IMPL_MODE = ge::OP_SELECT_IMPL_MODE.c_str();
static const char *const OUTPUT_TYPE = ge::OUTPUT_DATATYPE.c_str(); static const char *const OUTPUT_TYPE = ge::OUTPUT_DATATYPE.c_str();
static const char *const BUFFER_OPTIMIZE = ge::BUFFER_OPTIMIZE.c_str(); static const char *const BUFFER_OPTIMIZE = ge::BUFFER_OPTIMIZE.c_str();
@ -304,7 +300,6 @@ const std::set<std::string> global_options = {CORE_TYPE,
AICORE_NUM, AICORE_NUM,
FUSION_SWITCH_FILE, FUSION_SWITCH_FILE,
ENABLE_SMALL_CHANNEL, ENABLE_SMALL_CHANNEL,
QUANT_OPTIMIZE,
OP_SELECT_IMPL_MODE, OP_SELECT_IMPL_MODE,
OPTYPELIST_FOR_IMPLMODE}; OPTYPELIST_FOR_IMPLMODE};
} // namespace ir_option } // namespace ir_option

@ -43,6 +43,7 @@
#define DYNAMIC_INPUT_TD_NUM(name) ("__dynamic_input_" + name + "_cnt") #define DYNAMIC_INPUT_TD_NUM(name) ("__dynamic_input_" + name + "_cnt")
namespace ge { namespace ge {
class Operator;
class OperatorImpl; class OperatorImpl;
class NamedAttrs; class NamedAttrs;
class Graph; class Graph;
@ -50,6 +51,7 @@ class AttrValue;
using SubgraphBuilder = std::function<Graph()>; using SubgraphBuilder = std::function<Graph()>;
using OperatorImplPtr = std::shared_ptr<OperatorImpl>; using OperatorImplPtr = std::shared_ptr<OperatorImpl>;
using OperatorPtr = std::shared_ptr<Operator>;
class OpIO; class OpIO;
using OutHandler = std::shared_ptr<OpIO>; using OutHandler = std::shared_ptr<OpIO>;

@ -67,6 +67,7 @@ using google::protobuf::Message;
class OpRegistrationDataImpl; class OpRegistrationDataImpl;
using ParseParamFunc = std::function<domi::Status(const google::protobuf::Message *, ge::Operator &)>; using ParseParamFunc = std::function<domi::Status(const google::protobuf::Message *, ge::Operator &)>;
using ParseParamByOpFunc = std::function<domi::Status(const ge::Operator &, ge::Operator &)>;
using FusionParseParamFunc = using FusionParseParamFunc =
std::function<domi::Status(const std::vector<const google::protobuf::Message *>, ge::Operator &)>; std::function<domi::Status(const std::vector<const google::protobuf::Message *>, ge::Operator &)>;
using ParseSubgraphFunc = std::function<Status(const std::string &subgraph_name, const ge::Graph &graph)>; using ParseSubgraphFunc = std::function<Status(const std::string &subgraph_name, const ge::Graph &graph)>;
@ -85,6 +86,8 @@ class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY OpRegistrationData {
OpRegistrationData &ParseParamsFn(const ParseParamFunc &parseParamFn); OpRegistrationData &ParseParamsFn(const ParseParamFunc &parseParamFn);
OpRegistrationData &ParseParamsByOperatorFn(const ParseParamByOpFunc &parse_param_by_op_fn);
OpRegistrationData &FusionParseParamsFn(const FusionParseParamFunc &fusionParseParamFn); OpRegistrationData &FusionParseParamsFn(const FusionParseParamFunc &fusionParseParamFn);
OpRegistrationData &ParseSubgraphPostFn(const ParseSubgraphFunc &subgraph_post_fn); OpRegistrationData &ParseSubgraphPostFn(const ParseSubgraphFunc &subgraph_post_fn);
@ -100,6 +103,7 @@ class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY OpRegistrationData {
std::set<std::string> GetOriginOpTypeSet() const; std::set<std::string> GetOriginOpTypeSet() const;
domi::FrameworkType GetFrameworkType() const; domi::FrameworkType GetFrameworkType() const;
ParseParamFunc GetParseParamFn() const; ParseParamFunc GetParseParamFn() const;
ParseParamByOpFunc GetParseParamByOperatorFn() const;
FusionParseParamFunc GetFusionParseParamFn() const; FusionParseParamFunc GetFusionParseParamFn() const;
ParseSubgraphFunc GetParseSubgraphPostFn() const; ParseSubgraphFunc GetParseSubgraphPostFn() const;

@ -183,6 +183,7 @@ struct ModelData {
uint32_t model_len = 0; // Model binary data length uint32_t model_len = 0; // Model binary data length
int32_t priority = 0; // Model priority int32_t priority = 0; // Model priority
std::string key; // Key path for encrypt model, Empty for unencrypt std::string key; // Key path for encrypt model, Empty for unencrypt
std::string om_name; // om file name, used for data dump
}; };
// The definition of Model information // The definition of Model information

@ -46,6 +46,8 @@ class ModelHelper {
static Status TransModelToGeModel(const ModelPtr& model, GeModelPtr& ge_model); static Status TransModelToGeModel(const ModelPtr& model, GeModelPtr& ge_model);
static Status TransGeModelToModel(const GeModelPtr& geModelPtr, ModelPtr& modelPtr); static Status TransGeModelToModel(const GeModelPtr& geModelPtr, ModelPtr& modelPtr);
Status GetBaseNameFromFileName(const std::string& file_name, std::string& base_name);
Status GetModelNameFromMergedGraphName(const std::string& graph_name, std::string& model_name);
private: private:
bool is_assign_model_ = false; bool is_assign_model_ = false;

@ -28,21 +28,16 @@
namespace ge { namespace ge {
namespace model_runner { namespace model_runner {
class RuntimeModel; class RuntimeModel;
using RuntimeInfo = std::tuple<uint32_t, uint32_t, void *>;
class ModelRunner { class ModelRunner {
public: public:
static ModelRunner &Instance(); static ModelRunner &Instance();
bool LoadDavinciModel(uint32_t device_id, uint64_t session_id, uint32_t model_id, bool LoadDavinciModel(uint32_t device_id, uint64_t session_id, uint32_t model_id,
std::shared_ptr<DavinciModel> davinci_model, std::shared_ptr<ModelListener> listener); std::shared_ptr<DavinciModel> davinci_model, std::shared_ptr<ModelListener> listener);
bool LoadModelComplete(uint32_t model_id);
const std::vector<uint32_t> &GetTaskIdList(uint32_t model_id) const; const std::vector<uint32_t> &GetTaskIdList(uint32_t model_id) const;
const std::vector<uint32_t> &GetStreamIdList(uint32_t model_id) const;
const std::map<std::string, std::shared_ptr<RuntimeInfo>> &GetRuntimeInfoMap(uint32_t model_id) const;
bool UnloadModel(uint32_t model_id); bool UnloadModel(uint32_t model_id);
bool RunModel(uint32_t model_id, const InputData &input_data, OutputData *output_data); bool RunModel(uint32_t model_id, const InputData &input_data, OutputData *output_data);

File diff suppressed because it is too large Load Diff

@ -181,6 +181,8 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string ATTR_NAM
GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string ATTR_NAME_STREAM_CYCLE_EVENT_FLAG; GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string ATTR_NAME_STREAM_CYCLE_EVENT_FLAG;
GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string ATTR_NAME_DYNAMIC_OUTPUT_DIMS; GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string ATTR_NAME_DYNAMIC_OUTPUT_DIMS;
GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string ATTR_NAME_INPUT_ORIGIN_SIZE;
// to be deleted // to be deleted
GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string ATTR_TO_BE_DELETED; GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string ATTR_TO_BE_DELETED;
GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string PERMUTE_RESHAPE_FUSION; GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string PERMUTE_RESHAPE_FUSION;

@ -154,6 +154,7 @@ const std::string ATTR_NAME_RTSWITCH_RECV_EVENT_ID = "rtswitch_event_id";
const std::string ATTR_NAME_AUTOMIC_ADD_START = "automic_add_addr_start"; const std::string ATTR_NAME_AUTOMIC_ADD_START = "automic_add_addr_start";
const std::string ATTR_NAME_AUTOMIC_ADD_MEM_SIZE = "automic_add_mem_size"; const std::string ATTR_NAME_AUTOMIC_ADD_MEM_SIZE = "automic_add_mem_size";
const std::string ATTR_NAME_DYNAMIC_OUTPUT_DIMS = "_dynamic_output_dims"; const std::string ATTR_NAME_DYNAMIC_OUTPUT_DIMS = "_dynamic_output_dims";
const std::string ATTR_NAME_INPUT_ORIGIN_SIZE = "input_origin_size";
// To be deleted // To be deleted
const std::string ATTR_TO_BE_DELETED = "to_be_deleted"; const std::string ATTR_TO_BE_DELETED = "to_be_deleted";

@ -759,6 +759,7 @@ graphStatus Node::Verify() const {
GELOGW("Verify UpdateOutputName failed"); GELOGW("Verify UpdateOutputName failed");
} }
} }
node_op.BreakConnect();
} }
if (op_->CommonVerify() == GRAPH_SUCCESS) { if (op_->CommonVerify() == GRAPH_SUCCESS) {

@ -818,7 +818,9 @@ graphStatus OpDesc::InferShapeAndType() {
} }
} }
Operator op_proxy = ge::OpDescUtils::CreateOperatorFromOpDesc(shared_from_this()); Operator op_proxy = ge::OpDescUtils::CreateOperatorFromOpDesc(shared_from_this());
return (graphStatus)infer_func_(op_proxy); graphStatus ret = (graphStatus)infer_func_(op_proxy);
op_proxy.BreakConnect();
return ret;
} }
graphStatus OpDesc::DefaultInferFormat() { graphStatus OpDesc::DefaultInferFormat() {
@ -863,12 +865,14 @@ graphStatus OpDesc::DefaultInferFormat() {
} }
graphStatus OpDesc::OpVerify() { graphStatus OpDesc::OpVerify() {
Operator op_proxy = ge::OpDescUtils::CreateOperatorFromOpDesc(shared_from_this());
if (verifier_func_ == nullptr) { if (verifier_func_ == nullptr) {
verifier_func_ = OperatorFactoryImpl::GetVerifyFunc(GetType()); verifier_func_ = OperatorFactoryImpl::GetVerifyFunc(GetType());
} }
if (verifier_func_ != nullptr) { if (verifier_func_ != nullptr) {
return (graphStatus)verifier_func_(op_proxy); Operator op_proxy = ge::OpDescUtils::CreateOperatorFromOpDesc(shared_from_this());
graphStatus ret = (graphStatus)verifier_func_(op_proxy);
op_proxy.BreakConnect();
return ret;
} }
return GRAPH_SUCCESS; return GRAPH_SUCCESS;
} }

@ -931,7 +931,7 @@ OperatorImplPtr Operator::GetOperatorImplPtr() const { return operator_impl_; }
void Operator::BreakConnect() const { void Operator::BreakConnect() const {
if (operator_impl_ == nullptr) { if (operator_impl_ == nullptr) {
GELOGE(GRAPH_FAILED, "operator impl is nullptr."); GELOGW("operator impl is nullptr.");
return; return;
} }
operator_impl_->ClearInputLinks(); operator_impl_->ClearInputLinks();
@ -1318,6 +1318,8 @@ class GraphBuilderImpl {
string type = src_op_impl->op_desc_->GetType(); string type = src_op_impl->op_desc_->GetType();
auto node_op = ge::OperatorFactory::CreateOperator("node_op", type); auto node_op = ge::OperatorFactory::CreateOperator("node_op", type);
auto tensor_desc = ge::OpDescUtils::GetOpDescFromOperator(node_op); auto tensor_desc = ge::OpDescUtils::GetOpDescFromOperator(node_op);
node_op.BreakConnect();
GE_CHK_BOOL_EXEC(tensor_desc != nullptr, continue, "tensor_desc is null."); GE_CHK_BOOL_EXEC(tensor_desc != nullptr, continue, "tensor_desc is null.");
if ((tensor_desc->GetInputsSize() == 0 && tensor_desc->GetOutputsSize() > 0) || type == DATA || if ((tensor_desc->GetInputsSize() == 0 && tensor_desc->GetOutputsSize() > 0) || type == DATA ||
type == VARIABLE || type == INITDATA || type == GETNEXT) { type == VARIABLE || type == INITDATA || type == GETNEXT) {

@ -235,6 +235,7 @@ graphStatus ShapeRefiner::InferShapeAndType(const ConstNodePtr &node, Operator &
GELOGD("get op from OperatorFactory success. opType: %s", op_type.c_str()); GELOGD("get op from OperatorFactory success. opType: %s", op_type.c_str());
auto temp_op_desc = ge::OpDescUtils::GetOpDescFromOperator(node_op); auto temp_op_desc = ge::OpDescUtils::GetOpDescFromOperator(node_op);
node_op.BreakConnect();
if (temp_op_desc == nullptr) { if (temp_op_desc == nullptr) {
GELOGE(GRAPH_FAILED, "temp op desc is null"); GELOGE(GRAPH_FAILED, "temp op desc is null");
return GRAPH_FAILED; return GRAPH_FAILED;

@ -187,12 +187,9 @@ void TBEPluginManager::LoadCustomOpLib() {
std::vector<OpRegistrationData> registration_datas = domi::OpRegistry::Instance()->registrationDatas; std::vector<OpRegistrationData> registration_datas = domi::OpRegistry::Instance()->registrationDatas;
GELOGI("The size of registration_datas is: %zu", registration_datas.size()); GELOGI("The size of registration_datas is: %zu", registration_datas.size());
for (OpRegistrationData reg_data : registration_datas) { for (OpRegistrationData reg_data : registration_datas) {
bool ret = CheckRegisterStatus(reg_data); GELOGD("Begin to register optype: %s, imply_type: %u", reg_data.GetOmOptype().c_str(),
if (ret) { static_cast<uint32_t>(reg_data.GetImplyType()));
GELOGD("Begin to register optype: %s, imply_type: %u", reg_data.GetOmOptype().c_str(), domi::OpRegistry::Instance()->Register(reg_data);
static_cast<uint32_t>(reg_data.GetImplyType()));
domi::OpRegistry::Instance()->Register(reg_data);
}
} }
} }
@ -230,31 +227,6 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void TBEPluginManager::LoadPlug
} }
} }
bool TBEPluginManager::CheckRegisterStatus(const OpRegistrationData &reg_data) {
bool ret = true;
static char *parser_priority = std::getenv("PARSER_PRIORITY");
static bool keep_cce = parser_priority != nullptr && string(parser_priority) == "cce";
auto ori_optype_set = reg_data.GetOriginOpTypeSet();
for (const auto &op_type : ori_optype_set) {
domi::ImplyType imply_type = domi::OpRegistry::Instance()->GetImplyTypeByOriOpType(op_type);
GELOGD("Enter into reg_data loop. op_type = %s , om_optype_ = %s", op_type.c_str(), reg_data.GetOmOptype().c_str());
if (imply_type != domi::ImplyType::BUILDIN) {
if ((keep_cce && reg_data.GetImplyType() != domi::ImplyType::CCE) ||
(!keep_cce && reg_data.GetImplyType() != domi::ImplyType::TVM)) {
GELOGD("op_type[%s] does not need to be changed, om_optype:%s.", op_type.c_str(),
reg_data.GetOmOptype().c_str());
ret = false;
} else {
GELOGI("op_type[%s] will be changed to om_optype:%s.", op_type.c_str(), reg_data.GetOmOptype().c_str());
}
} else {
GELOGD("First register in ge initialize, original type: %s, om_optype: %s, imply type: %d.", op_type.c_str(),
reg_data.GetOmOptype().c_str(), static_cast<int>(reg_data.GetImplyType()));
}
}
return ret;
}
Status TBEPluginManager::CheckCustomAiCpuOpLib() { Status TBEPluginManager::CheckCustomAiCpuOpLib() {
std::vector<std::string> vec_op_type; std::vector<std::string> vec_op_type;

@ -63,7 +63,6 @@ class TBEPluginManager {
static void GetCustomOpPath(std::string &customop_path); static void GetCustomOpPath(std::string &customop_path);
void LoadCustomOpLib(); void LoadCustomOpLib();
static Status CheckCustomAiCpuOpLib(); static Status CheckCustomAiCpuOpLib();
static bool CheckRegisterStatus(const OpRegistrationData &reg_data);
SoHandlesVec handles_vec_; SoHandlesVec handles_vec_;
static std::map<string, string> options_; static std::map<string, string> options_;

@ -184,7 +184,8 @@ ModelHelper::SaveOriginalGraphToOmModel(const ge::Graph &graph, const std::strin
// Model // Model
ModelPtr model_ptr = ge::MakeShared<ge::Model>(); ModelPtr model_ptr = ge::MakeShared<ge::Model>();
GE_CHECK_NOTNULL_EXEC(model_ptr, return MEMALLOC_FAILED); GE_CHECK_NOTNULL_EXEC(model_ptr, return MEMALLOC_FAILED);
model_ptr->SetName(compute_graph->GetName()); std::string original_model_name = compute_graph->GetName() + "_original";
model_ptr->SetName(original_model_name);
model_ptr->SetGraph(graph); model_ptr->SetGraph(graph);
model_ptr->SetVersion(static_cast<uint32_t>(OM_PROTO_VERSION)); model_ptr->SetVersion(static_cast<uint32_t>(OM_PROTO_VERSION));
string framework_version; string framework_version;
@ -504,4 +505,36 @@ Status ModelHelper::ReleaseLocalModelData() noexcept {
} }
return result; return result;
} }
FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelHelper::GetBaseNameFromFileName(const string &file_name,
string &base_name) {
GELOGD("Get base_name from file, file_name:%s", file_name.c_str());
GE_CHK_BOOL_EXEC_WARN(!file_name.empty(), return FAILED, "File path may not valid, check params --output");
size_t start_position = 0;
// using output as base_name (ignore ".om")
size_t filename_suffixes = 3;
if (file_name.find_last_of('/') != string::npos) {
start_position = file_name.find_last_of('/') + 1;
}
size_t end_position = file_name.length() - filename_suffixes;
base_name = file_name.substr(start_position, end_position - start_position);
GE_CHK_BOOL_EXEC_WARN(!base_name.empty(), return FAILED, "Get base_name failed, check params --output");
return SUCCESS;
}
FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status
ModelHelper::GetModelNameFromMergedGraphName(const string &graph_name, string &model_name) {
GELOGD("Get model_name from graph_name, graph_name:%s", graph_name.c_str());
// this can only be used after merged graph(graph name will be append with "_x", x is index);
GE_CHK_BOOL_EXEC_WARN(!graph_name.empty(), return FAILED, "File path may not valid, check params --output");
size_t start_position = 0;
size_t end_position = graph_name.length();
// using graph as model_name (ignore "_x", x is the index of graph)
if (graph_name.find_last_of('_') != string::npos) {
end_position = graph_name.find_last_of('_');
}
model_name = graph_name.substr(start_position, end_position);
GE_CHK_BOOL_EXEC_WARN(!model_name.empty(), return FAILED, "Get model_name failed, check params --output");
return SUCCESS;
}
} // namespace ge } // namespace ge

@ -15,7 +15,7 @@
*/ */
#include "common/model_parser/base.h" #include "common/model_parser/base.h"
#include "common/helper/model_helper.h"
#include <securec.h> #include <securec.h>
#include <sys/sysinfo.h> #include <sys/sysinfo.h>
#include <fstream> #include <fstream>
@ -61,7 +61,8 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelParserBase::LoadFro
// read data as a block: // read data as a block:
(void)fs.read(data, len); (void)fs.read(data, len);
ModelHelper model_helper;
model_helper.GetBaseNameFromFileName(model_path, model_data.om_name);
// Set the model data parameter // Set the model data parameter
model_data.model_data = data; model_data.model_data = data;
model_data.model_len = len; model_data.model_len = len;

@ -292,6 +292,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ge::Status ProfilingManager::St
GELOGW("ProfMgrStartUp failed."); GELOGW("ProfMgrStartUp failed.");
return FAILED; return FAILED;
} }
GELOGD("StartProfiling, prof_handle: %p", prof_handle);
prof_handle_vec_.push_back(prof_handle); prof_handle_vec_.push_back(prof_handle);
} }
#endif #endif
@ -314,8 +315,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::StopProf
for (size_t i = 0; i < prof_handle_vec_.size(); ++i) { for (size_t i = 0; i < prof_handle_vec_.size(); ++i) {
int result = ProfMgrStop(prof_handle_vec_[i]); int result = ProfMgrStop(prof_handle_vec_[i]);
if (result != 0) { if (result != 0) {
GELOGW("ProfMgr stop return fail:%d.", result); GELOGW("ProfMgr stop return fail:%d, handle:%p", result, prof_handle_vec_[i]);
return;
} }
} }
vector<void *>().swap(prof_handle_vec_); vector<void *>().swap(prof_handle_vec_);

@ -208,6 +208,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY std::set<std::string> Propertie
} }
FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool PropertiesManager::IsLayerNeedDump(const std::string &model, FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool PropertiesManager::IsLayerNeedDump(const std::string &model,
const std::string &om_name,
const std::string &op_name) { const std::string &op_name) {
std::lock_guard<std::mutex> lock(dump_mutex_); std::lock_guard<std::mutex> lock(dump_mutex_);
// if dump all // if dump all
@ -216,9 +217,11 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool PropertiesManager::IsLayer
} }
// if this model need dump // if this model need dump
auto model_iter = model_dump_properties_map_.find(model); auto om_name_iter = model_dump_properties_map_.find(om_name);
if (model_iter != model_dump_properties_map_.end()) { auto model_name_iter = model_dump_properties_map_.find(model);
if (om_name_iter != model_dump_properties_map_.end() || model_name_iter != model_dump_properties_map_.end()) {
// if no dump layer info, dump all layer in this model // if no dump layer info, dump all layer in this model
auto model_iter = om_name_iter != model_dump_properties_map_.end() ? om_name_iter : model_name_iter;
if (model_iter->second.empty()) { if (model_iter->second.empty()) {
return true; return true;
} }

@ -84,7 +84,7 @@ class PropertiesManager {
void AddDumpPropertyValue(const std::string &model, const std::set<std::string> &layers); void AddDumpPropertyValue(const std::string &model, const std::set<std::string> &layers);
std::set<std::string> GetAllDumpModel(); std::set<std::string> GetAllDumpModel();
std::set<std::string> GetDumpPropertyValue(const std::string &model); std::set<std::string> GetDumpPropertyValue(const std::string &model);
bool IsLayerNeedDump(const std::string &model, const std::string &op_name); bool IsLayerNeedDump(const std::string &model, const std::string &om_name, const std::string &op_name);
void DeleteDumpPropertyValue(const std::string &model); void DeleteDumpPropertyValue(const std::string &model);
void ClearDumpPropertyValue(); void ClearDumpPropertyValue();
bool QueryModelDumpStatus(const std::string &model); bool QueryModelDumpStatus(const std::string &model);

@ -641,7 +641,6 @@ Status GeExecutor::LoadDataFromFile(const std::string &path, ModelData &model_da
model_data.model_data = nullptr; model_data.model_data = nullptr;
} }
} }
return ret; return ret;
} }

@ -131,6 +131,7 @@ Status HostCpuEngine::RunInternal(const ge::OpDescPtr &op_desc, HostCpuOp &op_ke
GELOGE(FAILED, "Failed to compute host cpu op. node = %s, ret = %u", op_desc->GetName().c_str(), ret); GELOGE(FAILED, "Failed to compute host cpu op. node = %s, ret = %u", op_desc->GetName().c_str(), ret);
return FAILED; return FAILED;
} }
op.BreakConnect();
return SUCCESS; return SUCCESS;
} }

@ -407,7 +407,6 @@ LOCAL_CFLAGS += -DFMK_SUPPORT_DUMP -DDAVINCI_SUPPORT_PROFILING -DDAVINCI_CLOUD
LOCAL_CFLAGS += -g -O0 LOCAL_CFLAGS += -g -O0
LOCAL_C_INCLUDES := $(RUNNER_LOCAL_C_INCLUDES) LOCAL_C_INCLUDES := $(RUNNER_LOCAL_C_INCLUDES)
LOCAL_SRC_FILES := $(LIBGE_LOCAL_SRC_FILES) LOCAL_SRC_FILES := $(LIBGE_LOCAL_SRC_FILES)
LOCAL_SRC_FILES += $(LIBCLIENT_LOCAL_SRC_FILES) LOCAL_SRC_FILES += $(LIBCLIENT_LOCAL_SRC_FILES)

@ -49,15 +49,6 @@ bool ModelRunner::LoadDavinciModel(uint32_t device_id, uint64_t session_id, uint
return true; return true;
} }
bool ModelRunner::LoadModelComplete(uint32_t model_id) {
auto model_iter = runtime_models_.find(model_id);
if (model_iter == runtime_models_.end()) {
GELOGE(PARAM_INVALID, "Model id %u not found.", model_id);
return false;
}
return model_iter->second->LoadComplete();
}
const std::vector<uint32_t> &ModelRunner::GetTaskIdList(uint32_t model_id) const { const std::vector<uint32_t> &ModelRunner::GetTaskIdList(uint32_t model_id) const {
auto model_iter = runtime_models_.find(model_id); auto model_iter = runtime_models_.find(model_id);
if (model_iter == runtime_models_.end()) { if (model_iter == runtime_models_.end()) {
@ -69,28 +60,6 @@ const std::vector<uint32_t> &ModelRunner::GetTaskIdList(uint32_t model_id) const
return model_iter->second->GetTaskIdList(); return model_iter->second->GetTaskIdList();
} }
const std::vector<uint32_t> &ModelRunner::GetStreamIdList(uint32_t model_id) const {
auto model_iter = runtime_models_.find(model_id);
if (model_iter == runtime_models_.end()) {
GELOGE(PARAM_INVALID, "Model id %u not found.", model_id);
static const std::vector<uint32_t> empty_ret;
return empty_ret;
}
return model_iter->second->GetStreamIdList();
}
const std::map<std::string, std::shared_ptr<RuntimeInfo>> &ModelRunner::GetRuntimeInfoMap(uint32_t model_id) const {
auto model_iter = runtime_models_.find(model_id);
if (model_iter == runtime_models_.end()) {
GELOGW("Model id %u not found.", model_id);
static const std::map<std::string, std::shared_ptr<RuntimeInfo>> empty_ret;
return empty_ret;
}
return model_iter->second->GetRuntimeInfoMap();
}
bool ModelRunner::UnloadModel(uint32_t model_id) { bool ModelRunner::UnloadModel(uint32_t model_id) {
auto iter = runtime_models_.find(model_id); auto iter = runtime_models_.find(model_id);
if (iter != runtime_models_.end()) { if (iter != runtime_models_.end()) {

@ -76,7 +76,7 @@ bool Output::CopyRslt(OutputData *rslt, uint32_t data_begin, uint32_t &data_inde
DataBuffer data_buf = rslt->blobs[data_begin + data_count]; DataBuffer data_buf = rslt->blobs[data_begin + data_count];
bool ret = SetDataBuf(data_buf, data_begin, data_count, i, support_mem_share); bool ret = SetDataBuf(data_buf, data_begin, data_count, i, support_mem_share);
if (!ret) { if (!ret) {
GELOGE(FAILED, "Copy data to host error. index: %lu, addr: %p", i, v_input_data_addr_[i]); GELOGE(FAILED, "Copy data to host failed. index: %lu, addr: %p", i, v_input_data_addr_[i]);
return ret; return ret;
} }
data_index = data_begin + data_count; data_index = data_begin + data_count;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save