@@ -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}) | |||
@@ -43,10 +43,10 @@ class OpsKernelInfoStore { | |||
virtual ~OpsKernelInfoStore() {} | |||
// initialize opsKernelInfoStore | |||
virtual Status Initialize(const map<string, string> &options) = 0; /*lint -e148*/ | |||
virtual Status Initialize(const map<string, string> &options) = 0; | |||
// close opsKernelInfoStore | |||
virtual Status Finalize() = 0; /*lint -e148*/ | |||
virtual Status Finalize() = 0; | |||
virtual Status CreateSession(const std::map<std::string, std::string> &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<domi::TaskDef> &tasks) = 0; /*lint -e148*/ | |||
virtual Status GenerateTask(const Node &node, RunContext &context, std::vector<domi::TaskDef> &tasks) = 0; | |||
// only call fe engine interface to compile single op | |||
virtual Status CompileOp(vector<ge::NodePtr> &node_vec) { return SUCCESS; } | |||
@@ -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<rtLabel_t> 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 | |||
@@ -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_ |
@@ -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_ |
@@ -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_ |
@@ -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<const Node> GetNode() const; | |||
}; | |||
/*lint +e148*/ | |||
} // namespace ge | |||
#endif // INC_EXTERNAL_GRAPH_OPERATOR_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_ |
@@ -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_ |
@@ -301,7 +301,6 @@ class GE_FUNC_HOST_VISIBILITY GE_FUNC_DEV_VISIBILITY ScopeFusionPassRegistry { | |||
private: | |||
ScopeFusionPassRegistry(); | |||
class ScopeFusionPassRegistryImpl; | |||
/*lint -e148*/ | |||
std::unique_ptr<ScopeFusionPassRegistryImpl> impl_; | |||
friend class TensorFlowModelParser; | |||
}; | |||
@@ -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_ | |||
@@ -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<std::string> Split(const std::string &str, char delim) { | |||
std::vector<std::string> elems; | |||
/*lint +e1077*/ | |||
if (str.empty()) { | |||
elems.emplace_back(""); | |||
@@ -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; | |||
@@ -84,7 +84,6 @@ class ComputeGraph : public std::enable_shared_from_this<ComputeGraph>, 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<ComputeGraph>, public A | |||
graphStatus InsertEventNodes(); | |||
bool operator==(const ComputeGraph &r_compute_graph) const; | |||
/*lint +e504*/ | |||
const std::map<std::vector<std::string>, std::vector<std::string>> &GetShareParamLayer() const { | |||
return params_share_map_; | |||
} | |||
@@ -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*/ |
@@ -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_; | |||
}; | |||
@@ -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 <class ProtoType> | |||
@@ -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<string> GetAllAttrNames() const; | |||
const std::map<string, GeAttrValue> GetAllAttrs() const; // lint !e1073 | |||
const std::map<string, GeAttrValue> GetAllAttrs() const; | |||
virtual ProtoAttrMapHelper MutableAttrMap() = 0; | |||
virtual ConstProtoAttrMapHelper GetAttrMap() const = 0; | |||
@@ -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<GeAttrValue::STR>) | |||
VALUE_SET_GET_DEC(vector<GeAttrValue::INT>) | |||
VALUE_SET_GET_DEC(vector<GeAttrValue::FLOAT>) | |||
@@ -320,8 +320,8 @@ class GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY GeAttrValue { | |||
VALUE_SET_GET_DEC(vector<GeAttrValue::GRAPH>) | |||
VALUE_SET_GET_DEC(vector<GeAttrValue::BYTES>) | |||
VALUE_SET_GET_DEC(vector<NamedAttrs>) | |||
VALUE_SET_GET_DEC(vector<vector<int64_t>>) // lint !e665 | |||
VALUE_SET_GET_DEC(vector<ge::DataType>) // lint !e665 | |||
VALUE_SET_GET_DEC(vector<vector<int64_t>>) | |||
VALUE_SET_GET_DEC(vector<ge::DataType>) | |||
#undef VALUE_SET_GET_DEC | |||
GeIrProtoHelper<proto::AttrDef> value_; | |||
@@ -193,7 +193,7 @@ class Node : public std::enable_shared_from_this<Node> { | |||
vector<OutDataAnchorPtr> out_data_anchors_; | |||
InControlAnchorPtr in_control_anchor_; | |||
OutControlAnchorPtr out_control_anchor_; | |||
map<string, GeAttrValue> attrs_; // lint !e1073 | |||
map<string, GeAttrValue> attrs_; | |||
bool has_init_{false}; | |||
bool host_node_{false}; | |||
bool anchor_status_updated_{false}; | |||
@@ -22,10 +22,8 @@ | |||
template <class E, class O> | |||
class RangeVistor { | |||
public: | |||
/*lint -e151*/ | |||
using Iterator = typename std::vector<E>::iterator; | |||
using ConstIterator = typename std::vector<E>::const_iterator; | |||
/*lint +e151*/ | |||
RangeVistor(O owner, const std::vector<E> &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); } | |||
@@ -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<GeAttrValue::STR>) | |||
ATTR_VALUE_SET_GET_IMP(GeAttrValue::INT) | |||
ATTR_VALUE_SET_GET_IMP(vector<GeAttrValue::INT>) | |||
ATTR_VALUE_SET_GET_IMP(GeAttrValue::FLOAT) // lint !e524 | |||
ATTR_VALUE_SET_GET_IMP(GeAttrValue::FLOAT) | |||
ATTR_VALUE_SET_GET_IMP(vector<GeAttrValue::FLOAT>) | |||
ATTR_VALUE_SET_GET_IMP(GeAttrValue::BOOL) | |||
ATTR_VALUE_SET_GET_IMP(vector<GeAttrValue::BOOL>) | |||
@@ -253,11 +252,9 @@ ATTR_VALUE_SET_GET_IMP(GeAttrValue::BYTES) | |||
ATTR_VALUE_SET_GET_IMP(vector<GeAttrValue::BYTES>) | |||
ATTR_VALUE_SET_GET_IMP(GeAttrValue::NAMED_ATTRS) | |||
ATTR_VALUE_SET_GET_IMP(vector<GeAttrValue::NAMED_ATTRS>) | |||
/*lint -e665*/ | |||
ATTR_VALUE_SET_GET_IMP(vector<vector<int64_t>>) | |||
/*lint +e665*/ | |||
ATTR_VALUE_SET_GET_IMP(vector<DataType>) // lint !e665 | |||
ATTR_VALUE_SET_GET_IMP(GeAttrValue::DATA_TYPE) // lint !e665 | |||
ATTR_VALUE_SET_GET_IMP(vector<DataType>) | |||
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<vector<int64_t>>) | |||
/*lint +e665*/ | |||
ATTR_UTILS_SET_GET_IMP(ListInt, vector<int64_t>) | |||
ATTR_UTILS_SET_IMP(ListInt, vector<int32_t>) | |||
@@ -989,8 +984,8 @@ ATTR_UTILS_SET_IMP(ListTensor, vector<GeTensor>) | |||
ATTR_UTILS_SET_GET_IMP(ListNamedAttrs, vector<GeAttrValue::NAMED_ATTRS>) | |||
ATTR_UTILS_SET_GET_IMP(ListBytes, vector<Buffer>) | |||
ATTR_UTILS_SET_GET_IMP(ListGraph, vector<ComputeGraphPtr>) | |||
ATTR_UTILS_SET_GET_IMP(ListDataType, vector<ge::DataType>) // lint !e665 | |||
ATTR_UTILS_SET_GET_IMP(DataType, ge::DataType) // lint !e665 | |||
ATTR_UTILS_SET_GET_IMP(ListDataType, vector<ge::DataType>) | |||
ATTR_UTILS_SET_GET_IMP(DataType, ge::DataType) | |||
bool AttrUtils::SetListTensor(AttrHolderAdapter &&obj, const string &name, | |||
std::initializer_list<ConstGeTensorPtr> &&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<proto::OpDef>(); | |||
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()); | |||
@@ -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."); | |||
} | |||
} | |||
} | |||
@@ -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"; | |||
@@ -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<vector<int64_t>> &, ListListInt) | |||
OP_ATTR_SET_IMP(float, Float) | |||
OP_ATTR_GET_IMP(float &, Float) | |||
OP_ATTR_SET_IMP(const vector<float> &, ListFloat) | |||
OP_ATTR_GET_IMP(vector<float> &, ListFloat) // lint !e665 | |||
OP_ATTR_GET_IMP(vector<float> &, ListFloat) | |||
OP_ATTR_SET_IMP(bool, Bool) | |||
OP_ATTR_GET_IMP(bool &, Bool) | |||
OP_ATTR_SET_IMP(const vector<bool> &, ListBool) | |||
OP_ATTR_GET_IMP(vector<bool> &, ListBool) // lint !e665 | |||
OP_ATTR_GET_IMP(vector<bool> &, ListBool) | |||
OP_ATTR_SET_IMP(const string &, Str) | |||
OP_ATTR_GET_IMP(string &, Str) | |||
OP_ATTR_SET_IMP(const vector<string> &, ListStr) | |||
OP_ATTR_GET_IMP(vector<string> &, ListStr) // lint !e665 | |||
OP_ATTR_GET_IMP(vector<string> &, ListStr) | |||
OP_ATTR_SET_IMP(const GeAttrValue::NAMED_ATTRS &, NamedAttrs) | |||
OP_ATTR_GET_IMP(GeAttrValue::NAMED_ATTRS &, NamedAttrs) | |||
OP_ATTR_SET_IMP(const vector<GeAttrValue::NAMED_ATTRS> &, ListNamedAttrs) | |||
OP_ATTR_GET_IMP(vector<GeAttrValue::NAMED_ATTRS> &, ListNamedAttrs) // lint !e665 | |||
OP_ATTR_GET_IMP(vector<GeAttrValue::NAMED_ATTRS> &, ListNamedAttrs) | |||
OP_ATTR_REG_IMP(int64_t, Int) | |||
OP_ATTR_REG_IMP(const vector<int64_t> &, ListInt) | |||
@@ -1583,5 +1580,3 @@ void GraphUtils::BreakConnect(const std::map<OperatorImplPtr, NodePtr> &all_node | |||
} | |||
} | |||
} // namespace ge | |||
/*lint +e446 +e732*/ | |||
/*lint +e665*/ |
@@ -38,9 +38,7 @@ bool OpsProtoManager::Initialize(const std::map<std::string, std::string> &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; | |||
@@ -178,18 +178,16 @@ int64_t Shape::GetShapeSize() const { | |||
return 0; | |||
} | |||
TensorDesc::TensorDesc() { | |||
impl = ComGraphMakeShared<TensorDescImpl>(); // lint !e665 | |||
} | |||
TensorDesc::TensorDesc() { impl = ComGraphMakeShared<TensorDescImpl>(); } | |||
TensorDesc::TensorDesc(Shape shape, Format format, DataType dt) { | |||
impl = ComGraphMakeShared<TensorDescImpl>(shape, format, dt); // lint !e665 | |||
impl = ComGraphMakeShared<TensorDescImpl>(shape, format, dt); | |||
SetRealDimCnt(shape.GetDimNum()); | |||
} | |||
TensorDesc::TensorDesc(const TensorDesc &desc) { | |||
// Copy | |||
impl = ComGraphMakeShared<TensorDescImpl>(); // lint !e665 | |||
impl = ComGraphMakeShared<TensorDescImpl>(); | |||
if (desc.impl != nullptr && impl != nullptr) { | |||
*impl = *desc.impl; | |||
} | |||
@@ -360,9 +358,7 @@ void TensorDesc::SetName(const std::string &name) { | |||
Tensor::Tensor() { impl = ComGraphMakeShared<TensorImpl>(); } | |||
Tensor::Tensor(const TensorDesc &tensor_desc) { | |||
impl = ComGraphMakeShared<TensorImpl>(tensor_desc); // lint !e665 | |||
} | |||
Tensor::Tensor(const TensorDesc &tensor_desc) { impl = ComGraphMakeShared<TensorImpl>(tensor_desc); } | |||
Tensor::Tensor(const TensorDesc &tensor_desc, const std::vector<uint8_t> &data) { | |||
uint64_t shape_size = tensor_desc.GetShape().GetShapeSize(); | |||
@@ -384,7 +380,7 @@ Tensor::Tensor(const TensorDesc &tensor_desc, const std::vector<uint8_t> &data) | |||
} | |||
} | |||
} | |||
impl = ComGraphMakeShared<TensorImpl>(tensor_desc, data); // lint !e665 | |||
impl = ComGraphMakeShared<TensorImpl>(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<TensorImpl>(tensor_desc, data, size); // lint !e665 | |||
impl = ComGraphMakeShared<TensorImpl>(tensor_desc, data, size); | |||
} | |||
Tensor::Tensor(TensorDesc &&tensor_desc, std::vector<uint8_t> &&data) { | |||
@@ -429,7 +425,7 @@ Tensor::Tensor(TensorDesc &&tensor_desc, std::vector<uint8_t> &&data) { | |||
} | |||
} | |||
} | |||
impl = ComGraphMakeShared<TensorImpl>(std::move(tensor_desc), std::move(data)); // lint !e665 | |||
impl = ComGraphMakeShared<TensorImpl>(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<GeTensor>(tensor.impl->ge_tensor.Clone()); // lint !e665 | |||
ge_tensor = ComGraphMakeShared<GeTensor>(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<GeTensor>(tensor.impl->ge_tensor); // lint !e665 | |||
ge_tensor = ComGraphMakeShared<GeTensor>(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<GeTensor>(tensor.impl->ge_tensor); // lint !e665 | |||
ge_tensor = ComGraphMakeShared<GeTensor>(tensor.impl->ge_tensor); | |||
} | |||
return ge_tensor; | |||
} | |||
@@ -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<QuantizeFactorParams>(quant)); // lint !e732 | |||
return op_desc->SetAttr(OP_DESC_QUANT_PARAMS, GeAttrValue::CreateFrom<QuantizeFactorParams>(quant)); | |||
} | |||
graphStatus OpDescUtils::SetQuantizeFactorParams(OpDesc &op_desc, const QuantizeFactorParams &quant) { | |||
return op_desc.SetAttr(OP_DESC_QUANT_PARAMS, GeAttrValue::CreateFrom<QuantizeFactorParams>(quant)); // lint !e732 | |||
return op_desc.SetAttr(OP_DESC_QUANT_PARAMS, GeAttrValue::CreateFrom<QuantizeFactorParams>(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<int>(index))) == ANCHOR_DATA); // lint !e712 | |||
ret = (ge::AnchorUtils::GetStatus(node.GetInDataAnchor(static_cast<int>(index))) == ANCHOR_DATA); | |||
} else { | |||
for (const auto &anchor : node.GetAllInDataAnchors()) { | |||
if (anchor->GetIdx() != static_cast<int>(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*/ |
@@ -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<string> 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; | |||
} | |||
@@ -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) \ | |||
@@ -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; | |||
} | |||
@@ -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); | |||
@@ -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<void *>(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); | |||
@@ -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. | |||
@@ -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<uint64_t>(reinterpret_cast<uintptr_t>(input_output_addr_)); | |||
@@ -637,6 +637,8 @@ Status KernelTaskInfo::InitTVMTask(uint16_t offset, const domi::KernelDef &kerne | |||
} | |||
dump_args_ = static_cast<char *>(args_) + offset; | |||
} | |||
GE_CHK_BOOL_TRUE_EXEC_INFO(davinci_model_->GetOpDugReg(), dump_args_ = static_cast<char *>(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<char *>(args_) + sizeof(aicpu::AicpuParamHead); | |||
} | |||
if (davinci_model_->GetOpDugReg()) { | |||
GELOGI("Op debug is open in aicpu task info"); | |||
dump_args_ = static_cast<char *>(args_) + sizeof(aicpu::AicpuParamHead); | |||
} | |||
if (kernel_type_ == cce::ccKernelType::CUST_AI_CPU) { | |||
dump_flag_ |= RT_KERNEL_CUSTOM_AICPU; | |||
} | |||
@@ -35,17 +35,14 @@ using std::string; | |||
using std::vector; | |||
static std::map<int64_t, HcclDataType> 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<HcclDataType, int32_t> 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<HorovodReduceOp, HcclReduceOp> kHorovodRedOpToHcclRedOp = { | |||
@@ -60,7 +60,7 @@ class GraphOptimize { | |||
const std::map<uint32_t, std::map<string, size_t>> &GetSummaryOutputIndexes() const { | |||
return summary_output_indexes_; | |||
} // lint !e1073 | |||
} | |||
// handle summary node before preRun graph | |||
Status HandleSummaryOp(ComputeGraphPtr &compute_graph); | |||
@@ -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; | |||
@@ -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 <winsock2.h> | |||
#include <winsock.h> | |||
#include "Windows.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) | |||
@@ -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})) | |||
@@ -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})) | |||
@@ -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}) | |||
@@ -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()) | |||
@@ -41,7 +41,6 @@ class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY OpKernelRegistry { | |||
private: | |||
OpKernelRegistry(); | |||
class OpKernelRegistryImpl; | |||
/*lint -e148*/ | |||
std::unique_ptr<OpKernelRegistryImpl> impl_; | |||
}; | |||
} // namespace ge | |||
@@ -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 | |||
@@ -17,9 +17,7 @@ | |||
#ifndef __CCE_RUNTIME_MEM_H__ | |||
#define __CCE_RUNTIME_MEM_H__ | |||
/*lint -e7*/ | |||
#include <stddef.h> | |||
/*lint +e7*/ | |||
#include "base.h" | |||
#include "config.h" | |||
#include "stream.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_ |