From 4ce0f3386fc41b8be5a06efb32b2a91a50d408da Mon Sep 17 00:00:00 2001 From: wuweikang Date: Tue, 13 Oct 2020 14:02:29 +0800 Subject: [PATCH] graphengine-281-sync-from-trunk-to-blue-zone-1012-c75b220spc1009 --- CMakeLists.txt | 6 ++- inc/common/opskernel/ops_kernel_info_store.h | 9 ++--- inc/common/opskernel/ops_kernel_info_types.h | 6 +-- inc/common/optimizer/graph_optimizer.h | 2 - inc/external/ge/ge_api_error_codes.h | 2 +- inc/external/graph/attr_value.h | 2 - inc/external/graph/operator.h | 23 +++++------ inc/external/graph/tensor.h | 1 - inc/external/register/register.h | 2 - .../scope/scope_fusion_pass_register.h | 1 - inc/framework/common/ge_inner_error_codes.h | 1 - inc/framework/common/string_util.h | 8 ++-- inc/graph/buffer.h | 6 +-- inc/graph/compute_graph.h | 2 - inc/graph/debug/ge_attr_define.h | 2 - inc/graph/detail/any_map.h | 2 +- inc/graph/detail/attributes_holder.h | 4 +- inc/graph/ge_attr_value.h | 6 +-- inc/graph/node.h | 2 +- inc/graph/range_vistor.h | 4 -- src/common/graph/ge_attr_value.cc | 29 ++++++-------- src/common/graph/model_serialize.cc | 4 +- src/common/graph/op_desc.cc | 1 - src/common/graph/operator.cc | 19 ++++----- src/common/graph/opsproto/opsproto_manager.cc | 2 - src/common/graph/tensor.cc | 24 +++++------ src/common/graph/utils/op_desc_utils.cc | 10 ++--- src/ge/client/ge_prof.cc | 29 ++++++++++---- src/ge/graph/common/ge_call_wrapper.h | 2 - .../load/new_model_manager/data_dumper.cc | 40 +++++++++++-------- .../load/new_model_manager/data_dumper.h | 2 + .../load/new_model_manager/davinci_model.cc | 13 +++--- .../load/new_model_manager/davinci_model.h | 2 + .../task_info/kernel_ex_task_info.cc | 4 ++ .../task_info/kernel_task_info.cc | 6 +++ src/ge/graph/manager/util/hcom_util.h | 13 +++--- src/ge/graph/optimize/graph_optimize.h | 2 +- third_party/fwkacllib/inc/hccl/hccl_types.h | 2 + third_party/fwkacllib/inc/mmpa/mmpa_api.h | 4 +- third_party/fwkacllib/inc/ops/hcom_ops.h | 8 ++-- third_party/fwkacllib/inc/ops/nn_detect_ops.h | 3 ++ third_party/fwkacllib/inc/ops/pad_ops.h | 3 ++ third_party/fwkacllib/inc/ops/random_ops.h | 19 +++++++++ third_party/fwkacllib/inc/ops/selection_ops.h | 9 +++++ .../inc/register/op_kernel_registry.h | 1 - third_party/fwkacllib/inc/runtime/dev.h | 17 ++++++++ third_party/fwkacllib/inc/runtime/mem.h | 2 - .../fwkacllib/inc/toolchain/prof_acl_api.h | 9 +++++ 48 files changed, 206 insertions(+), 164 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 457fa086..fdc857bd 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,7 +68,8 @@ elseif(DEFINED ENV{D_LINK_PATH}) find_library(slog libslog.so ${GE_LIB_PATH}) find_library(mmpa libmmpa.so ${GE_LIB_PATH}) find_library(runtime libruntime.so ${GE_LIB_PATH}) - find_library(msprof libmsprofiler.a ${GE_LIB_PATH}) + find_library(msprof libmsprof.so ${GE_LIB_PATH}) + find_library(msprofiler libmsprofiler.a ${GE_LIB_PATH}) find_library(register libregister.so ${GE_LIB_PATH}) find_library(hccl libhccl.so ${GE_LIB_PATH}) find_library(resource libresource.so ${GE_LIB_PATH}) @@ -85,7 +86,8 @@ else() set(ASCEND_RUNTIME_DIR ${ASCEND_DIR}/fwkacllib/lib64) find_library(slog libslog.so ${ASCEND_DRIVER_DIR}) find_library(mmpa libmmpa.so ${ASCEND_DRIVER_DIR}) - find_library(msprof libmsprofiler.a ${ASCEND_RUNTIME_DIR}) + find_library(msprof libmsprof.so ${ASCEND_DRIVER_DIR}) + find_library(msprofiler libmsprofiler.a ${ASCEND_RUNTIME_DIR}) find_library(hccl libhccl.so ${ASCEND_RUNTIME_DIR}) find_library(runtime libruntime.so ${ASCEND_RUNTIME_DIR}) diff --git a/inc/common/opskernel/ops_kernel_info_store.h b/inc/common/opskernel/ops_kernel_info_store.h index ce1464d4..46338e45 100644 --- a/inc/common/opskernel/ops_kernel_info_store.h +++ b/inc/common/opskernel/ops_kernel_info_store.h @@ -43,10 +43,10 @@ class OpsKernelInfoStore { virtual ~OpsKernelInfoStore() {} // initialize opsKernelInfoStore - virtual Status Initialize(const map &options) = 0; /*lint -e148*/ + virtual Status Initialize(const map &options) = 0; // close opsKernelInfoStore - virtual Status Finalize() = 0; /*lint -e148*/ + virtual Status Finalize() = 0; virtual Status CreateSession(const std::map &session_options) { return SUCCESS; } @@ -66,11 +66,10 @@ class OpsKernelInfoStore { virtual void opsFlagCheck(const ge::Node &node, std::string &opsFlag){}; // memory allocation requirement - virtual Status CalcOpRunningParam(Node &node) = 0; /*lint -e148*/ + virtual Status CalcOpRunningParam(Node &node) = 0; // generate task for op。 - virtual Status GenerateTask(const Node &node, RunContext &context, - std::vector &tasks) = 0; /*lint -e148*/ + virtual Status GenerateTask(const Node &node, RunContext &context, std::vector &tasks) = 0; // only call fe engine interface to compile single op virtual Status CompileOp(vector &node_vec) { return SUCCESS; } diff --git a/inc/common/opskernel/ops_kernel_info_types.h b/inc/common/opskernel/ops_kernel_info_types.h index 684c1abc..d13840bd 100644 --- a/inc/common/opskernel/ops_kernel_info_types.h +++ b/inc/common/opskernel/ops_kernel_info_types.h @@ -26,7 +26,6 @@ using std::string; namespace ge { -/*lint -e148*/ struct RunContext { rtModel_t model; rtStream_t stream; @@ -41,8 +40,6 @@ struct RunContext { std::vector graphLabelList; // all labels of graph, order by ge label id(0,1,...) }; -/*lint +e148*/ - struct Task { uint32_t id; uint16_t type; @@ -51,8 +48,7 @@ struct Task { }; struct OpInfo { - string engine; // which engin - /*lint -e148*/ + string engine; // which engin string opKernelLib; // which opsKernelStore int computeCost; // compute cost bool flagPartial; // whether to support is related to shape diff --git a/inc/common/optimizer/graph_optimizer.h b/inc/common/optimizer/graph_optimizer.h index 253aaae1..32ea944c 100644 --- a/inc/common/optimizer/graph_optimizer.h +++ b/inc/common/optimizer/graph_optimizer.h @@ -27,7 +27,6 @@ using std::map; using std::string; -/*lint -e148*/ namespace ge { class GraphOptimizer { public: @@ -67,5 +66,4 @@ class GraphOptimizer { virtual Status OptimizeFusedGraphAfterGraphSlice(ComputeGraph &graph) { return SUCCESS; } }; } // namespace ge -/*lint +e148*/ #endif // INC_COMMON_OPTIMIZER_GRAPH_OPTIMIZER_H_ diff --git a/inc/external/ge/ge_api_error_codes.h b/inc/external/ge/ge_api_error_codes.h index 7b045d54..e7f52724 100644 --- a/inc/external/ge/ge_api_error_codes.h +++ b/inc/external/ge/ge_api_error_codes.h @@ -70,7 +70,7 @@ using Status = uint32_t; // General error code GE_ERRORNO(0, 0, 0, 0, 0, SUCCESS, 0, "success"); -GE_ERRORNO(0b11, 0b11, 0b111, 0xFF, 0b11111, FAILED, 0xFFF, "failed"); /*lint !e401*/ +GE_ERRORNO(0b11, 0b11, 0b111, 0xFF, 0b11111, FAILED, 0xFFF, "failed"); } // namespace ge #endif // INC_EXTERNAL_GE_GE_API_ERROR_CODES_H_ diff --git a/inc/external/graph/attr_value.h b/inc/external/graph/attr_value.h index af430f9b..32fce04c 100644 --- a/inc/external/graph/attr_value.h +++ b/inc/external/graph/attr_value.h @@ -34,7 +34,6 @@ using std::vector; namespace ge { class AttrValueImpl; -/*lint -e148*/ class GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY AttrValue { public: using INT = int64_t; @@ -70,6 +69,5 @@ class GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY AttrValue { VALUE_SET_GET_DEC(AttrValue::FLOAT) #undef VALUE_SET_GET_DEC }; -/*lint +e148*/ } // namespace ge #endif // INC_EXTERNAL_GRAPH_ATTR_VALUE_H_ diff --git a/inc/external/graph/operator.h b/inc/external/graph/operator.h index 81d726eb..042898c0 100644 --- a/inc/external/graph/operator.h +++ b/inc/external/graph/operator.h @@ -63,7 +63,6 @@ using std::function; using std::shared_ptr; using std::string; -/*lint -e148*/ class GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY Operator { public: friend class OperatorImpl; @@ -91,7 +90,7 @@ class GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY Operator { explicit Operator(const string &type); - Operator(const string &name, const string &type); // lint !e148 + Operator(const string &name, const string &type); virtual ~Operator() = default; @@ -104,7 +103,7 @@ class GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY Operator { // Only has one output index = 0 Operator &SetInput(const string &dst_name, const Operator &src_oprt); - Operator &SetInput(const string &dst_name, const Operator &src_oprt, const string &name); // lint !e148 + Operator &SetInput(const string &dst_name, const Operator &src_oprt, const string &name); Operator &SetInput(const string &dst_name, const Operator &src_oprt, uint32_t index); @@ -128,22 +127,22 @@ class GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY Operator { TensorDesc GetOutputDesc(uint32_t index) const; - graphStatus UpdateOutputDesc(const string &name, const TensorDesc &tensor_desc); // lint !e148 + graphStatus UpdateOutputDesc(const string &name, const TensorDesc &tensor_desc); TensorDesc GetDynamicInputDesc(const string &name, uint32_t index) const; - graphStatus UpdateDynamicInputDesc(const string &name, uint32_t index, const TensorDesc &tensor_desc); // lint !e148 + graphStatus UpdateDynamicInputDesc(const string &name, uint32_t index, const TensorDesc &tensor_desc); TensorDesc GetDynamicOutputDesc(const string &name, uint32_t index) const; - graphStatus UpdateDynamicOutputDesc(const string &name, uint32_t index, const TensorDesc &tensor_desc); // lint !e148 + graphStatus UpdateDynamicOutputDesc(const string &name, uint32_t index, const TensorDesc &tensor_desc); - graphStatus InferShapeAndType(); // lint !e148 + graphStatus InferShapeAndType(); void SetInferenceContext(const InferenceContextPtr &inference_context); InferenceContextPtr GetInferenceContext() const; - graphStatus VerifyAllAttr(bool disable_common_verifier = false); // lint !e148 + graphStatus VerifyAllAttr(bool disable_common_verifier = false); size_t GetInputsSize() const; @@ -256,20 +255,19 @@ class GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY Operator { void RequiredAttrRegister(const string &name); - graphStatus VerifyAll(); // lint !e148 + graphStatus VerifyAll(); // Only has one output index = 0 Operator &SetInput(const string &dst_name, uint32_t dst_index, const Operator &src_oprt); - Operator &SetInput(const string &dst_name, uint32_t dst_index, const Operator &src_oprt, - const string &name); // lint !e148 + Operator &SetInput(const string &dst_name, uint32_t dst_index, const Operator &src_oprt, const string &name); void SubgraphRegister(const string &ir_name, bool dynamic); void SubgraphCountRegister(const string &ir_name, uint32_t count); void SetSubgraphBuilder(const string &ir_name, uint32_t index, const SubgraphBuilder &builder); private: - Operator &SetInput(const string &dst_name, const OutHandler &out_handler); // lint !e148 + Operator &SetInput(const string &dst_name, const OutHandler &out_handler); OutHandler GetOutput(const string &name) const; @@ -283,7 +281,6 @@ class GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY Operator { std::shared_ptr GetNode() const; }; -/*lint +e148*/ } // namespace ge #endif // INC_EXTERNAL_GRAPH_OPERATOR_H_ diff --git a/inc/external/graph/tensor.h b/inc/external/graph/tensor.h index 800e1037..5174c248 100644 --- a/inc/external/graph/tensor.h +++ b/inc/external/graph/tensor.h @@ -126,6 +126,5 @@ class GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY Tensor { friend class TensorAdapter; }; } // namespace ge -/*lint +e148*/ #endif // INC_EXTERNAL_GRAPH_TENSOR_H_ diff --git a/inc/external/register/register.h b/inc/external/register/register.h index f3091fae..f9056171 100644 --- a/inc/external/register/register.h +++ b/inc/external/register/register.h @@ -40,7 +40,6 @@ using std::to_string; using std::unique_ptr; using std::vector; -/*lint -e148*/ namespace ge { class Operator; class TensorDesc; @@ -159,5 +158,4 @@ namespace ge { using OpRegistrationData = domi::OpRegistrationData; using OpReceiver = domi::OpReceiver; } // namespace ge -/*lint +e148*/ #endif // INC_EXTERNAL_REGISTER_REGISTER_H_ diff --git a/inc/external/register/scope/scope_fusion_pass_register.h b/inc/external/register/scope/scope_fusion_pass_register.h index 8e5605a7..c2905927 100644 --- a/inc/external/register/scope/scope_fusion_pass_register.h +++ b/inc/external/register/scope/scope_fusion_pass_register.h @@ -301,7 +301,6 @@ class GE_FUNC_HOST_VISIBILITY GE_FUNC_DEV_VISIBILITY ScopeFusionPassRegistry { private: ScopeFusionPassRegistry(); class ScopeFusionPassRegistryImpl; - /*lint -e148*/ std::unique_ptr impl_; friend class TensorFlowModelParser; }; diff --git a/inc/framework/common/ge_inner_error_codes.h b/inc/framework/common/ge_inner_error_codes.h index 3ab6cf06..4e9e9799 100644 --- a/inc/framework/common/ge_inner_error_codes.h +++ b/inc/framework/common/ge_inner_error_codes.h @@ -14,7 +14,6 @@ * limitations under the License. */ -/*lint -e* */ #ifndef INC_FRAMEWORK_COMMON_GE_INNER_ERROR_CODES_H_ #define INC_FRAMEWORK_COMMON_GE_INNER_ERROR_CODES_H_ diff --git a/inc/framework/common/string_util.h b/inc/framework/common/string_util.h index 3e4bf093..b74eddcf 100644 --- a/inc/framework/common/string_util.h +++ b/inc/framework/common/string_util.h @@ -36,8 +36,8 @@ class StringUtils { #endif return s; } - // lint -esym(551,*) - static std::string &Rtrim(std::string &s) { /*lint !e618*/ + + static std::string &Rtrim(std::string &s) { #if __cplusplus >= 201103L (void)s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](int c) { return !std::isspace(c); })); #else @@ -45,7 +45,7 @@ class StringUtils { #endif return s; } - // lint -esym(551,*) + /// /// @ingroup domi_common /// @brief delete spaces at the beginning and end of a string @@ -61,10 +61,8 @@ class StringUtils { /// @param [in] delim separator /// @return string array after segmentation /// - /*lint -e1077*/ static std::vector Split(const std::string &str, char delim) { std::vector elems; - /*lint +e1077*/ if (str.empty()) { elems.emplace_back(""); diff --git a/inc/graph/buffer.h b/inc/graph/buffer.h index ca4355a7..e6be3daa 100644 --- a/inc/graph/buffer.h +++ b/inc/graph/buffer.h @@ -57,11 +57,11 @@ class GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY Buffer { // For compatibility inline const std::uint8_t *data() const { return GetData(); } - inline std::uint8_t *data() { return GetData(); } // lint !e659 + inline std::uint8_t *data() { return GetData(); } inline std::size_t size() const { return GetSize(); } inline void clear() { return ClearBuffer(); } - uint8_t operator[](size_t index) const { // lint !e1022 !e1042 - if (buffer_ != nullptr && index < buffer_->size()) { // lint !e574 + uint8_t operator[](size_t index) const { + if (buffer_ != nullptr && index < buffer_->size()) { return (uint8_t)(*buffer_)[index]; } return 0xff; diff --git a/inc/graph/compute_graph.h b/inc/graph/compute_graph.h index 2ec6b663..9a454f39 100644 --- a/inc/graph/compute_graph.h +++ b/inc/graph/compute_graph.h @@ -84,7 +84,6 @@ class ComputeGraph : public std::enable_shared_from_this, public A NodePtr FindNode(const std::string &name) const; NodePtr FindFirstNodeMatchType(const std::string &name) const; - /*lint -e504*/ // AddNode with NodePtr NodePtr AddNode(NodePtr node); NodePtr AddNode(OpDescPtr op); @@ -152,7 +151,6 @@ class ComputeGraph : public std::enable_shared_from_this, public A graphStatus InsertEventNodes(); bool operator==(const ComputeGraph &r_compute_graph) const; - /*lint +e504*/ const std::map, std::vector> &GetShareParamLayer() const { return params_share_map_; } diff --git a/inc/graph/debug/ge_attr_define.h b/inc/graph/debug/ge_attr_define.h index 47b11ba8..22d9703c 100644 --- a/inc/graph/debug/ge_attr_define.h +++ b/inc/graph/debug/ge_attr_define.h @@ -14,7 +14,6 @@ * limitations under the License. */ -/*lint -e618*/ #ifndef INC_GRAPH_DEBUG_GE_ATTR_DEFINE_H_ #define INC_GRAPH_DEBUG_GE_ATTR_DEFINE_H_ @@ -1127,4 +1126,3 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string ATTR_ZER } // namespace ge #endif // INC_GRAPH_DEBUG_GE_ATTR_DEFINE_H_ -/*lint +e618*/ diff --git a/inc/graph/detail/any_map.h b/inc/graph/detail/any_map.h index 70533ea1..21eb08b0 100644 --- a/inc/graph/detail/any_map.h +++ b/inc/graph/detail/any_map.h @@ -38,7 +38,7 @@ class TypeID { bool operator==(const TypeID &__arg) const { return type_ == __arg.type_; } private: - explicit TypeID(string type) : type_(std::move(type)) {} // lint !e30 !e32 + explicit TypeID(string type) : type_(std::move(type)) {} string type_; }; diff --git a/inc/graph/detail/attributes_holder.h b/inc/graph/detail/attributes_holder.h index 49741143..cdaec821 100644 --- a/inc/graph/detail/attributes_holder.h +++ b/inc/graph/detail/attributes_holder.h @@ -50,7 +50,7 @@ class OpDef; class GraphDef; } // namespace proto -using ProtoAttrMap = ::google::protobuf::Map<::std::string, ::ge::proto::AttrDef>; // lint !e1073 +using ProtoAttrMap = ::google::protobuf::Map<::std::string, ::ge::proto::AttrDef>; using ProtoMsgOwner = std::shared_ptr<::google::protobuf::Message>; template @@ -147,7 +147,7 @@ class GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY AttrHolder { protected: graphStatus AddRequiredAttr(const std::string &name); const std::unordered_set GetAllAttrNames() const; - const std::map GetAllAttrs() const; // lint !e1073 + const std::map GetAllAttrs() const; virtual ProtoAttrMapHelper MutableAttrMap() = 0; virtual ConstProtoAttrMapHelper GetAttrMap() const = 0; diff --git a/inc/graph/ge_attr_value.h b/inc/graph/ge_attr_value.h index 0c265c20..b665beba 100644 --- a/inc/graph/ge_attr_value.h +++ b/inc/graph/ge_attr_value.h @@ -310,7 +310,7 @@ class GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY GeAttrValue { VALUE_SET_GET_DEC(GeAttrValue::GRAPH) VALUE_SET_GET_DEC(BYTES) VALUE_SET_GET_DEC(NamedAttrs) - VALUE_SET_GET_DEC(ge::DataType) // lint !e665 + VALUE_SET_GET_DEC(ge::DataType) VALUE_SET_GET_DEC(vector) VALUE_SET_GET_DEC(vector) VALUE_SET_GET_DEC(vector) @@ -320,8 +320,8 @@ class GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY GeAttrValue { VALUE_SET_GET_DEC(vector) VALUE_SET_GET_DEC(vector) VALUE_SET_GET_DEC(vector) - VALUE_SET_GET_DEC(vector>) // lint !e665 - VALUE_SET_GET_DEC(vector) // lint !e665 + VALUE_SET_GET_DEC(vector>) + VALUE_SET_GET_DEC(vector) #undef VALUE_SET_GET_DEC GeIrProtoHelper value_; diff --git a/inc/graph/node.h b/inc/graph/node.h index f4a1c6a8..e1ffe5b7 100644 --- a/inc/graph/node.h +++ b/inc/graph/node.h @@ -193,7 +193,7 @@ class Node : public std::enable_shared_from_this { vector out_data_anchors_; InControlAnchorPtr in_control_anchor_; OutControlAnchorPtr out_control_anchor_; - map attrs_; // lint !e1073 + map attrs_; bool has_init_{false}; bool host_node_{false}; bool anchor_status_updated_{false}; diff --git a/inc/graph/range_vistor.h b/inc/graph/range_vistor.h index 8635d413..20905bd9 100644 --- a/inc/graph/range_vistor.h +++ b/inc/graph/range_vistor.h @@ -22,10 +22,8 @@ template class RangeVistor { public: - /*lint -e151*/ using Iterator = typename std::vector::iterator; using ConstIterator = typename std::vector::const_iterator; - /*lint +e151*/ RangeVistor(O owner, const std::vector &vs) : owner_(owner), elements_(vs) {} @@ -43,9 +41,7 @@ class RangeVistor { bool empty() const { return elements_.empty(); } - /*lint -e659*/ E &at(std::size_t index) { return elements_.at(index); } - /*lint +e659*/ const E &at(std::size_t index) const { return elements_.at(index); } diff --git a/src/common/graph/ge_attr_value.cc b/src/common/graph/ge_attr_value.cc index a8490470..8a62134f 100644 --- a/src/common/graph/ge_attr_value.cc +++ b/src/common/graph/ge_attr_value.cc @@ -33,8 +33,7 @@ using std::vector; namespace ge { NamedAttrs::NamedAttrs() { named_attrs_.InitDefault(); } -NamedAttrs::NamedAttrs(const ProtoMsgOwner &owner, proto::NamedAttrs *proto_msg) - : named_attrs_(owner, proto_msg) {} // lint !e1744 +NamedAttrs::NamedAttrs(const ProtoMsgOwner &owner, proto::NamedAttrs *proto_msg) : named_attrs_(owner, proto_msg) {} void NamedAttrs::SetName(const std::string &name) { auto proto_msg = named_attrs_.GetProtoMsg(); @@ -239,7 +238,7 @@ ATTR_VALUE_SET_GET_IMP(GeAttrValue::STR) ATTR_VALUE_SET_GET_IMP(vector) ATTR_VALUE_SET_GET_IMP(GeAttrValue::INT) ATTR_VALUE_SET_GET_IMP(vector) -ATTR_VALUE_SET_GET_IMP(GeAttrValue::FLOAT) // lint !e524 +ATTR_VALUE_SET_GET_IMP(GeAttrValue::FLOAT) ATTR_VALUE_SET_GET_IMP(vector) ATTR_VALUE_SET_GET_IMP(GeAttrValue::BOOL) ATTR_VALUE_SET_GET_IMP(vector) @@ -253,11 +252,9 @@ ATTR_VALUE_SET_GET_IMP(GeAttrValue::BYTES) ATTR_VALUE_SET_GET_IMP(vector) ATTR_VALUE_SET_GET_IMP(GeAttrValue::NAMED_ATTRS) ATTR_VALUE_SET_GET_IMP(vector) -/*lint -e665*/ ATTR_VALUE_SET_GET_IMP(vector>) -/*lint +e665*/ -ATTR_VALUE_SET_GET_IMP(vector) // lint !e665 -ATTR_VALUE_SET_GET_IMP(GeAttrValue::DATA_TYPE) // lint !e665 +ATTR_VALUE_SET_GET_IMP(vector) +ATTR_VALUE_SET_GET_IMP(GeAttrValue::DATA_TYPE) #undef ATTR_VALUE_SET_GET_IMP @@ -785,14 +782,14 @@ bool GeAttrValueImp::GetValue(const proto::AttrDef &proto_attr_val, const ProtoM if (graph_def == nullptr) { GELOGE(GRAPH_FAILED, "proto::GraphDef make shared failed"); graph_def = nullptr; - return false; // lint !e665 + return false; } else { ModelSerializeImp imp; imp.SetProtobufOwner(graph_def); if (!imp.UnserializeGraph(graph, *graph_def)) { GELOGE(GRAPH_FAILED, "UnserializeGraph Failed"); return false; - } // lint !e514 + } value = graph; } return true; @@ -812,7 +809,7 @@ bool GeAttrValueImp::GetValue(const proto::AttrDef &proto_attr_val, const ProtoM if (graph_def == nullptr) { GELOGE(GRAPH_FAILED, "proto::GraphDef make shared failed"); graph_def = nullptr; - return false; // lint !e665 + return false; } else { ComputeGraphPtr graph = nullptr; ModelSerializeImp imp; @@ -820,7 +817,7 @@ bool GeAttrValueImp::GetValue(const proto::AttrDef &proto_attr_val, const ProtoM if (!imp.UnserializeGraph(graph, *graph_def)) { GELOGE(GRAPH_FAILED, "UnserializeGraph Failed"); return false; - } // lint !e514 + } value.push_back(graph); } } @@ -972,9 +969,7 @@ ATTR_UTILS_SET_IMP(Tensor, GeTensor) ATTR_UTILS_SET_GET_IMP(NamedAttrs, GeAttrValue::NAMED_ATTRS) ATTR_UTILS_SET_GET_IMP(Bytes, Buffer) ATTR_UTILS_SET_GET_IMP(Graph, ComputeGraphPtr) -/*lint -e665*/ ATTR_UTILS_SET_GET_IMP(ListListInt, vector>) -/*lint +e665*/ ATTR_UTILS_SET_GET_IMP(ListInt, vector) ATTR_UTILS_SET_IMP(ListInt, vector) @@ -989,8 +984,8 @@ ATTR_UTILS_SET_IMP(ListTensor, vector) ATTR_UTILS_SET_GET_IMP(ListNamedAttrs, vector) ATTR_UTILS_SET_GET_IMP(ListBytes, vector) ATTR_UTILS_SET_GET_IMP(ListGraph, vector) -ATTR_UTILS_SET_GET_IMP(ListDataType, vector) // lint !e665 -ATTR_UTILS_SET_GET_IMP(DataType, ge::DataType) // lint !e665 +ATTR_UTILS_SET_GET_IMP(ListDataType, vector) +ATTR_UTILS_SET_GET_IMP(DataType, ge::DataType) bool AttrUtils::SetListTensor(AttrHolderAdapter &&obj, const string &name, std::initializer_list &&value) { @@ -1159,7 +1154,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY bool AttrUtils::GetListOpDesc(Con } for (const auto &item : bytes_vals) { ModelSerialize serialize; - auto op_desc = serialize.UnserializeOpDesc(item.GetData(), item.GetSize()); // lint !e732 + auto op_desc = serialize.UnserializeOpDesc(item.GetData(), item.GetSize()); value.push_back(op_desc); } return true; @@ -1211,7 +1206,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY OpDescPtr AttrUtils::CloneOpDesc( op_def = ComGraphMakeShared(); if (op_def == nullptr) { GELOGE(GRAPH_FAILED, "proto::OpDef make shared failed"); - return nullptr; // lint !e665 + return nullptr; } ModelSerializeImp imp; (void)imp.SerializeOpDesc(org_op_desc, op_def.get()); diff --git a/src/common/graph/model_serialize.cc b/src/common/graph/model_serialize.cc index 16855fc5..1ac01b1e 100644 --- a/src/common/graph/model_serialize.cc +++ b/src/common/graph/model_serialize.cc @@ -409,13 +409,13 @@ bool ModelSerializeImp::HandleNodeNameRef() { item.dst_node_name.c_str(), item.dst_in_index); return false; } - GE_CHK_BOOL_ONLY_LOG((src_anchor->LinkTo(dst_anchor) == GRAPH_SUCCESS), " linkTo failed."); // lint !e737 + GE_CHK_BOOL_ONLY_LOG((src_anchor->LinkTo(dst_anchor) == GRAPH_SUCCESS), " linkTo failed."); } else { // Control edge auto src_anchor = src_node_it->second->GetOutControlAnchor(); auto dst_anchor = item.dst_node->GetInControlAnchor(); if (src_anchor != nullptr && dst_anchor != nullptr) { - GE_CHK_BOOL_ONLY_LOG((src_anchor->LinkTo(dst_anchor) == GRAPH_SUCCESS), " linkTo failed."); // lint !e737 + GE_CHK_BOOL_ONLY_LOG((src_anchor->LinkTo(dst_anchor) == GRAPH_SUCCESS), " linkTo failed."); } } } diff --git a/src/common/graph/op_desc.cc b/src/common/graph/op_desc.cc index dee0aece..35cbf3f7 100644 --- a/src/common/graph/op_desc.cc +++ b/src/common/graph/op_desc.cc @@ -33,7 +33,6 @@ using std::shared_ptr; using std::string; using std::vector; -/*lint -save -e521 -e681 -e732 -e737*/ namespace ge { const std::string ATTR_NAME_ID = "id"; diff --git a/src/common/graph/operator.cc b/src/common/graph/operator.cc index 21554fa1..2811eb09 100644 --- a/src/common/graph/operator.cc +++ b/src/common/graph/operator.cc @@ -56,9 +56,6 @@ using std::string; using std::to_string; using std::vector; -/*lint -save -e529 -e728*/ -/*lint -e446 -e732*/ -/*lint -e665*/ namespace ge { class OpIO { public: @@ -943,7 +940,7 @@ OperatorImplPtr Operator::GetOperatorImplPtr() const { return operator_impl_; } GELOGW("set attr name %s failed.", name.c_str()); \ } \ return *this; \ - } // lint !e665 + } #define OP_ATTR_GET_IMP(ArgType, AttrUtilsFun) \ graphStatus Operator::GetAttr(const string &name, ArgType attr_value) const { \ @@ -956,7 +953,7 @@ OperatorImplPtr Operator::GetOperatorImplPtr() const { return operator_impl_; } return GRAPH_FAILED; \ } \ return GRAPH_SUCCESS; \ - } // lint !e665 + } void Operator::BreakConnect() const { if (operator_impl_ == nullptr) { @@ -977,7 +974,7 @@ void Operator::BreakConnect() const { if (!AttrUtils::Set##AttrUtilsFun(operator_impl_->GetOpDescImpl(), name, attr_value)) { \ GELOGW("reg attr name %s failed.", name.c_str()); \ } \ - } // lint !e665 + } OP_ATTR_SET_IMP(int64_t, Int) OP_ATTR_SET_IMP(int32_t, Int) @@ -998,22 +995,22 @@ OP_ATTR_SET_IMP(const vector> &, ListListInt) OP_ATTR_SET_IMP(float, Float) OP_ATTR_GET_IMP(float &, Float) OP_ATTR_SET_IMP(const vector &, ListFloat) -OP_ATTR_GET_IMP(vector &, ListFloat) // lint !e665 +OP_ATTR_GET_IMP(vector &, ListFloat) OP_ATTR_SET_IMP(bool, Bool) OP_ATTR_GET_IMP(bool &, Bool) OP_ATTR_SET_IMP(const vector &, ListBool) -OP_ATTR_GET_IMP(vector &, ListBool) // lint !e665 +OP_ATTR_GET_IMP(vector &, ListBool) OP_ATTR_SET_IMP(const string &, Str) OP_ATTR_GET_IMP(string &, Str) OP_ATTR_SET_IMP(const vector &, ListStr) -OP_ATTR_GET_IMP(vector &, ListStr) // lint !e665 +OP_ATTR_GET_IMP(vector &, ListStr) OP_ATTR_SET_IMP(const GeAttrValue::NAMED_ATTRS &, NamedAttrs) OP_ATTR_GET_IMP(GeAttrValue::NAMED_ATTRS &, NamedAttrs) OP_ATTR_SET_IMP(const vector &, ListNamedAttrs) -OP_ATTR_GET_IMP(vector &, ListNamedAttrs) // lint !e665 +OP_ATTR_GET_IMP(vector &, ListNamedAttrs) OP_ATTR_REG_IMP(int64_t, Int) OP_ATTR_REG_IMP(const vector &, ListInt) @@ -1583,5 +1580,3 @@ void GraphUtils::BreakConnect(const std::map &all_node } } } // namespace ge -/*lint +e446 +e732*/ -/*lint +e665*/ diff --git a/src/common/graph/opsproto/opsproto_manager.cc b/src/common/graph/opsproto/opsproto_manager.cc index d482715b..397e02cd 100644 --- a/src/common/graph/opsproto/opsproto_manager.cc +++ b/src/common/graph/opsproto/opsproto_manager.cc @@ -38,9 +38,7 @@ bool OpsProtoManager::Initialize(const std::map &optio return true; } - /*lint -e1561*/ auto proto_iter = options.find("ge.opsProtoLibPath"); - /*lint +e1561*/ if (proto_iter == options.end()) { GELOGW("ge.opsProtoLibPath option not set, return."); return false; diff --git a/src/common/graph/tensor.cc b/src/common/graph/tensor.cc index 1f30c876..0d511645 100644 --- a/src/common/graph/tensor.cc +++ b/src/common/graph/tensor.cc @@ -178,18 +178,16 @@ int64_t Shape::GetShapeSize() const { return 0; } -TensorDesc::TensorDesc() { - impl = ComGraphMakeShared(); // lint !e665 -} +TensorDesc::TensorDesc() { impl = ComGraphMakeShared(); } TensorDesc::TensorDesc(Shape shape, Format format, DataType dt) { - impl = ComGraphMakeShared(shape, format, dt); // lint !e665 + impl = ComGraphMakeShared(shape, format, dt); SetRealDimCnt(shape.GetDimNum()); } TensorDesc::TensorDesc(const TensorDesc &desc) { // Copy - impl = ComGraphMakeShared(); // lint !e665 + impl = ComGraphMakeShared(); if (desc.impl != nullptr && impl != nullptr) { *impl = *desc.impl; } @@ -360,9 +358,7 @@ void TensorDesc::SetName(const std::string &name) { Tensor::Tensor() { impl = ComGraphMakeShared(); } -Tensor::Tensor(const TensorDesc &tensor_desc) { - impl = ComGraphMakeShared(tensor_desc); // lint !e665 -} +Tensor::Tensor(const TensorDesc &tensor_desc) { impl = ComGraphMakeShared(tensor_desc); } Tensor::Tensor(const TensorDesc &tensor_desc, const std::vector &data) { uint64_t shape_size = tensor_desc.GetShape().GetShapeSize(); @@ -384,7 +380,7 @@ Tensor::Tensor(const TensorDesc &tensor_desc, const std::vector &data) } } } - impl = ComGraphMakeShared(tensor_desc, data); // lint !e665 + impl = ComGraphMakeShared(tensor_desc, data); } Tensor::Tensor(const TensorDesc &tensor_desc, const uint8_t *data, size_t size) { @@ -406,7 +402,7 @@ Tensor::Tensor(const TensorDesc &tensor_desc, const uint8_t *data, size_t size) } } - impl = ComGraphMakeShared(tensor_desc, data, size); // lint !e665 + impl = ComGraphMakeShared(tensor_desc, data, size); } Tensor::Tensor(TensorDesc &&tensor_desc, std::vector &&data) { @@ -429,7 +425,7 @@ Tensor::Tensor(TensorDesc &&tensor_desc, std::vector &&data) { } } } - impl = ComGraphMakeShared(std::move(tensor_desc), std::move(data)); // lint !e665 + impl = ComGraphMakeShared(std::move(tensor_desc), std::move(data)); } TensorDesc Tensor::GetTensorDesc() const { @@ -643,7 +639,7 @@ TensorDesc TensorAdapter::GeTensorDesc2TensorDesc(const GeTensorDesc &ge_tensor_ GeTensorPtr TensorAdapter::Tensor2GeTensor(const Tensor &tensor) { GeTensorPtr ge_tensor; if (tensor.impl != nullptr) { - ge_tensor = ComGraphMakeShared(tensor.impl->ge_tensor.Clone()); // lint !e665 + ge_tensor = ComGraphMakeShared(tensor.impl->ge_tensor.Clone()); } return ge_tensor; } @@ -659,7 +655,7 @@ Tensor TensorAdapter::GeTensor2Tensor(const ConstGeTensorPtr &ge_tensor) { ConstGeTensorPtr TensorAdapter::AsGeTensorPtr(const Tensor &tensor) { GeTensorPtr ge_tensor; if (tensor.impl != nullptr) { - ge_tensor = ComGraphMakeShared(tensor.impl->ge_tensor); // lint !e665 + ge_tensor = ComGraphMakeShared(tensor.impl->ge_tensor); } return ge_tensor; } @@ -667,7 +663,7 @@ ConstGeTensorPtr TensorAdapter::AsGeTensorPtr(const Tensor &tensor) { GeTensorPtr TensorAdapter::AsGeTensorPtr(Tensor &tensor) { GeTensorPtr ge_tensor; if (tensor.impl != nullptr) { - ge_tensor = ComGraphMakeShared(tensor.impl->ge_tensor); // lint !e665 + ge_tensor = ComGraphMakeShared(tensor.impl->ge_tensor); } return ge_tensor; } diff --git a/src/common/graph/utils/op_desc_utils.cc b/src/common/graph/utils/op_desc_utils.cc index 17c80b2c..f9cfb901 100644 --- a/src/common/graph/utils/op_desc_utils.cc +++ b/src/common/graph/utils/op_desc_utils.cc @@ -28,7 +28,6 @@ using std::vector; -/*lint -e512 -e737 -e752*/ namespace ge { const char OP_DESC_QUANT_PARAMS[] = "quantize_factor"; static const int CONST_OP_NORMAL_WEIGHT_SIZE = 1; @@ -133,11 +132,11 @@ graphStatus OpDescUtils::GetQuantizeFactorParams(const OpDesc &op_desc, Quantize GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus OpDescUtils::SetQuantizeFactorParams(const OpDescPtr &op_desc, const QuantizeFactorParams &quant) { GE_CHK_BOOL_EXEC_INFO(op_desc != nullptr, return GRAPH_FAILED, "op_desc is nullptr"); - return op_desc->SetAttr(OP_DESC_QUANT_PARAMS, GeAttrValue::CreateFrom(quant)); // lint !e732 + return op_desc->SetAttr(OP_DESC_QUANT_PARAMS, GeAttrValue::CreateFrom(quant)); } graphStatus OpDescUtils::SetQuantizeFactorParams(OpDesc &op_desc, const QuantizeFactorParams &quant) { - return op_desc.SetAttr(OP_DESC_QUANT_PARAMS, GeAttrValue::CreateFrom(quant)); // lint !e732 + return op_desc.SetAttr(OP_DESC_QUANT_PARAMS, GeAttrValue::CreateFrom(quant)); } GeTensorPtr OpDescUtils::MutableWeights(OpDesc &op_desc) { @@ -255,7 +254,7 @@ size_t OpDescUtils::GetNonConstInputsSize(const ge::Node &node) { continue; } } - return input_num; // lint !e712 + return input_num; } else { GE_IF_BOOL_EXEC( node.GetInDataNodes().size() < GetConstInputs(node).size(), @@ -360,7 +359,7 @@ bool OpDescUtils::IsNonConstInput(const ge::Node &node, const size_t index) { bool ret = false; if (index < node.GetAllInDataAnchors().size()) { if (NodeUtils::IsAnchorStatusSet(node)) { - ret = (ge::AnchorUtils::GetStatus(node.GetInDataAnchor(static_cast(index))) == ANCHOR_DATA); // lint !e712 + ret = (ge::AnchorUtils::GetStatus(node.GetInDataAnchor(static_cast(index))) == ANCHOR_DATA); } else { for (const auto &anchor : node.GetAllInDataAnchors()) { if (anchor->GetIdx() != static_cast(index)) { @@ -822,4 +821,3 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus OpDescUtils::SetSubgr return op_desc->SetSubgraphInstanceName(iter->second, subgraph_instance_name); } } // namespace ge -/*lint +e512 +e737 +e752*/ diff --git a/src/ge/client/ge_prof.cc b/src/ge/client/ge_prof.cc index ad9cc9eb..063d3e43 100644 --- a/src/ge/client/ge_prof.cc +++ b/src/ge/client/ge_prof.cc @@ -15,12 +15,12 @@ */ #include "ge/ge_prof.h" -#include "ge/ge_api.h" -#include "init/gelib.h" #include "common/debug/log.h" -#include "framework/common/debug/ge_log.h" #include "common/profiling/profiling_manager.h" +#include "framework/common/debug/ge_log.h" +#include "ge/ge_api.h" #include "graph/load/graph_loader.h" +#include "init/gelib.h" #include "toolchain/prof_acl_api.h" using std::map; @@ -324,10 +324,17 @@ Status aclgrphProfStop(aclgrphProfConfig *profiler_config) { return GE_PROF_NOT_INIT; } - Status ret = ProfStopProfiling(&profiler_config->config); - if (ret != SUCCESS) { - GELOGE(ret, "Stop profiling failed, prof result = %d", ret); - return ret; + for (uint32_t i = 0; i < profiler_config->config.devNums; i++) { + uint64_t data_type_config; + Status status = ProfGetDataTypeConfig(profiler_config->config.devIdList[i], data_type_config); + if (status != SUCCESS) { + GELOGE(status, "Prof get data type config failed, prof result = %d", status); + return status; + } + if (data_type_config != profiler_config->config.dataTypeConfig) { + GELOGE(FAILED, "data type config verify failed"); + return FAILED; + } } std::vector prof_params; @@ -344,12 +351,18 @@ Status aclgrphProfStop(aclgrphProfConfig *profiler_config) { command.module_index = profiler_config->config.dataTypeConfig; GELOGI("Profiling will stop, device nums:%s , deviceID:[%s], data type config: 0x%llx", prof_params[0].c_str(), prof_params[kDeviceListIndex].c_str(), command.module_index); - ret = graph_loader.CommandHandle(command); + Status ret = graph_loader.CommandHandle(command); if (ret != SUCCESS) { GELOGE(ret, "Handle profiling command failed"); return FAILED; } + ret = ProfStopProfiling(&profiler_config->config); + if (ret != SUCCESS) { + GELOGE(ret, "Stop profiling failed, prof result = %d", ret); + return ret; + } + GELOGI("Successfully execute GraphProfStopProfiling."); return SUCCESS; } diff --git a/src/ge/graph/common/ge_call_wrapper.h b/src/ge/graph/common/ge_call_wrapper.h index 305c6c15..a2bb6b88 100644 --- a/src/ge/graph/common/ge_call_wrapper.h +++ b/src/ge/graph/common/ge_call_wrapper.h @@ -18,8 +18,6 @@ #define GE_GE_CALL_WRAPPER_H_ #include "framework/common/debug/ge_log.h" -/*lint --emacro((773),GE_TIMESTAMP_START)*/ -/*lint -esym(773,GE_TIMESTAMP_START)*/ #define GE_TIMESTAMP_START(stage) uint64_t startUsec_##stage = ge::GetCurrentTimestap() #define GE_TIMESTAMP_END(stage, stage_name) \ diff --git a/src/ge/graph/load/new_model_manager/data_dumper.cc b/src/ge/graph/load/new_model_manager/data_dumper.cc index c6283d92..806424ef 100644 --- a/src/ge/graph/load/new_model_manager/data_dumper.cc +++ b/src/ge/graph/load/new_model_manager/data_dumper.cc @@ -671,12 +671,32 @@ Status DataDumper::LoadDumpInfo() { op_mapping_info.set_flag(kAicpuLoadFlag); op_mapping_info.set_dump_step(dump_properties_.GetDumpStep()); SetOpMappingLoopAddr(global_step_, loop_per_iter_, loop_cond_, op_mapping_info); - GELOGI("Dump step is %s and dump path is %s in load dump info", dump_properties_.GetDumpStep().c_str(), - dump_path.c_str()); + GELOGI("Dump step is %s and dump path is %s dump model is %s in load dump info", + dump_properties_.GetDumpStep().c_str(), dump_path.c_str(), dump_list_key.c_str()); + auto ret = BuildTaskInfo(op_mapping_info); + if (ret != SUCCESS) { + GELOGE(ret, "Build task info failed"); + return ret; + } + + SetEndGraphIdToAicpu(end_graph_task_id_, end_graph_stream_id_, op_mapping_info); + + SetOpDebugIdToAicpu(op_debug_task_id_, op_debug_stream_id_, op_debug_addr_, op_mapping_info); + if (!op_list_.empty() || is_op_debug_ || is_end_graph_) { + auto ret = ExecuteLoadDumpInfo(op_mapping_info); + if (ret != SUCCESS) { + GELOGE(ret, "Execute load dump info failed"); + return ret; + } + } + return SUCCESS; +} + +Status DataDumper::BuildTaskInfo(aicpu::dump::OpMappingInfo &op_mapping_info) { for (const auto &op_iter : op_list_) { auto op_desc = op_iter.op; - GELOGD("Op %s in model %s begin to add task in op_mapping_info", op_desc->GetName().c_str(), dump_list_key.c_str()); + GELOGD("Op %s in model begin to add task in op_mapping_info", op_desc->GetName().c_str()); aicpu::dump::Task task; task.set_end_graph(false); task.set_task_id(op_iter.task_id); @@ -700,7 +720,7 @@ Status DataDumper::LoadDumpInfo() { op_mapping_info.mutable_task()->Add(std::move(task)); continue; } - if (dump_properties_.GetDumpMode() == kDumpAll) { + if (dump_properties_.GetDumpMode() == kDumpAll || is_op_debug_) { auto ret = DumpOutput(op_iter, task); if (ret != SUCCESS) { GELOGE(ret, "Dump output failed when in dumping all"); @@ -717,18 +737,6 @@ Status DataDumper::LoadDumpInfo() { continue; } } - - SetEndGraphIdToAicpu(end_graph_task_id_, end_graph_stream_id_, op_mapping_info); - - SetOpDebugIdToAicpu(op_debug_task_id_, op_debug_stream_id_, op_debug_addr_, op_mapping_info); - - if (!op_list_.empty() || is_op_debug_ || is_end_graph_) { - auto ret = ExecuteLoadDumpInfo(op_mapping_info); - if (ret != SUCCESS) { - GELOGE(ret, "Execute load dump info failed"); - return ret; - } - } return SUCCESS; } diff --git a/src/ge/graph/load/new_model_manager/data_dumper.h b/src/ge/graph/load/new_model_manager/data_dumper.h index 30218416..b3c0f3d9 100644 --- a/src/ge/graph/load/new_model_manager/data_dumper.h +++ b/src/ge/graph/load/new_model_manager/data_dumper.h @@ -134,6 +134,8 @@ class DataDumper { DumpProperties dump_properties_; + // Build task info of op mapping info + Status BuildTaskInfo(aicpu::dump::OpMappingInfo &op_mapping_info); Status DumpOutput(const InnerDumpInfo &inner_dump_info, aicpu::dump::Task &task); Status DumpRefOutput(const DataDumper::InnerDumpInfo &inner_dump_info, aicpu::dump::Output &output, size_t i, const std::string &node_name_index); diff --git a/src/ge/graph/load/new_model_manager/davinci_model.cc b/src/ge/graph/load/new_model_manager/davinci_model.cc index 50867782..a9cd9e60 100644 --- a/src/ge/graph/load/new_model_manager/davinci_model.cc +++ b/src/ge/graph/load/new_model_manager/davinci_model.cc @@ -186,14 +186,14 @@ DavinciModel::~DavinciModel() { GE_CHK_RT(rtFree(l1_fusion_addr_)); } + OpDebugUnRegister(); + if (rt_model_handle_ != nullptr) { GE_CHK_RT(rtModelDestroy(rt_model_handle_)); rt_model_handle_ = nullptr; } } - OpDebugUnRegister(); - GELOGI("do ReleaseTask"); ReleaseTask(); CleanTbeHandle(); @@ -518,6 +518,7 @@ void DavinciModel::OpDebugUnRegister() { debug_reg_mutex_.unlock(); rtError_t rt_ret = RT_ERROR_NONE; if (rt_model_handle_ != nullptr) { + GELOGD("start call debug_unregister."); rt_ret = rtDebugUnRegister(rt_model_handle_); if (rt_ret != RT_ERROR_NONE) { GELOGW("rtDebugUnRegister failed, ret: 0x%X", rt_ret); @@ -2775,19 +2776,15 @@ Status DavinciModel::DistributeTask() { auto op_index = std::max(model_task_def->task(task_index).kernel().context().op_index(), model_task_def->task(task_index).kernel_ex().op_index()); OpDescPtr op = GetOpByIndex(op_index); - if (op == nullptr) { - GELOGE(PARAM_INVALID, "Op index %u is null, op list size %zu.", op_index, op_list_.size()); - return PARAM_INVALID; - } + GE_CHECK_NOTNULL(op); SaveDumpOpInfo(runtime_param_, op, task->GetTaskID(), task->GetStreamId()); if (reinterpret_cast(task->GetDumpArgs()) != nullptr) { bool call_dump = GetDumpProperties().IsLayerNeedDump(name_, om_name_, op->GetName()) && task->CallSaveDumpInfo(); - if (call_dump) { + if (call_dump || is_op_debug_reg_) { SaveDumpTask(task->GetTaskID(), task->GetStreamId(), op, task->GetDumpArgs()); } } - // get op_name by task_index if (task->GetCtx() != nullptr) { auto iter = op_name_map_.find(task_index); diff --git a/src/ge/graph/load/new_model_manager/davinci_model.h b/src/ge/graph/load/new_model_manager/davinci_model.h index 438fe639..3ab0cb6d 100644 --- a/src/ge/graph/load/new_model_manager/davinci_model.h +++ b/src/ge/graph/load/new_model_manager/davinci_model.h @@ -410,6 +410,8 @@ class DavinciModel { void DisableZeroCopy(const void *addr); + bool GetOpDugReg() const { return is_op_debug_reg_; } + /// /// @ingroup ge /// @brief Save outside address of Data or NetOutput used info for ZeroCopy. diff --git a/src/ge/graph/load/new_model_manager/task_info/kernel_ex_task_info.cc b/src/ge/graph/load/new_model_manager/task_info/kernel_ex_task_info.cc index 4f72ec36..b21a9dc5 100644 --- a/src/ge/graph/load/new_model_manager/task_info/kernel_ex_task_info.cc +++ b/src/ge/graph/load/new_model_manager/task_info/kernel_ex_task_info.cc @@ -171,6 +171,10 @@ Status KernelExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin dump_flag_ = RT_KERNEL_DUMPFLAG; dump_args_ = input_output_addr_; } + if (davinci_model_->GetOpDugReg()) { + GELOGI("Op debug is open in kernel ex task info"); + dump_args_ = input_output_addr_; + } } uint64_t input_output_addr = static_cast(reinterpret_cast(input_output_addr_)); diff --git a/src/ge/graph/load/new_model_manager/task_info/kernel_task_info.cc b/src/ge/graph/load/new_model_manager/task_info/kernel_task_info.cc index 3964e0d5..e3447167 100644 --- a/src/ge/graph/load/new_model_manager/task_info/kernel_task_info.cc +++ b/src/ge/graph/load/new_model_manager/task_info/kernel_task_info.cc @@ -637,6 +637,8 @@ Status KernelTaskInfo::InitTVMTask(uint16_t offset, const domi::KernelDef &kerne } dump_args_ = static_cast(args_) + offset; } + GE_CHK_BOOL_TRUE_EXEC_INFO(davinci_model_->GetOpDugReg(), dump_args_ = static_cast(args_) + offset, + "Op debug is open in TVM task info"); Status ge_ret = UpdateL2Data(kernel_def); // update origin l2 data @@ -936,6 +938,10 @@ Status KernelTaskInfo::InitAicpuTask(uint32_t op_index, const domi::KernelDef &k } dump_args_ = static_cast(args_) + sizeof(aicpu::AicpuParamHead); } + if (davinci_model_->GetOpDugReg()) { + GELOGI("Op debug is open in aicpu task info"); + dump_args_ = static_cast(args_) + sizeof(aicpu::AicpuParamHead); + } if (kernel_type_ == cce::ccKernelType::CUST_AI_CPU) { dump_flag_ |= RT_KERNEL_CUSTOM_AICPU; } diff --git a/src/ge/graph/manager/util/hcom_util.h b/src/ge/graph/manager/util/hcom_util.h index 064058f8..ad2e3406 100644 --- a/src/ge/graph/manager/util/hcom_util.h +++ b/src/ge/graph/manager/util/hcom_util.h @@ -35,17 +35,14 @@ using std::string; using std::vector; static std::map kConstOpHcclDataType = { - {ge::DT_FLOAT, HCCL_DATA_TYPE_FP32}, - {ge::DT_FLOAT16, HCCL_DATA_TYPE_FP16}, - {ge::DT_INT8, HCCL_DATA_TYPE_INT8}, - {ge::DT_INT32, HCCL_DATA_TYPE_INT32}, + {ge::DT_FLOAT, HCCL_DATA_TYPE_FP32}, {ge::DT_FLOAT16, HCCL_DATA_TYPE_FP16}, {ge::DT_INT8, HCCL_DATA_TYPE_INT8}, + {ge::DT_INT32, HCCL_DATA_TYPE_INT32}, {ge::DT_INT64, HCCL_DATA_TYPE_INT64}, {ge::DT_UINT64, HCCL_DATA_TYPE_UINT64}, }; static std::map kConstOpHcclDataTypeSize = { - {HCCL_DATA_TYPE_FP32, sizeof(float)}, - {HCCL_DATA_TYPE_FP16, sizeof(float) / 2}, - {HCCL_DATA_TYPE_INT8, sizeof(int8_t)}, - {HCCL_DATA_TYPE_INT32, sizeof(int32_t)}, + {HCCL_DATA_TYPE_FP32, sizeof(float)}, {HCCL_DATA_TYPE_FP16, sizeof(float) / 2}, + {HCCL_DATA_TYPE_INT8, sizeof(int8_t)}, {HCCL_DATA_TYPE_INT32, sizeof(int32_t)}, + {HCCL_DATA_TYPE_INT64, sizeof(int64_t)}, {HCCL_DATA_TYPE_UINT64, sizeof(uint64_t)}, }; static std::map kHorovodRedOpToHcclRedOp = { diff --git a/src/ge/graph/optimize/graph_optimize.h b/src/ge/graph/optimize/graph_optimize.h index 3d2db782..15ae94eb 100644 --- a/src/ge/graph/optimize/graph_optimize.h +++ b/src/ge/graph/optimize/graph_optimize.h @@ -60,7 +60,7 @@ class GraphOptimize { const std::map> &GetSummaryOutputIndexes() const { return summary_output_indexes_; - } // lint !e1073 + } // handle summary node before preRun graph Status HandleSummaryOp(ComputeGraphPtr &compute_graph); diff --git a/third_party/fwkacllib/inc/hccl/hccl_types.h b/third_party/fwkacllib/inc/hccl/hccl_types.h index 276516e7..adeda471 100644 --- a/third_party/fwkacllib/inc/hccl/hccl_types.h +++ b/third_party/fwkacllib/inc/hccl/hccl_types.h @@ -81,6 +81,8 @@ typedef enum { HCCL_DATA_TYPE_INT32 = 2, /**< int32 */ HCCL_DATA_TYPE_FP16 = 3, /**< fp16 */ HCCL_DATA_TYPE_FP32 = 4, /**< fp32 */ + HCCL_DATA_TYPE_INT64 = 5, /**< int64 */ + HCCL_DATA_TYPE_UINT64 = 6, /**< uint64 */ HCCL_DATA_TYPE_RESERVED /**< reserved */ } HcclDataType; diff --git a/third_party/fwkacllib/inc/mmpa/mmpa_api.h b/third_party/fwkacllib/inc/mmpa/mmpa_api.h index ce1c9720..f1e30538 100644 --- a/third_party/fwkacllib/inc/mmpa/mmpa_api.h +++ b/third_party/fwkacllib/inc/mmpa/mmpa_api.h @@ -20,7 +20,7 @@ #define LINUX 0 #define WIN 1 -#if(OS_TYPE == LINUX) //lint !e553 +#if(OS_TYPE == LINUX) #ifndef _GNU_SOURCE #define _GNU_SOURCE @@ -84,7 +84,7 @@ #endif -#if(OS_TYPE == WIN) //lint !e553 +#if(OS_TYPE == WIN) #include #include #include "Windows.h" diff --git a/third_party/fwkacllib/inc/ops/hcom_ops.h b/third_party/fwkacllib/inc/ops/hcom_ops.h index 7e985efc..0c9d49a8 100644 --- a/third_party/fwkacllib/inc/ops/hcom_ops.h +++ b/third_party/fwkacllib/inc/ops/hcom_ops.h @@ -41,8 +41,8 @@ namespace ge { as the name of a world group. */ REG_OP(HcomAllGather) - .INPUT(x, TensorType({DT_FLOAT, DT_INT32, DT_INT8, DT_INT16, DT_FLOAT16})) - .OUTPUT(y, TensorType({DT_FLOAT, DT_INT32, DT_INT8, DT_INT16, DT_FLOAT16})) + .INPUT(x, TensorType({DT_FLOAT, DT_INT32, DT_INT8, DT_INT16, DT_FLOAT16, DT_INT64, DT_UINT64})) + .OUTPUT(y, TensorType({DT_FLOAT, DT_INT32, DT_INT8, DT_INT16, DT_FLOAT16, DT_INT64, DT_UINT64})) .REQUIRED_ATTR(rank_size, Int) .REQUIRED_ATTR(group, String) .ATTR(alpha, Float, 1.0) @@ -99,8 +99,8 @@ REG_OP(HcomAllReduce) as the name of a world group. */ REG_OP(HcomBroadcast) - .DYNAMIC_INPUT(x, TensorType({DT_FLOAT, DT_INT32, DT_INT8, DT_INT16, DT_FLOAT16})) - .DYNAMIC_OUTPUT(y, TensorType({DT_FLOAT, DT_INT32, DT_INT8, DT_INT16, DT_FLOAT16})) + .DYNAMIC_INPUT(x, TensorType({DT_FLOAT, DT_INT32, DT_INT8, DT_INT16, DT_FLOAT16, DT_INT64, DT_UINT64})) + .DYNAMIC_OUTPUT(y, TensorType({DT_FLOAT, DT_INT32, DT_INT8, DT_INT16, DT_FLOAT16, DT_INT64, DT_UINT64})) .REQUIRED_ATTR(root_rank, Int) .REQUIRED_ATTR(group, String) .ATTR(alpha, Float, 1.0) diff --git a/third_party/fwkacllib/inc/ops/nn_detect_ops.h b/third_party/fwkacllib/inc/ops/nn_detect_ops.h index bd8bb9bf..2dac459e 100644 --- a/third_party/fwkacllib/inc/ops/nn_detect_ops.h +++ b/third_party/fwkacllib/inc/ops/nn_detect_ops.h @@ -912,6 +912,9 @@ and the actual image height and width. *@see Yolo() *@par Third-party framework compatibility * It is a custom operator. It has no corresponding operator in Caffe. + +* @par Restrictions: +* Warning: THIS FUNCTION IS DEPRECATED. Please use YoloV3DetectionOutputV2 instead. */ REG_OP(YoloV3DetectionOutputV2D) .DYNAMIC_INPUT(x, TensorType({DT_FLOAT16,DT_FLOAT})) diff --git a/third_party/fwkacllib/inc/ops/pad_ops.h b/third_party/fwkacllib/inc/ops/pad_ops.h index 567bc63d..099adf4c 100644 --- a/third_party/fwkacllib/inc/ops/pad_ops.h +++ b/third_party/fwkacllib/inc/ops/pad_ops.h @@ -233,6 +233,9 @@ REG_OP(PadV3) *@par Third-party framework compatibility: * Compatible with ONNX operator Pad. + +* @par Restrictions: +* Warning: THIS FUNCTION IS DEPRECATED. Please use PadV3 instead. */ REG_OP(PadV3D) .INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT8, DT_UINT8})) diff --git a/third_party/fwkacllib/inc/ops/random_ops.h b/third_party/fwkacllib/inc/ops/random_ops.h index 24a9edd1..bc2e98a9 100644 --- a/third_party/fwkacllib/inc/ops/random_ops.h +++ b/third_party/fwkacllib/inc/ops/random_ops.h @@ -408,6 +408,25 @@ REG_OP(LinSpace) .OUTPUT(output, TensorType({DT_FLOAT, DT_DOUBLE})) .OP_END_FACTORY_REG(LinSpace) + + +/** +*@brief The dropout operator randomly sets (according to the given dropout probability) +*the outputs of some units to zero, while others are remain unchanged. . \n + +*@par Inputs: +*One input, including: +*@li x:The input tensor variable. The data type is float32. \n + +*@par Attributes: +*@li dropout_ratio:Float between 0 and 1. Fraction of the input units to drop.Defaults to "0.5". +*@li scale_train: Bool,default to true. +*@li alpha: An optional float32. A scaling factor. Defaults to "1.0". +*@li beta: An optional float32. An exponent. Defaults to "0.0". \n + +*@par Outputs: +*y: A Variable holding Tensor representing the dropout, has same shape and data type with x. \n +*/ REG_OP(Dropout) .INPUT(x, TensorType{DT_FLOAT}) .OUTPUT(y, TensorType{DT_FLOAT}) diff --git a/third_party/fwkacllib/inc/ops/selection_ops.h b/third_party/fwkacllib/inc/ops/selection_ops.h index 8ef4a42c..0fe0e94e 100644 --- a/third_party/fwkacllib/inc/ops/selection_ops.h +++ b/third_party/fwkacllib/inc/ops/selection_ops.h @@ -903,6 +903,9 @@ REG_OP(ScatterNd) *@li "y" has the same type as "x". *@par Third-party framework compatibility * Compatible with the TensorFlow operator ScatterNd. + +* @par Restrictions: +* Warning: THIS FUNCTION IS DEPRECATED. Please use ScatterNd instead. */ REG_OP(ScatterNdD) .INPUT(indices, TensorType::IndexNumberType()) @@ -1146,6 +1149,9 @@ REG_OP(Cumprod) *y: A Tensor. Has the same type as "x". *@par Third-party framework compatibility * Compatible with the TensorFlow operator Cumprod. + +* @par Restrictions: +* Warning: THIS FUNCTION IS DEPRECATED. Please use Cumprod instead. */ REG_OP(CumprodD) .INPUT(x, TensorType::NumberType()) @@ -1200,6 +1206,9 @@ REG_OP(Cumsum) *y: A Tensor. Has the same type as "x". *@par Third-party framework compatibility * Compatible with the TensorFlow operator Cumsum. + +* @par Restrictions: +* Warning: THIS FUNCTION IS DEPRECATED. Please use Cumsum instead. */ REG_OP(CumsumD) .INPUT(x, TensorType::NumberType()) diff --git a/third_party/fwkacllib/inc/register/op_kernel_registry.h b/third_party/fwkacllib/inc/register/op_kernel_registry.h index 5fed8960..2c479e92 100644 --- a/third_party/fwkacllib/inc/register/op_kernel_registry.h +++ b/third_party/fwkacllib/inc/register/op_kernel_registry.h @@ -41,7 +41,6 @@ class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY OpKernelRegistry { private: OpKernelRegistry(); class OpKernelRegistryImpl; - /*lint -e148*/ std::unique_ptr impl_; }; } // namespace ge diff --git a/third_party/fwkacllib/inc/runtime/dev.h b/third_party/fwkacllib/inc/runtime/dev.h index 0bff548b..dddb1e10 100644 --- a/third_party/fwkacllib/inc/runtime/dev.h +++ b/third_party/fwkacllib/inc/runtime/dev.h @@ -339,6 +339,23 @@ RTS_API rtError_t rtGetPairDevicesInfo(uint32_t devId, uint32_t otherDevId, int3 * @return RT_ERROR_NONE for ok */ RTS_API rtError_t rtGetRtCapability(rtFeatureType_t featureType, int32_t featureInfo, int64_t *value); + +/** + * @ingroup dvrt_dev + * @brief set target device for current thread + * @param [int] device the device id + * @return RT_ERROR_NONE for ok + * @return RT_ERROR_INVALID_VALUE for error input + */ +RTS_API rtError_t rtSetDeviceWithoutTsd(int32_t device); + +/** + * @ingroup dvrt_dev + * @brief reset all opened device + * @return RT_ERROR_NONE for ok + * @return RT_ERROR_INVALID_VALUE for error input + */ +RTS_API rtError_t rtDeviceResetWithoutTsd(int32_t device); #if defined(__cplusplus) && !defined(COMPILE_OMG_PACKAGE) } #endif diff --git a/third_party/fwkacllib/inc/runtime/mem.h b/third_party/fwkacllib/inc/runtime/mem.h index a506e94a..035e1354 100644 --- a/third_party/fwkacllib/inc/runtime/mem.h +++ b/third_party/fwkacllib/inc/runtime/mem.h @@ -17,9 +17,7 @@ #ifndef __CCE_RUNTIME_MEM_H__ #define __CCE_RUNTIME_MEM_H__ -/*lint -e7*/ #include -/*lint +e7*/ #include "base.h" #include "config.h" #include "stream.h" diff --git a/third_party/fwkacllib/inc/toolchain/prof_acl_api.h b/third_party/fwkacllib/inc/toolchain/prof_acl_api.h index 4f216239..c8715041 100644 --- a/third_party/fwkacllib/inc/toolchain/prof_acl_api.h +++ b/third_party/fwkacllib/inc/toolchain/prof_acl_api.h @@ -152,4 +152,13 @@ MSVP_PROF_API int32_t ProfStopProfiling(const ProfConfig *profStopCfg); */ MSVP_PROF_API int32_t ProfFinalize(); +/** + * @name ProfGetDataTypeConfig + * @brief get dataTypeConfig started with of one device + * @param deviceId [IN] deviceId to get dataTypeConfig + * @param dataTypeConfig [OUT] result get + * @return ProfErrorCode + */ +MSVP_PROF_API int32_t ProfGetDataTypeConfig(uint32_t deviceId, uint64_t &dataTypeConfig); + #endif // MSPROF_ENGINE_PROF_ACL_API_H_