!71 sync-code-from-trunk-0924

Merge pull request !71 from HW_KK/master
pull/71/MERGE
mindspore-ci-bot 4 years ago committed by Gitee
commit 86596e18ef

@ -0,0 +1,69 @@
/**
* Copyright 2019-2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef INC_EXTERNAL_GE_GE_PROF_H_
#define INC_EXTERNAL_GE_GE_PROF_H_
#include <map>
#include <string>
#include <vector>
#include "ge/ge_api_error_codes.h"
namespace ge {
enum ProfDataTypeConfig {
kProfAcl = 0x0001,
kProfTaskTime = 0x0002,
kProfAiCoreMetrics = 0x0004,
kProfAicpuTrace = 0x0008,
kProfModelExecute = 0x0010,
kProfRuntimeApi = 0x0020,
kProfRuntimeTrace = 0x0040,
kProfScheduleTimeline = 0x0080,
kProfScheduleTrace = 0x0100,
kProfAiVectorCoreMetrics = 0x0200,
kProfSubtaskTime = 0x0400,
kProfTrainingTrace = 0x0800,
kProfHcclTrace = 0x1000,
kProfDataProcess = 0x2000,
kProfTaskTrace = 0x3842,
kProfModelLoad = 0x8000000000000000
};
enum ProfilingAicoreMetrics {
kAicoreArithmaticThroughput = 0,
kAicorePipeline = 1,
kAicoreSynchronization = 2,
kAicoreMemory = 3,
kAicoreInternalMemory = 4,
kAicoreStall = 5,
kAicoreMetricsAll = 255 // only for op_trace
};
typedef struct ProfAicoreEvents ProfAicoreEvents;
typedef struct aclgrphProfConfig aclgrphProfConfig;
Status aclgrphProfInit(const char *profiler_path, uint32_t length);
Status aclgrphProfFinalize();
aclgrphProfConfig *aclgrphProfCreateConfig(uint32_t *deviceid_list, uint32_t device_nums,
ProfilingAicoreMetrics aicore_metrics, ProfAicoreEvents *aicore_events,
uint64_t data_type_config);
Status aclgrphProfDestroyConfig(aclgrphProfConfig *profiler_config);
Status aclgrphProfStart(aclgrphProfConfig *profiler_config);
Status aclgrphProfStop(aclgrphProfConfig *profiler_config);
} // namespace ge
#endif // INC_EXTERNAL_GE_GE_PROF_H_

@ -97,6 +97,7 @@ GE_ERRORNO_COMMON(INTERNAL_ERROR, 4, "Internal errors"); // 1343225
GE_ERRORNO_COMMON(CSEC_ERROR, 5, "Failed to call libc_sec API!"); // 1343225861
GE_ERRORNO_COMMON(TEE_ERROR, 6, "Failed to call tee API!"); // 1343225862
GE_ERRORNO_COMMON(END_OF_SEQUENCE, 7, "End of sequence!"); // 1343225863
GE_ERRORNO_COMMON(PATH_INVALID, 8, "Path is invalid!"); // 1343225864
// Error code for plugin manager
GE_ERRORNO_COMMON(GE_PLGMGR_PATH_INVALID, 30, "Path is invalid!"); // 1343225886
@ -127,6 +128,10 @@ GE_ERRORNO_CLIENT(GE_CLI_GE_NOT_INITIALIZED, 11, "GE is not yet initialized or i
GE_ERRORNO_INIT(GE_MULTI_INIT, 0, "Multiple initializations are not supported."); // 1343234048
GE_ERRORNO_INIT(GE_FINALIZE_NOT_INIT, 1, "Finalize is not allowed before initialization."); // 1343234049
GE_ERRORNO_INIT(GE_MULTI_FINALIZE, 2, "Multiple finalizations are not supported."); // 1343234050
GE_ERRORNO_INIT(GE_PROF_MULTI_INIT, 3, "Multiple profiling initializations are not supported."); // 1343234051
GE_ERRORNO_INIT(GE_PROF_NOT_INIT, 4, "Profing initializations have not been done."); // 1343234052
GE_ERRORNO_INIT(GE_PROF_MODE_CONFLICT, 5,
"Profiling command mode which is preferred is running, the api mode will not work."); // 1343234053
// Session module error code definition
GE_ERRORNO_SESSION(GE_SESS_INIT_FAILED, 0, "Failed to initialize session."); // 1343238144

@ -398,6 +398,24 @@ bool CheckOutputPathValid(const std::string &file_path, const std::string &atc_p
/// @param [out] result
///
bool ValidateStr(const std::string &filePath, const std::string &mode);
///
/// @ingroup domi_common
/// @brief Check whether the file is normal file.
/// @param [in] file_path file path
/// @param [out] result
///
bool IsValidFile(const char *file_path);
///
/// @ingroup domi_common
/// @brief Check path invalid
/// @param [in] path, path to be checked
/// @param [in] length, length of path
/// @return 0 success
/// @return -1 fail
///
Status CheckPath(const char *path, size_t length);
} // namespace ge
#endif // INC_FRAMEWORK_COMMON_UTIL_H_

@ -142,6 +142,7 @@ 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_INPUT_DIMS;
GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string ATTR_NAME_GRAPH_HAS_BEEN_ADDED;
GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string ATTR_NAME_SESSION_GRAPH_ID;
GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string ATTR_NAME_PARENT_GRAPH_NAME;

@ -658,7 +658,7 @@ ComputeGraph::UpdateOutputMapping(const std::map<uint32_t, uint32_t> &output_map
return GRAPH_FAILED;
}
size_t num = op_desc->GetInputsSize();
size_t num = op_desc->GetAllInputsSize();
for (size_t i = 0; i < num; i++) {
GeTensorDesc tensor = op_desc->GetInputDesc(i);
uint32_t cur_index = 0;

@ -149,9 +149,10 @@ graphStatus FormatRefiner::GetAnchorPoints(const ge::ComputeGraphPtr &graph, std
// consider special node save process
// get all input desc format
bool node_is_all_nd = false;
auto input_size = static_cast<uint32_t>(op_desc->GetInputsSize());
auto input_size = static_cast<uint32_t>(op_desc->GetAllInputsSize());
for (uint32_t i = 0; i < input_size; i++) {
// Operator pre-set format but not origin format
GE_IF_BOOL_EXEC(op_desc->MutableInputDesc(i) == nullptr, continue);
auto input_format = op_desc->MutableInputDesc(i)->GetFormat();
// Pre-save data node (only main graph data) and default infer fail
if (node_ptr->GetType() == DATA) {
@ -164,6 +165,7 @@ graphStatus FormatRefiner::GetAnchorPoints(const ge::ComputeGraphPtr &graph, std
// Get all output desc format
auto output_size = static_cast<uint32_t>(op_desc->GetOutputsSize());
for (uint32_t i = 0; i < output_size; i++) {
GE_IF_BOOL_EXEC(op_desc->MutableOutputDesc(i) == nullptr, continue);
auto output_format = op_desc->MutableOutputDesc(i)->GetFormat();
if (output_format != FORMAT_ND && output_format != FORMAT_RESERVED) {
node_is_all_nd = true;
@ -222,8 +224,9 @@ graphStatus FormatRefiner::BackInferProcess(std::deque<ge::NodePtr> &nodes, ge::
for (const auto &in_anchor : node->GetAllInDataAnchors()) {
GELOGD("Node is [%s] [B]", (node->GetName()).c_str());
auto in_data_anchor_idx = in_anchor->GetIdx();
auto to_be_set_format =
node->GetOpDesc()->MutableInputDesc(static_cast<uint32_t>(in_data_anchor_idx))->GetOriginFormat();
auto input_desc = node->GetOpDesc()->MutableInputDesc(static_cast<uint32_t>(in_data_anchor_idx));
GE_IF_BOOL_EXEC(input_desc == nullptr, continue);
auto to_be_set_format = input_desc->GetOriginFormat();
if (to_be_set_format == FORMAT_ND) {
GELOGD("Node [%s] [B], format is ND", (node->GetName()).c_str());
continue;

@ -123,6 +123,7 @@ const std::string ATTR_NAME_AIPP_OUTPUTS = "_aipp_outputs";
const std::string ATTR_NAME_INPUT_DIMS = "input_dims";
const std::string ATTR_NAME_GRAPH_HAS_BEEN_ADDED = "_graph_has_been_added";
const std::string ATTR_NAME_SESSION_GRAPH_ID = "_session_graph_id";
const std::string ATTR_NAME_PARENT_GRAPH_NAME = "_parent_graph_name";

@ -68,7 +68,7 @@ graphStatus Node::Init() {
return GRAPH_SUCCESS;
}
GE_CHK_BOOL_EXEC(op_ != nullptr, return GRAPH_FAILED, "original OpDesc is nullptr");
size_t size = op_->GetInputsSize();
size_t size = op_->GetAllInputsSize();
for (size_t i = 0; i < size; i++) {
std::shared_ptr<InDataAnchor> anchor = ComGraphMakeShared<InDataAnchor>(shared_from_this(), i);
if (anchor == nullptr) {
@ -305,13 +305,19 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus Node::AddLinkFrom(con
GELOGE(GRAPH_FAILED, "add input desc failed.");
return GRAPH_FAILED;
}
std::shared_ptr<InDataAnchor> anchor = ComGraphMakeShared<InDataAnchor>(shared_from_this(), in_data_anchors_.size());
if (index < GetAllInDataAnchors().size()) {
(void)out_anchors.at(0)->LinkTo(in_data_anchors_[index]);
} else {
std::shared_ptr<InDataAnchor> anchor =
ComGraphMakeShared<InDataAnchor>(shared_from_this(), in_data_anchors_.size());
if (anchor == nullptr) {
GELOGE(GRAPH_FAILED, "out_anchor size is:%zu, malloc shared_ptr failed.", out_anchors.size());
return GRAPH_FAILED;
}
in_data_anchors_.push_back(anchor);
(void)out_anchors.at(0)->LinkTo(in_data_anchors_.back());
}
return GRAPH_SUCCESS;
}
@ -347,20 +353,30 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus Node::AddLinkFrom(con
}
GE_CHECK_NOTNULL(op_);
auto op_desc = input_node->GetOpDesc();
GE_CHECK_NOTNULL(op_desc);
if (op_->AddInputDesc(name, op_desc->GetOutputDesc(0)) != GRAPH_SUCCESS) {
GELOGE(GRAPH_FAILED, "add input desc failed.");
auto input_op_desc = input_node->GetOpDesc();
GE_CHECK_NOTNULL(input_op_desc);
auto index = op_->GetInputIndexByName(name);
if (index != -1) {
if (index >= static_cast<int>(in_data_anchors_.size())) {
GELOGE(GRAPH_FAILED, "op %s get input name %s 's index %d is illegal.", op_->GetName().c_str(), name.c_str(),
index);
return GRAPH_FAILED;
}
std::shared_ptr<InDataAnchor> anchor = ComGraphMakeShared<InDataAnchor>(shared_from_this(), in_data_anchors_.size());
(void)out_anchors.at(0)->LinkTo(in_data_anchors_[index]);
} else {
std::shared_ptr<InDataAnchor> anchor =
ComGraphMakeShared<InDataAnchor>(shared_from_this(), in_data_anchors_.size());
if (anchor == nullptr) {
GELOGE(GRAPH_FAILED, "out_anchor size is:%zu, malloc shared_ptr failed.", out_anchors.size());
GELOGE(GRAPH_FAILED, "in_data_anchors_size is:%zu, malloc shared_ptr failed.", in_data_anchors_.size());
return GRAPH_FAILED;
}
in_data_anchors_.push_back(anchor);
(void)out_anchors.at(0)->LinkTo(in_data_anchors_.back());
}
if (op_->AddInputDesc(name, input_op_desc->GetOutputDesc(0)) != GRAPH_SUCCESS) {
GELOGE(GRAPH_FAILED, "add input desc failed.");
return GRAPH_FAILED;
}
return GRAPH_SUCCESS;
}

@ -675,7 +675,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY ConstGeTensorDescPtr OpDesc::GetI
return nullptr;
}
if (inputs_desc_[index]->IsValid() != GRAPH_SUCCESS) {
GELOGE(GRAPH_FAILED, "inputsDesc[%u] is InValid", index);
GELOGW("inputsDesc[%u] is InValid", index);
return nullptr;
} else {
return inputs_desc_[static_cast<size_t>(index)];

@ -1504,7 +1504,9 @@ class GraphBuilderImpl {
GE_CHK_BOOL_EXEC(dst_anchor != nullptr, return GRAPH_FAILED, "GetInDataAnchor failed.");
auto ret = GraphUtils::AddEdge(src_anchor, dst_anchor);
GE_CHK_BOOL_EXEC(ret == GRAPH_SUCCESS, return GRAPH_FAILED, "AddEdge failed.");
GE_CHK_BOOL_EXEC(ret == GRAPH_SUCCESS, return GRAPH_FAILED,
"from node[%s][%d] to node[%s][%d]AddEdge failed.", src_node_ptr->GetName().c_str(),
src_anchor->GetIdx(), dst_node_info->second->GetName().c_str(), dst_anchor->GetIdx());
}
}
auto out_control_anchor = src_node_ptr->GetOutControlAnchor();
@ -1536,19 +1538,23 @@ inline bool HasSameNameNode(const ComputeGraphPtr &compute_graph) {
for (const auto &graph : compute_graph->GetAllSubgraphs()) {
std::set<string> node_names;
for (auto const &node : graph->GetDirectNode()) {
node_names.insert(node->GetName());
}
if (node_names.size() != graph->GetDirectNodesSize()) {
auto result = node_names.insert(node->GetName());
if (!result.second) {
GELOGE(GRAPH_FAILED, "graph %s has same name node%s", graph->GetName().c_str(), node->GetName().c_str());
return true;
}
}
}
std::set<string> node_names;
for (auto const &node : compute_graph->GetDirectNode()) {
node_names.insert(node->GetName());
auto result = node_names.insert(node->GetName());
if (!result.second) {
GELOGE(GRAPH_FAILED, "graph %s has same name node%s", compute_graph->GetName().c_str(), node->GetName().c_str());
return true;
}
}
return node_names.size() != compute_graph->GetDirectNodesSize();
return false;
}
ComputeGraphPtr GraphUtils::CreateGraphFromOperator(const string &name, const vector<ge::Operator> &inputs) {

@ -51,6 +51,9 @@ graphStatus ReverseBrushWhileBodySubGraph(const ConstNodePtr &node) {
for (const auto &node_sub : sub_graph_body->GetAllNodes()) {
for (size_t i = 0; i < node_sub->GetAllInDataAnchorsSize(); i++) {
auto input_desc = node_sub->GetOpDesc()->MutableInputDesc(i);
GE_IF_BOOL_EXEC(input_desc == nullptr,
GELOGW("Get null input by index %zu from node %s ", i, node_sub->GetName().c_str());
continue);
(void)input_desc->SetUnknownDimNumShape();
}
for (size_t i = 0; i < node_sub->GetAllOutDataAnchorsSize(); i++) {
@ -376,10 +379,13 @@ graphStatus UpdateOpInputDesc(const ConstNodePtr &node_ptr) {
continue;
}
int peer_out_idx = peer_out_data_anchor->GetIdx();
auto in_desc = node_ptr->GetOpDesc()->MutableInputDesc(static_cast<uint32_t>(in_idx));
auto peer_out_desc = peer_out_data_node->GetOpDesc()->MutableOutputDesc(static_cast<uint32_t>(peer_out_idx));
// check shape and dtype continuity. do not stop process
auto in_desc = node_ptr->GetOpDesc()->MutableInputDesc(static_cast<uint32_t>(in_idx));
if (in_desc == nullptr) {
continue;
}
auto in_shape = in_desc->GetShape().GetDims();
auto in_dtype = in_desc->GetDataType();
auto peer_out_shape = peer_out_desc->GetShape().GetDims();

@ -264,11 +264,11 @@ void OnnxUtils::AddAttrProtoForOpInAndOutDesc(onnx::NodeProto *node_proto, const
return;
}
// Input describes
auto size_in = op_desc->GetInputsSize();
auto size_in = op_desc->GetAllInputsSize();
AddAttrProto(node_proto, onnx::AttributeProto_AttributeType_INT, "input_desc_nums", &size_in);
if (size_in > 0) {
for (uint32_t i = 0; i < size_in; i++) {
auto input_desc = op_desc->GetInputDescPtr(i);
auto input_desc = op_desc->GetInputDescPtrDfault(i);
if (input_desc != nullptr) {
auto data_type = TypeUtils::DataTypeToSerialString(input_desc->GetDataType());
AddAttrProto(node_proto, onnx::AttributeProto_AttributeType_STRING, "input_desc_dtype:" + std::to_string(i),
@ -480,9 +480,20 @@ void OnnxUtils::AddAttrProtoFromNodeMembers(const NodePtr &node, onnx::NodeProto
if (!recv_list.empty()) {
AddAttrProto(node_proto, onnx::AttributeProto_AttributeType_INTS, "recv_event_id_list", &recv_list);
}
// 2.Attributes added from node's op_(message OpDef)
auto op_desc = node->op_;
if (op_desc != nullptr) {
// for input_name_idx_ in opdesc
auto input_name_2_indexs = op_desc->GetAllInputName();
::google::protobuf::RepeatedPtrField<::std::string> input_names;
::google::protobuf::RepeatedField<::google::protobuf::int64> input_indexes;
for (const auto &input_name_2_index : input_name_2_indexs) {
std::string input_name = input_name_2_index.first;
input_names.Add(std::move(input_name));
input_indexes.Add(input_name_2_index.second);
}
AddAttrProto(node_proto, onnx::AttributeProto_AttributeType_STRINGS, "_input_name_key", input_names);
AddAttrProto(node_proto, onnx::AttributeProto_AttributeType_INTS, "_input_name_value", input_indexes);
// 2.Attributes added from node's op_(message OpDef)
// Input and out describes
AddAttrProtoForOpInAndOutDesc(node_proto, op_desc);
// Others

@ -1470,8 +1470,7 @@ graphStatus GraphUtils::CopyTensorAttrs(const OpDescPtr &dst_desc, const NodePtr
for (uint32_t i = 0; i < src_node->GetAllInDataAnchorsSize(); ++i) {
auto input_desc = dst_desc->MutableInputDesc(i);
if (input_desc == nullptr) {
GELOGE(GRAPH_FAILED, "Param dst node not valid");
return GRAPH_FAILED;
continue;
}
input_desc->CopyAttrsFrom(src_desc->GetInputDesc(i));
}

@ -513,7 +513,6 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY vector<GeTensorPtr> OpDescUtils::
}
return MutableWeights(*node);
}
GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus
OpDescUtils::SetWeights(ge::Node &node, const vector<ge::GeTensorPtr> &weights) {
GE_CHK_BOOL_EXEC(node.GetOpDesc() != nullptr, return GRAPH_PARAM_INVALID, "node.GetOpDesc is nullptr!");

@ -58,6 +58,7 @@ include_directories(${CMAKE_BINARY_DIR}/proto/ge)
# need to remove dependencies on pb files later
file(GLOB TRAIN_SRC_LIST RELATIVE ${CMAKE_CURRENT_LIST_DIR}
"analyzer/analyzer.cc"
"client/ge_prof.cc"
"client/ge_api.cc"
"common/dump/dump_manager.cc"
"common/dump/dump_properties.cc"
@ -225,6 +226,7 @@ target_link_libraries(ge_runner
${msprof}
${runtime}
${resouce}
${ascend_hal}
rt
dl)
@ -335,6 +337,7 @@ file(GLOB INFER_SRC_LIST RELATIVE ${CMAKE_CURRENT_LIST_DIR}
"host_kernels/unpack_kernel.cc"
"host_kernels/unsqueeze_kernel.cc"
"hybrid/hybrid_davinci_model_stub.cc"
"hybrid/node_executor/aicpu/aicpu_ext_info.cc"
"init/gelib.cc"
"ir_build/atc_ir_common.cc"
"ir_build/ge_ir_build.cc"

@ -101,7 +101,7 @@ Status Analyzer::BuildJsonObject(uint64_t session_id, uint64_t graph_id) {
ge::Status Analyzer::Initialize() {
ClearHistoryFile();
return CreateAnalyzerFile();
return SUCCESS;
}
void Analyzer::Finalize() {
@ -136,7 +136,7 @@ void Analyzer::DestroyGraphJsonObject(uint64_t session_id, uint64_t graph_id) {
} else {
auto iter1 = (iter->second).find(graph_id);
if (iter1 == (iter->second).end()) {
GELOGW("can not find the graph json object by session_id[%lu] and graph_id[%lu].Do nothing", session_id,
GELOGW("Can not find the graph json object by session_id[%lu] and graph_id[%lu]. Do nothing.", session_id,
graph_id);
}
(iter->second).erase(iter1);
@ -169,6 +169,10 @@ void Analyzer::ClearHistoryFile() {
}
ge::Status Analyzer::CreateAnalyzerFile() {
if (is_json_file_create_) {
GELOGD("analyzer file has been created!No necessary to create again!");
return SUCCESS;
}
GELOGD("start to create analyzer file!");
// Check whether the manifest exists, if not, create it.
string real_path = RealPath(kFilePath.c_str());
@ -176,18 +180,19 @@ ge::Status Analyzer::CreateAnalyzerFile() {
GELOGE(FAILED, "File path is invalid.");
return FAILED;
}
string file = real_path + "/" + kAnalyzeFile;
GELOGD("Created analyzer file:[%s]", file.c_str());
int fd = open(file.c_str(), O_WRONLY | O_CREAT | O_TRUNC, kFileAuthority);
std::lock_guard<std::mutex> lg(file_mutex_);
json_file_name_ = real_path + "/" + kAnalyzeFile;
GELOGD("Created analyzer file:[%s]", json_file_name_.c_str());
int fd = open(json_file_name_.c_str(), O_WRONLY | O_CREAT | O_TRUNC, kFileAuthority);
if (fd < 0) {
GELOGE(INTERNAL_ERROR, "Fail to open the file: %s.", file.c_str());
GELOGE(INTERNAL_ERROR, "Fail to open the file: %s.", json_file_name_.c_str());
return INTERNAL_ERROR;
}
if (close(fd) != 0) {
GELOGE(INTERNAL_ERROR, "Fail to close the file: %s.", file.c_str());
GELOGE(INTERNAL_ERROR, "Fail to close the file: %s.", json_file_name_.c_str());
return INTERNAL_ERROR;
}
json_file_name_ = file;
is_json_file_create_ = true;
GELOGD("success to create analyzer file[%s]!", json_file_name_.c_str());
return SUCCESS;
@ -231,6 +236,12 @@ ge::Status Analyzer::DoAnalyze(DataInfo &data_info) {
GELOGE(status, "save op info failed!");
return FAILED;
}
// create json file
status = CreateAnalyzerFile();
if (status != SUCCESS) {
GELOGE(status, "create analyzer file failed!");
return status;
}
// save data to file
return SaveAnalyzerDataToFile();
}

@ -24,6 +24,7 @@
#include <mutex>
#include <memory>
#include <fstream>
#include <atomic>
#include "external/ge/ge_api_types.h"
#include "graph/compute_graph.h"
@ -181,6 +182,7 @@ class Analyzer {
std::mutex file_mutex_; // protect json_file_
std::ofstream json_file_;
std::string json_file_name_;
std::atomic_bool is_json_file_create_{false};
};
} // namespace ge
#endif // DOMI_ANALYZER_ANANLYZER_H_

@ -29,6 +29,7 @@ file(GLOB PROTO_HEADER_LIST RELATIVE ${CMAKE_CURRENT_LIST_DIR}
file(GLOB SRC_LIST RELATIVE ${CMAKE_CURRENT_LIST_DIR}
"ge_api.cc"
"ge_prof.cc"
)
ge_protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_LIST})
@ -66,5 +67,6 @@ target_link_libraries(ge_client
${slog}
${mmpa}
${runtime}
${msprof}
rt
dl)

@ -39,7 +39,7 @@ using std::vector;
namespace {
const int32_t kMaxStrLen = 128;
}
} // namespace
static bool g_ge_initialized = false;
static std::mutex g_ge_release_mutex; // GEFinalize and ~Session use

File diff suppressed because it is too large Load Diff

@ -4,6 +4,7 @@ LOCAL_PATH := $(call my-dir)
COMMON_LOCAL_SRC_FILES := \
proto/ge_api.proto \
ge_api.cc \
ge_prof.cc \
COMMON_LOCAL_C_INCLUDES := \
@ -69,6 +70,8 @@ LOCAL_SHARED_LIBRARIES := \
libregister \
libge_compiler \
libge_common \
libmsprof
LOCAL_LDFLAGS := -lrt -ldl
@ -102,6 +105,7 @@ LOCAL_SHARED_LIBRARIES := \
libruntime \
libge_compiler \
libge_common \
libmsprof
LOCAL_LDFLAGS := -lrt -ldl

@ -27,6 +27,7 @@ file(GLOB SRC_LIST RELATIVE ${CMAKE_CURRENT_LIST_DIR}
"context/ctx.cc"
"cust_aicpu_kernel_store.cc"
"debug/memory_dumper.cc"
"dump/dump_properties.cc"
"fmk_error_codes.cc"
"formats/format_transfers/datatype_transfer.cc"
"formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc"

@ -49,7 +49,10 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status DumpManager::SetDumpConf
dump_properties_.ClearDumpPropertyValue();
return SUCCESS;
}
dump_properties_.SetDumpStatus(dump_status);
dump_op_switch = dump_config.dump_op_switch;
dump_properties_.SetDumpOpSwitch(dump_op_switch);
if (dump_op_switch == kDumpoff && dump_config.dump_list.empty()) {
GELOGE(PARAM_INVALID, "Dump list is invalid,dump_op_switch is %s", dump_op_switch.c_str());
return PARAM_INVALID;
@ -95,14 +98,6 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status DumpManager::SetDumpConf
return SUCCESS;
}
FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool DumpManager::IsDumpOpen() {
std::lock_guard<std::mutex> lock(mutex_);
if (!dump_properties_.GetDumpPath().empty()) {
return true;
}
return false;
}
FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY const DumpProperties &DumpManager::GetDumpProperties() {
std::lock_guard<std::mutex> lock(mutex_);
return dump_properties_;

@ -28,7 +28,6 @@ class DumpManager {
static DumpManager &GetInstance();
Status SetDumpConf(const DumpConfig &dump_config);
bool IsDumpOpen();
const DumpProperties &GetDumpProperties();
void SetModelName(const std::string &model_name);
const std::string &GetModelName();

@ -16,7 +16,6 @@
#include "common/dump/dump_op.h"
#include "aicpu/common/aicpu_task_struct.h"
#include "common/dump/dump_manager.h"
#include "common/ge/datatype_util.h"
#include "framework/common/debug/ge_log.h"
@ -28,6 +27,7 @@
#include "proto/ge_ir.pb.h"
#include "proto/op_mapping_info.pb.h"
#include "runtime/mem.h"
#include "aicpu/common/aicpu_task_struct.h"
namespace {
const uint32_t kAicpuLoadFlag = 1;

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

Loading…
Cancel
Save