!223 synchronize latest Ascend software suite 5 Nov 2020

Merge pull request !223 from yanghaoran/r1.0.1
pull/223/MERGE
mindspore-ci-bot 4 years ago committed by Gitee
commit 93719ebecd

@ -222,6 +222,18 @@ const char *const OPTION_GE_MAX_DUMP_OP_NUM = "ge.maxDumpOpNum";
// Its value should be "0" or "1", default value is "1"
const char *const ENABLE_PRINT_OP_PASS = "ge.enablePrintOpPass";
// Configure operator compilation path
// Its value should be file path, default value is "./"
const char *const DEBUG_DIR = "ge.debugDir";
// Configure operator compiler cache path
// Its value should be file path, default value is "./"
const char *const OP_COMPILER_CACHE_DIR = "ge.op_compiler_cache_dir";
// Configure operator compiler cache mode
// Its value should be "disable", "enable" or "force", default value is "disable"
const char *const OP_COMPILER_CACHE_MODE = "ge.op_compiler_cache_mode";
// Configure whether to use single stream.
// Its value should be "true" or "false", default value is "false"
const char *const ENABLE_SINGLE_STREAM = "ge.enableSingleStream";
@ -295,7 +307,9 @@ static const char *const OUT_NODES = ge::OUTPUT_NODE_NAME.c_str();
static const char *const INPUT_FP16_NODES = ge::INPUT_FP16_NODES.c_str();
static const char *const LOG_LEVEL = "log";
static const char *const OPTYPELIST_FOR_IMPLMODE = ge::OPTYPELIST_FOR_IMPLMODE.c_str();
static const char *const DEBUG_DIR = ge::DEBUG_DIR;
static const char *const OP_COMPILER_CACHE_DIR = ge::OP_COMPILER_CACHE_DIR;
static const char *const OP_COMPILER_CACHE_MODE = ge::OP_COMPILER_CACHE_MODE;
// for interface: aclgrphBuildModel
const std::set<std::string> ir_builder_suppported_options = {
INPUT_FORMAT, INPUT_SHAPE, OP_NAME_MAP,
@ -317,7 +331,10 @@ const std::set<std::string> global_options = {CORE_TYPE,
FUSION_SWITCH_FILE,
ENABLE_SMALL_CHANNEL,
OP_SELECT_IMPL_MODE,
OPTYPELIST_FOR_IMPLMODE};
OPTYPELIST_FOR_IMPLMODE,
DEBUG_DIR,
OP_COMPILER_CACHE_DIR,
OP_COMPILER_CACHE_MODE};
} // namespace ir_option
} // namespace ge

@ -116,9 +116,9 @@ class GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY GNode {
bool HasAttr(const ge::AscendString &name);
graphStatus GetSubgraph(uint32_t index, GraphPtr graph) const;
graphStatus GetSubgraph(uint32_t index, GraphPtr &graph) const;
graphStatus GetALLSubgraphs(std::vector<GraphPtr> graph_list) const;
graphStatus GetALLSubgraphs(std::vector<GraphPtr> &graph_list) const;
private:
std::shared_ptr<NodeImpl> impl_;

@ -449,6 +449,7 @@ REGISTER_OPTYPE_DECLARE(MEMCPYASYNC, "MemcpyAsync");
REGISTER_OPTYPE_DECLARE(MEMCPYADDRASYNC, "MemcpyAddrAsync");
REGISTER_OPTYPE_DECLARE(STREAMMERGE, "StreamMerge");
REGISTER_OPTYPE_DECLARE(ENDGRAPH, "EndGraph");
REGISTER_OPTYPE_DECLARE(MODELEXIT, "ModelExit");
REGISTER_OPTYPE_DECLARE(SEND, "Send");
REGISTER_OPTYPE_DECLARE(RECV, "Recv");
REGISTER_OPTYPE_DECLARE(ENDOFSEQUENCE, "EndOfSequence");

@ -100,6 +100,8 @@ struct OmgContext {
std::vector<std::string> net_out_nodes;
// net out nodes top names(only caffe has top)
std::vector<std::string> out_top_names;
// net data nodes top names(only caffe has top)
std::vector<std::string> data_top_names;
// preferential format used by the entire network
domiTensorFormat_t net_format = DOMI_TENSOR_RESERVED;
domi::FrameworkType type = domi::FRAMEWORK_RESERVED;

@ -187,6 +187,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string ATTR_MOD
GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string ATTR_NAME_AUTOMIC_ADD_START;
GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string ATTR_NAME_AUTOMIC_ADD_MEM_SIZE;
GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string ATTR_NAME_STREAM_LABEL;
GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string ATTR_NAME_RTS_LABEL_NODE;
GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string ATTR_NAME_STREAM_CYCLE_EVENT_FLAG;
GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string ATTR_NAME_DYNAMIC_OUTPUT_DIMS;
@ -778,8 +779,6 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string ATTR_NAM
GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string ATTR_MODEL_TASK_GEN_VAR_ADDR;
GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string ATTR_NAME_STREAM_LABEL;
GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string ATTR_NAME_CONTINUOUS_STREAM_LABEL;
GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY extern const std::string ATTR_MODEL_VAR_SIZE;

@ -95,6 +95,7 @@ class Node : public std::enable_shared_from_this<Node> {
ComputeGraphPtr GetOwnerComputeGraph() const;
graphStatus SetOwnerComputeGraph(const ComputeGraphPtr &graph);
graphStatus SetAnyOwnerComputeGraph(const ComputeGraphPtr &graph);
Vistor<InDataAnchorPtr> GetAllInDataAnchors() const;
Vistor<OutDataAnchorPtr> GetAllOutDataAnchors() const;

@ -141,6 +141,8 @@ class GraphUtils {
static Graph CreateGraphFromComputeGraph(const ComputeGraphPtr compute_graph);
static GraphPtr CreateGraphPtrFromComputeGraph(const ComputeGraphPtr compute_graph);
static graphStatus RecoverGraphOperators(const Graph &graph);
static ComputeGraphPtr CreateGraphFromOperator(const string &name, const std::vector<Operator> &inputs);

@ -157,6 +157,7 @@ const std::string ATTR_NAME_WEIGHTS_DATA = "weights_data";
const std::string ATTR_NAME_BROACAST_REAL_DIM_CNT = "broacast_real_dim_cnt";
const std::string ATTR_NAME_DIM_ALIGN = "dim_align";
const std::string ATTR_NAME_STREAM_LABEL = "_stream_label";
const std::string ATTR_NAME_RTS_LABEL_NODE = "_rts_label_node";
const std::string ATTR_NAME_CONTINUOUS_STREAM_LABEL = "_continuous_stream_label";
const std::string ATTR_NAME_STREAM_CYCLE_EVENT_FLAG = "need_stream_cycle_event";
const std::string ATTR_NAME_RTSWITCH_RECV_EVENT_ID = "rtswitch_event_id";

@ -25,6 +25,7 @@
#include "graph/utils/tensor_adapter.h"
#include <graph/utils/graph_utils.h>
#include "graph/debug/ge_attr_define.h"
#include "graph/debug/ge_op_types.h"
#include "utils/node_utils.h"
#include "utils/op_desc_utils.h"
@ -264,20 +265,34 @@ graphStatus GNode::GetInputConstData(const int32_t index, Tensor &data) const {
}
NodePtr input_data_node = NodeUtils::GetInDataNodeByIndex(*node_ptr, index);
bool is_const = NodeUtils::IsConst(*input_data_node);
if (!is_const) {
GELOGE(GRAPH_NODE_WITHOUT_CONST_INPUT, "Node[%s] has no const input.", node_ptr->GetName().c_str());
return GRAPH_NODE_WITHOUT_CONST_INPUT;
}
Operator const_op = OpDescUtils::CreateOperatorFromNode(input_data_node);
if (const_op.GetAttr(ATTR_NAME_WEIGHTS, data) != GRAPH_SUCCESS) {
GELOGE(GRAPH_FAILED, "Input data node[%s] of node[%s] get data failed.", input_data_node->GetName().c_str(),
node_ptr->GetName().c_str());
return GRAPH_FAILED;
GE_CHECK_NOTNULL(input_data_node);
string op_type = input_data_node->GetType();
if (op_type == CONSTANT || op_type == CONSTANTOP) {
Operator const_op = OpDescUtils::CreateOperatorFromNode(input_data_node);
if (const_op.GetAttr(ATTR_NAME_WEIGHTS, data) != GRAPH_SUCCESS) {
GELOGE(GRAPH_FAILED, "Input data node[%s] of node[%s] get data failed.", input_data_node->GetName().c_str(),
node_ptr->GetName().c_str());
return GRAPH_FAILED;
}
return SUCCESS;
} else if (op_type == DATA) {
auto parent_node = NodeUtils::GetParentInput(input_data_node);
while ((parent_node != nullptr) && (parent_node->GetType() == DATA)) {
parent_node = NodeUtils::GetParentInput(parent_node);
}
if ((parent_node != nullptr) && ((parent_node->GetType() == CONSTANT) || (parent_node->GetType() == CONSTANTOP))) {
Operator const_op = OpDescUtils::CreateOperatorFromNode(parent_node);
if (const_op.GetAttr(ATTR_NAME_WEIGHTS, data) != GRAPH_SUCCESS) {
GELOGE(GRAPH_FAILED, "Input data node[%s] of node[%s] get data failed.", parent_node->GetName().c_str(),
node_ptr->GetName().c_str());
return GRAPH_FAILED;
}
return GRAPH_SUCCESS;
}
}
return GRAPH_SUCCESS;
GELOGE(GRAPH_NODE_WITHOUT_CONST_INPUT, "Node[%s] has no const input.", node_ptr->GetName().c_str());
return GRAPH_NODE_WITHOUT_CONST_INPUT;
}
graphStatus GNode::GetInputIndexByName(const ge::AscendString &name, int32_t &index) {
@ -793,7 +808,7 @@ bool GNode::HasAttr(const ge::AscendString &name) {
return true;
}
graphStatus GNode::GetSubgraph(uint32_t index, GraphPtr graph) const {
graphStatus GNode::GetSubgraph(uint32_t index, GraphPtr &graph) const {
if (impl_ == nullptr) {
GELOGE(GRAPH_FAILED, "GetSubgraph: node impl is nullptr.");
return GRAPH_FAILED;
@ -807,20 +822,20 @@ graphStatus GNode::GetSubgraph(uint32_t index, GraphPtr graph) const {
ComputeGraphPtr compute_graph_ptr = NodeUtils::GetSubgraph(*node_ptr, index);
if (compute_graph_ptr == nullptr) {
GELOGE(GRAPH_FAILED, "GetSubgraph: get subgraph[%u] failed form node[%s].", index, node_ptr->GetName().c_str());
GELOGE(GRAPH_FAILED, "GetSubgraph: get subgraph[%u] failed from node[%s].", index, node_ptr->GetName().c_str());
return GRAPH_FAILED;
}
Graph create_graph = GraphUtils::CreateGraphFromComputeGraph(compute_graph_ptr);
graph = std::make_shared<Graph>(create_graph);
graph = GraphUtils::CreateGraphPtrFromComputeGraph(compute_graph_ptr);
if (graph == nullptr) {
GELOGE(GRAPH_FAILED, "GetSubgraph: graph make shared failed form node[%s].", node_ptr->GetName().c_str());
GELOGE(GRAPH_FAILED, "GetSubgraph: get subgraph[%u] failed from node[%s].", index, node_ptr->GetName().c_str());
return GRAPH_FAILED;
}
return GRAPH_SUCCESS;
}
graphStatus GNode::GetALLSubgraphs(std::vector<GraphPtr> graph_list) const {
graphStatus GNode::GetALLSubgraphs(std::vector<GraphPtr> &graph_list) const {
if (impl_ == nullptr) {
GELOGE(GRAPH_FAILED, "GetALLSubgraphs: node impl is nullptr.");
return GRAPH_FAILED;
@ -834,24 +849,27 @@ graphStatus GNode::GetALLSubgraphs(std::vector<GraphPtr> graph_list) const {
std::vector<ComputeGraphPtr> sub_graphs = NodeUtils::GetAllSubgraphs(*node_ptr);
if (sub_graphs.empty()) {
GELOGE(GRAPH_FAILED, "GetALLSubgraphs: get all subgraphs failed form node[%s].", node_ptr->GetName().c_str());
GELOGE(GRAPH_FAILED, "GetALLSubgraphs: get all subgraphs failed from node[%s].", node_ptr->GetName().c_str());
return GRAPH_FAILED;
}
for (auto &sub_graph : sub_graphs) {
if (sub_graph == nullptr) {
GELOGE(GRAPH_FAILED, "Get subgraph failed form node[%s].", node_ptr->GetName().c_str());
GELOGE(GRAPH_FAILED, "Get subgraph failed from node[%s].", node_ptr->GetName().c_str());
return GRAPH_FAILED;
}
Graph create_graph = GraphUtils::CreateGraphFromComputeGraph(sub_graph);
GraphPtr graph = std::make_shared<Graph>(create_graph);
GraphPtr graph = GraphUtils::CreateGraphPtrFromComputeGraph(sub_graph);
if (graph == nullptr) {
GELOGE(GRAPH_FAILED, "Subgraph make shared failed form node[%s].", node_ptr->GetName().c_str());
GELOGE(GRAPH_FAILED, "Subgraph create compute graph failed from node[%s].", node_ptr->GetName().c_str());
return GRAPH_FAILED;
}
graph_list.emplace_back(graph);
}
if (graph_list.empty()) {
GELOGW("Node[%s] has no subgraph.", node_ptr->GetName().c_str());
}
return GRAPH_SUCCESS;
}
} // namespace ge

@ -24,6 +24,7 @@
#include "graph/utils/graph_utils.h"
#include "graph/utils/op_desc_utils.h"
#include "graph/utils/node_adapter.h"
#include "graph/utils/node_utils.h"
using std::map;
using std::pair;
@ -246,6 +247,53 @@ class GraphImpl {
ComputeGraphPtr GetComputeGraph() const { return compute_graph_; }
graphStatus RemoveEdge(NodePtr &src_node_ptr, const int32_t src_port_index, NodePtr &dst_node_ptr,
const int32_t dst_port_index) {
GE_CHECK_NOTNULL(src_node_ptr);
GE_CHECK_NOTNULL(dst_node_ptr);
graphStatus res = GRAPH_FAILED;
if ((src_port_index == -1) && (dst_port_index == -1)) {
if (src_node_ptr->GetOutControlAnchor() == nullptr) {
GELOGE(GRAPH_FAILED, "RemoveEdge: src node[%s] out control anchor is null.", src_node_ptr->GetName().c_str());
return GRAPH_FAILED;
}
res = GraphUtils::RemoveEdge(src_node_ptr->GetOutControlAnchor(), dst_node_ptr->GetInControlAnchor());
if (res != GRAPH_SUCCESS) {
GELOGE(GRAPH_FAILED, "RemoveEdge: remove control edge between [%s] and [%s]failed.",
src_node_ptr->GetName().c_str(), dst_node_ptr->GetName().c_str());
return GRAPH_FAILED;
}
return GRAPH_SUCCESS;
}
if (src_node_ptr->GetOutDataAnchor(src_port_index) == nullptr) {
GELOGE(GRAPH_FAILED, "RemoveEdge: src node[%s] out data anchor[%d] is null.", src_node_ptr->GetName().c_str(),
src_port_index);
return GRAPH_FAILED;
}
if (src_port_index != -1 && dst_port_index == -1) {
res = GraphUtils::RemoveEdge(src_node_ptr->GetOutDataAnchor(src_port_index), dst_node_ptr->GetInControlAnchor());
if (res != GRAPH_SUCCESS) {
GELOGE(GRAPH_FAILED, "RemoveEdge: remove data-control edge between [%s] and [%s]failed.",
src_node_ptr->GetName().c_str(), dst_node_ptr->GetName().c_str());
return GRAPH_FAILED;
}
return GRAPH_SUCCESS;
}
res = GraphUtils::RemoveEdge(src_node_ptr->GetOutDataAnchor(src_port_index),
dst_node_ptr->GetInDataAnchor(dst_port_index));
if (res != GRAPH_SUCCESS) {
GELOGE(GRAPH_FAILED, "RemoveEdge: remove data edge between [%s] and [%s] failed.",
src_node_ptr->GetName().c_str(), dst_node_ptr->GetName().c_str());
return GRAPH_FAILED;
}
return GRAPH_SUCCESS;
}
private:
std::string name_;
std::string output_name_;
@ -392,17 +440,25 @@ graphStatus Graph::RemoveNode(GNode &node) {
return GRAPH_FAILED;
}
if (node_ptr->GetOwnerComputeGraph() == nullptr) {
GELOGE(GRAPH_FAILED, "RemoveNode: node[%s] is invalid.", node_ptr->GetName().c_str());
return GRAPH_FAILED;
}
ComputeGraphPtr compute_graph_ptr = impl_->GetComputeGraph();
if (compute_graph_ptr == nullptr) {
GELOGE(GRAPH_FAILED, "RemoveNde: compute graph ptr is nullptr.");
return GRAPH_FAILED;
}
if (compute_graph_ptr->RemoveNode(node_ptr) != GRAPH_SUCCESS) {
GELOGE(GRAPH_FAILED, "RemoveNde: remove node failed.");
ge::NodeUtils::UnlinkAll(*node_ptr);
if (GraphUtils::RemoveNodeWithoutRelink(compute_graph_ptr, node_ptr) != GRAPH_SUCCESS) {
GELOGE(GRAPH_FAILED, "RemoveNode: remove node[%s] failed.", node_ptr->GetName().c_str());
return GRAPH_FAILED;
}
node_ptr->SetAnyOwnerComputeGraph(nullptr);
return GRAPH_SUCCESS;
}
@ -430,31 +486,21 @@ graphStatus Graph::RemoveEdge(GNode &src_node, const int32_t src_port_index, GNo
return GRAPH_FAILED;
}
graphStatus res = GRAPH_FAILED;
if ((src_port_index == -1) && (dst_port_index == -1)) {
res = GraphUtils::RemoveEdge(src_node_ptr->GetOutControlAnchor(), dst_node_ptr->GetInControlAnchor());
if (res != GRAPH_SUCCESS) {
GELOGE(GRAPH_FAILED, "RemoveEdge: remove control edge failed.");
return GRAPH_FAILED;
}
return GRAPH_SUCCESS;
if (src_node_ptr->GetOwnerComputeGraph() == nullptr) {
GELOGE(GRAPH_FAILED, "RemoveEdge: src node[%s] is invalid.", src_node_ptr->GetName().c_str());
return GRAPH_FAILED;
}
if (src_port_index != -1 && dst_port_index == -1) {
res = GraphUtils::RemoveEdge(src_node_ptr->GetOutDataAnchor(src_port_index), dst_node_ptr->GetInControlAnchor());
if (res != GRAPH_SUCCESS) {
GELOGE(GRAPH_FAILED, "RemoveEdge: remove data-control edge failed.");
return GRAPH_FAILED;
}
return GRAPH_SUCCESS;
if (dst_node_ptr->GetOwnerComputeGraph() == nullptr) {
GELOGE(GRAPH_FAILED, "RemoveEdge: dst node[%s] is invalid.", dst_node_ptr->GetName().c_str());
return GRAPH_FAILED;
}
res = GraphUtils::RemoveEdge(src_node_ptr->GetOutDataAnchor(src_port_index),
dst_node_ptr->GetInDataAnchor(dst_port_index));
if (res != GRAPH_SUCCESS) {
GELOGE(GRAPH_FAILED, "RemoveEdge: remove data edge failed.");
if (impl_->RemoveEdge(src_node_ptr, src_port_index, dst_node_ptr, dst_port_index) != GRAPH_SUCCESS) {
GELOGE(GRAPH_FAILED, "RemoveEdge: remove edge failed.");
return GRAPH_FAILED;
}
return GRAPH_SUCCESS;
}
@ -501,6 +547,16 @@ graphStatus Graph::AddDataEdge(GNode &src_node, const int32_t src_port_index, GN
return GRAPH_FAILED;
}
if (src_node_ptr->GetOwnerComputeGraph() == nullptr) {
GELOGE(GRAPH_FAILED, "AddDataEdge: src node[%s] is invalid.", src_node_ptr->GetName().c_str());
return GRAPH_FAILED;
}
if (dst_node_ptr->GetOwnerComputeGraph() == nullptr) {
GELOGE(GRAPH_FAILED, "AddDataEdge: dst node[%s] is invalid.", dst_node_ptr->GetName().c_str());
return GRAPH_FAILED;
}
graphStatus res =
GraphUtils::AddEdge(src_node_ptr->GetOutDataAnchor(src_port_index), dst_node_ptr->GetInDataAnchor(dst_port_index));
if (res != GRAPH_SUCCESS) {
@ -529,6 +585,16 @@ graphStatus Graph::AddControlEdge(GNode &src_node, GNode &dst_node) {
return GRAPH_FAILED;
}
if (src_node_ptr->GetOwnerComputeGraph() == nullptr) {
GELOGE(GRAPH_FAILED, "AddControlEdge: src node[%s] is invalid.", src_node_ptr->GetName().c_str());
return GRAPH_FAILED;
}
if (dst_node_ptr->GetOwnerComputeGraph() == nullptr) {
GELOGE(GRAPH_FAILED, "AddControlEdge: dst node[%s] is invalid.", dst_node_ptr->GetName().c_str());
return GRAPH_FAILED;
}
graphStatus res = GraphUtils::AddEdge(src_node_ptr->GetOutControlAnchor(), dst_node_ptr->GetInControlAnchor());
if (res != GRAPH_SUCCESS) {
GELOGE(GRAPH_FAILED, "AddControlEdge: Add control edge failed.");
@ -558,10 +624,9 @@ GraphPtr Graph::ConstructFromInputs(const std::vector<Operator> &inputs, const g
}
compute_graph->SetInputSize(static_cast<uint32_t>(inputs.size()));
Graph graph = GraphUtils::CreateGraphFromComputeGraph(compute_graph);
GraphPtr graph_ptr = std::make_shared<Graph>(graph);
GraphPtr graph_ptr = GraphUtils::CreateGraphPtrFromComputeGraph(compute_graph);
if (graph_ptr == nullptr) {
GELOGE(GRAPH_FAILED, "ConstructFromInputs: graph make shared failed.");
GELOGE(GRAPH_FAILED, "ConstructFromInputs: create graph from compute graph failed.");
return nullptr;
}
@ -604,6 +669,20 @@ GraphUtils::CreateGraphFromComputeGraph(const ge::ComputeGraphPtr compute_graph)
return graph;
}
GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY GraphPtr
GraphUtils::CreateGraphPtrFromComputeGraph(const ge::ComputeGraphPtr compute_graph) {
GE_CHK_BOOL_EXEC_NOLOG(compute_graph != nullptr, return nullptr);
auto name = compute_graph->GetName();
auto graph = ComGraphMakeShared<Graph>(name);
GE_CHK_BOOL_EXEC_NOLOG(graph != nullptr, return nullptr);
GE_CHK_BOOL_EXEC_NOLOG(graph->impl_ != nullptr, return nullptr);
graph->impl_->compute_graph_ = compute_graph;
return graph;
}
GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::RecoverGraphOperators(const Graph &graph) {
GE_CHECK_NOTNULL(graph.impl_);
GE_CHECK_NOTNULL(graph.impl_->compute_graph_);

@ -393,6 +393,11 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus Node::SetOwnerCompute
return GRAPH_SUCCESS;
}
GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus Node::SetAnyOwnerComputeGraph(const ComputeGraphPtr &graph) {
owner_graph_ = graph;
return GRAPH_SUCCESS;
}
GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY Node::Vistor<InDataAnchorPtr> Node::GetAllInDataAnchors() const {
return Vistor<InDataAnchorPtr>(shared_from_this(), in_data_anchors_);
}

@ -292,6 +292,8 @@ static graphStatus CalcTensorElementCnt(const std::vector<int64_t> &dims, Format
graph_status = CalcElementCntByDims(dims, element_cnt);
break;
default:
ErrorManager::GetInstance().ATCReportErrMessage(
"E19012", {"function", "reason"}, {"CalcTensorElementCnt", "format[" + format_str + "] is not support"});
GELOGE(GRAPH_FAILED, "unsupported format, format=%d(%s).", format, format_str.c_str());
graph_status = GRAPH_FAILED;
break;

@ -16,6 +16,7 @@
#include "graph/utils/type_utils.h"
#include "debug/ge_util.h"
#include "common/util/error_manager/error_manager.h"
using domi::domiTensorFormat_t;
@ -431,6 +432,9 @@ bool TypeUtils::GetDataTypeLength(ge::DataType data_type, uint32_t &length) {
length = it->second;
return true;
} else {
ErrorManager::GetInstance().ATCReportErrMessage(
"E19012", {"function", "reason"},
{"GetDataTypeLength", "data_type[" + std::to_string(data_type) + "] is not support"});
GELOGE(GRAPH_FAILED, "data_type not support %d", data_type);
return false;
}

@ -96,6 +96,7 @@ file(GLOB TRAIN_SRC_LIST RELATIVE ${CMAKE_CURRENT_LIST_DIR}
"graph/load/new_model_manager/task_info/label_switch_by_index_task_info.cc"
"graph/load/new_model_manager/task_info/memcpy_addr_async_task_info.cc"
"graph/load/new_model_manager/task_info/memcpy_async_task_info.cc"
"graph/load/new_model_manager/task_info/model_exit_task_info.cc"
"graph/load/new_model_manager/task_info/profiler_trace_task_info.cc"
"graph/load/new_model_manager/task_info/stream_active_task_info.cc"
"graph/load/new_model_manager/task_info/stream_switch_task_info.cc"
@ -277,6 +278,7 @@ file(GLOB INFER_SRC_LIST RELATIVE ${CMAKE_CURRENT_LIST_DIR}
"graph/load/new_model_manager/task_info/label_switch_by_index_task_info.cc"
"graph/load/new_model_manager/task_info/memcpy_addr_async_task_info.cc"
"graph/load/new_model_manager/task_info/memcpy_async_task_info.cc"
"graph/load/new_model_manager/task_info/model_exit_task_info.cc"
"graph/load/new_model_manager/task_info/profiler_trace_task_info.cc"
"graph/load/new_model_manager/task_info/stream_active_task_info.cc"
"graph/load/new_model_manager/task_info/stream_switch_task_info.cc"

@ -398,6 +398,7 @@ REGISTER_OPTYPE_DEFINE(MEMCPYASYNC, "MemcpyAsync");
REGISTER_OPTYPE_DEFINE(MEMCPYADDRASYNC, "MemcpyAddrAsync");
REGISTER_OPTYPE_DEFINE(STREAMMERGE, "StreamMerge");
REGISTER_OPTYPE_DEFINE(ENDGRAPH, "EndGraph");
REGISTER_OPTYPE_DEFINE(MODELEXIT, "ModelExit");
REGISTER_OPTYPE_DEFINE(SEND, "Send");
REGISTER_OPTYPE_DEFINE(RECV, "Recv");
REGISTER_OPTYPE_DEFINE(ENDOFSEQUENCE, "EndOfSequence");

@ -1056,6 +1056,7 @@ ge::Status GeExecutor::ExecuteAsync(DynamicSingleOp *executor, const vector<GeTe
}
Status GeExecutor::ReleaseSingleOpResource(void *stream) {
ModelManager::GetInstance()->ClearAicpuSo();
return SingleOpManager::GetInstance().ReleaseResource(stream);
}

@ -48,6 +48,7 @@ local_ge_executor_src_files := \
../graph/load/new_model_manager/task_info/stream_switch_task_info.cc \
../graph/load/new_model_manager/task_info/stream_switchn_task_info.cc \
../graph/load/new_model_manager/task_info/end_graph_task_info.cc \
../graph/load/new_model_manager/task_info/model_exit_task_info.cc \
../graph/load/new_model_manager/task_info/super_kernel/super_kernel_factory.cc \
../graph/load/new_model_manager/task_info/super_kernel/super_kernel.cc \
../opskernel_manager/ops_kernel_builder_manager.cc \

@ -109,6 +109,7 @@ OMG_HOST_SRC_FILES := \
graph/passes/atomic_addr_clean_pass.cc \
graph/passes/mark_same_addr_pass.cc \
graph/passes/mark_graph_unknown_status_pass.cc \
graph/passes/mark_agnostic_pass.cc \
graph/common/omg_util.cc \
graph/common/bcast.cc \
graph/common/local_context.cc \
@ -176,6 +177,7 @@ OMG_HOST_SRC_FILES := \
graph/passes/cast_translate_pass.cc \
graph/passes/prune_pass.cc \
graph/passes/merge_to_stream_merge_pass.cc \
graph/passes/merge_input_memcpy_pass.cc \
graph/passes/switch_to_stream_switch_pass.cc \
graph/passes/attach_stream_label_pass.cc \
graph/passes/multi_batch_pass.cc \
@ -247,6 +249,7 @@ OME_HOST_SRC_FILES := \
graph/load/new_model_manager/task_info/stream_switch_task_info.cc \
graph/load/new_model_manager/task_info/stream_switchn_task_info.cc \
graph/load/new_model_manager/task_info/end_graph_task_info.cc \
graph/load/new_model_manager/task_info/model_exit_task_info.cc \
graph/load/new_model_manager/task_info/super_kernel/super_kernel_factory.cc \
graph/load/new_model_manager/task_info/super_kernel/super_kernel.cc \
single_op/task/op_task.cc \

@ -61,6 +61,7 @@ LIBGE_LOCAL_SRC_FILES := \
graph/load/new_model_manager/model_utils.cc \
graph/load/new_model_manager/aipp_utils.cc \
graph/load/new_model_manager/task_info/end_graph_task_info.cc \
graph/load/new_model_manager/task_info/model_exit_task_info.cc \
graph/load/new_model_manager/task_info/event_record_task_info.cc \
graph/load/new_model_manager/task_info/event_wait_task_info.cc \
graph/load/new_model_manager/task_info/fusion_start_task_info.cc \
@ -110,6 +111,7 @@ LIBGE_LOCAL_SRC_FILES := \
graph/passes/atomic_addr_clean_pass.cc \
graph/passes/mark_same_addr_pass.cc \
graph/passes/mark_graph_unknown_status_pass.cc \
graph/passes/mark_agnostic_pass.cc \
graph/partition/dynamic_shape_partition.cc \
graph/partition/stage_partition.cc \
graph/passes/base_pass.cc \
@ -210,6 +212,7 @@ LIBGE_LOCAL_SRC_FILES := \
graph/passes/switch_data_edges_bypass.cc \
graph/passes/switch_logic_remove_pass.cc \
graph/passes/merge_to_stream_merge_pass.cc \
graph/passes/merge_input_memcpy_pass.cc \
graph/passes/switch_to_stream_switch_pass.cc \
graph/passes/attach_stream_label_pass.cc \
graph/passes/switch_dead_branch_elimination.cc \

@ -462,8 +462,7 @@ Status AllReduceParallelPass::Run(ComputeGraphPtr graph, const vector<SubgraphPt
set<NodePtr> all_reduce_succs;
for (const NodePtr &node : graph->GetDirectNode()) {
if ((node->GetType() != HCOMALLREDUCE && node->GetType() != HVDCALLBACKALLREDUCE) ||
node->GetInDataNodes().size() <= 1) {
if (!IsHcomNode(node->GetType()) || node->GetInDataNodes().size() <= 1) {
continue;
}
@ -507,14 +506,20 @@ Status AllReduceParallelPass::Run(ComputeGraphPtr graph, const vector<SubgraphPt
old_stream_to_new.emplace(old_stream, new_stream);
}
GELOGI("Stream of node %s has been updated from %ld to %ld.", node->GetName().c_str(), old_stream, new_stream);
node->GetOpDesc()->SetStreamId(new_stream);
if (!IsHcomNode(node->GetType())) {
GELOGI("Stream of node %s has been updated from %ld to %ld.", node->GetName().c_str(), old_stream, new_stream);
node->GetOpDesc()->SetStreamId(new_stream);
}
}
}
return !all_reduce_succs.empty() ? SUCCESS : NOT_CHANGED;
}
bool AllReduceParallelPass::IsHcomNode(const std::string &node_type) {
return (node_type == HCOMALLREDUCE || node_type == HVDCALLBACKALLREDUCE);
}
LogicalStreamAllocator::LogicalStreamAllocator(const map<string, SchedulerConf> &scheduler_confs,
const map<string, int> &max_parallel_num)
: scheduler_confs_(scheduler_confs), max_parallel_num_(max_parallel_num) {}

@ -166,6 +166,9 @@ class AllReduceParallelPass : public LogicalStreamPass {
public:
STREAM_PASS_DEFAULT_FUNC(AllReduceParallelPass);
Status Run(ComputeGraphPtr graph, const std::vector<SubgraphPtr> &subgraphs, Context &context) override;
private:
bool IsHcomNode(const std::string &node_type);
};
// Assign logical streams which is not limited by the number of tasks.

@ -870,9 +870,11 @@ MemoryBlock *BlockMemAssigner::ApplyMemory(size_t block_size, size_t real_size,
string ge_disable_reuse_mem_env = "0";
(void)ge::GetContext().GetOption(OPTION_EXEC_DISABLE_REUSED_MEMORY, ge_disable_reuse_mem_env);
if (ge_disable_reuse_mem_env != "1") {
bool reuse_mem_flag = !((workspace_reuse_flag.size() > out_index) && !workspace_reuse_flag[out_index]);
bool reuse_mem_flag = (mem_type == kOutput)
? IsPreReuse(n, out_index)
: !((workspace_reuse_flag.size() > out_index) && !workspace_reuse_flag[out_index]);
is_reuse_memory = !node_op_desc->HasAttr(kL2FusionDynamicConvergeOp) && !node_op_desc->HasAttr(kOpNoReuseMem) &&
reuse_mem_flag && is_op_reuse_mem && (IsPreReuse(n, out_index));
reuse_mem_flag && is_op_reuse_mem;
auto stream_id = node_op_desc->GetStreamId();
if (is_reuse_memory && !continuous && !reusable_blocks_[memory_type].empty()) {
for (auto it = reusable_blocks_[memory_type][stream_id].begin();

@ -464,6 +464,8 @@ Status DavinciModel::DoTaskSink() {
GE_CHK_STATUS_RET(InitTaskInfo(*model_task_def.get()), "InitTaskInfo failed.");
GE_CHK_STATUS_RET(ModelManager::GetInstance()->LaunchCustAicpuSo(), "Launch cust aicpu so failed.");
GE_CHK_STATUS_RET(InitEntryTask(), "InitEntryTask failed.");
GE_CHK_STATUS_RET(DistributeTask(), "Distribute failed.");
@ -2051,6 +2053,7 @@ Status DavinciModel::SinkModelProfile() {
std::set<uint32_t> task_id_set;
for (int32_t i = 0; i < task_num; i++) {
auto task = task_list_[i];
GE_CHECK_NOTNULL(task);
auto fusion_op_info = task->GetFusionOpInfo();
// when type is RT_MODEL_TASK_KERNEL, ctx is not null
if (fusion_op_info != nullptr) {
@ -2077,6 +2080,7 @@ Status DavinciModel::SinkModelProfile() {
using Range = std::pair<CIT, CIT>;
for (int32_t i = 0; i < task_num; i++) {
auto task = task_list_[i];
GE_CHECK_NOTNULL(task);
auto fusion_op_info = task->GetFusionOpInfo();
if (fusion_op_info != nullptr && fusion_op_info->original_op_names.size() > 0) {
uint32_t task_id = task->GetTaskID();

@ -43,13 +43,18 @@ const std::string kCmdTypeProfInit = "prof_init";
const std::string kCmdTypeProfFinalize = "prof_finalize";
const std::string kCmdTypeProfStart = "prof_start";
const std::string kCmdTypeProfStop = "prof_stop";
const char *const kLoadOpFromBuf = "loadOpFromBuf";
const char *const kBatchLoadBuf = "batchLoadsoFrombuf";
const char *const kDeleteCustOp = "deleteCustOp";
struct CustAicpuSoBuf {
uint64_t kernelSoBuf;
uint32_t kernelSoBufLen;
uint64_t kernelSoName;
uint32_t kernelSoNameLen;
} __attribute__((packed));
struct BatchLoadOpFromBufArgs {
uint32_t soNum;
uint64_t args;
} __attribute__((packed));
} // namespace
DumpProperties ModelManager::dump_properties_;
@ -236,6 +241,7 @@ ModelManager::~ModelManager() {
std::lock_guard<std::mutex> lock(map_mutex_);
model_map_.clear();
model_aicpu_kernel_.clear();
cust_aicpu_so_.clear();
GE_IF_BOOL_EXEC(device_count > 0, GE_CHK_RT(rtDeviceReset(0)));
}
@ -399,7 +405,6 @@ Status ModelManager::Unload(uint32_t model_id) {
}
std::lock_guard<std::mutex> lock(exeception_infos_mutex_);
exception_infos_.clear();
cust_aicpu_so_.clear();
return SUCCESS;
}
@ -1096,64 +1101,149 @@ Status ModelManager::CreateAicpuSession(uint64_t session_id) {
return SUCCESS;
}
Status ModelManager::LoadCustAicpuSo(const OpDescPtr op_desc, string so_name) {
Status ModelManager::LoadCustAicpuSo(const OpDescPtr &op_desc, const string &so_name) {
GELOGI("LoadCustAicpuSo in, op name %s, so name %s", op_desc->GetName().c_str(), so_name.c_str());
std::lock_guard<std::mutex> lock(cust_aicpu_mutex_);
auto it = cust_aicpu_so_.find(so_name);
CustAICPUKernelPtr aicpu_kernel = op_desc->TryGetExtAttr(OP_EXTATTR_CUSTAICPU_KERNEL, CustAICPUKernelPtr());
if (aicpu_kernel == nullptr) {
GELOGE(INTERNAL_ERROR, "cust aicpu op %s can't find kernel!", op_desc->GetName().c_str());
return INTERNAL_ERROR;
}
// get current context
rtContext_t rt_cur_ctx = nullptr;
auto rt_error = rtCtxGetCurrent(&rt_cur_ctx);
if (rt_error != RT_ERROR_NONE) {
GELOGE(RT_FAILED, "get current context failed, runtime result is %d", static_cast<int>(rt_error));
return RT_FAILED;
}
// use current context as resource key
uintptr_t resource_id = reinterpret_cast<uintptr_t>(rt_cur_ctx);
auto it = cust_aicpu_so_.find(resource_id);
if (it == cust_aicpu_so_.end()) {
GE_CHK_STATUS_RET(LaunchCustAicpuSo(op_desc, so_name), "LaunchCustAicpuSo failed. op name %s, so_name %s",
op_desc->GetName().c_str(), so_name.c_str());
(void)cust_aicpu_so_.insert(so_name);
GELOGI("LaunchCustAicpuSo op name %s, so_name %s.", op_desc->GetName().c_str(), so_name.c_str());
std::map<string, CustAICPUKernelPtr> new_so_name;
new_so_name.insert({so_name, aicpu_kernel});
cust_aicpu_so_[resource_id] = new_so_name;
GELOGI("LoadCustAicpuSo new aicpu so resource id %lu", resource_id);
return SUCCESS;
}
auto it_so_name = it->second.find(so_name);
if (it_so_name == it->second.end()) {
it->second.insert({so_name, aicpu_kernel});
GELOGI("LoadCustAicpuSo add aicpu so resource id %lu", resource_id);
}
return SUCCESS;
}
Status ModelManager::LaunchCustAicpuSo(const OpDescPtr op_desc, string so_name) {
CustAICPUKernelPtr aicpu_kernel = op_desc->TryGetExtAttr(OP_EXTATTR_CUSTAICPU_KERNEL, CustAICPUKernelPtr());
if (aicpu_kernel == nullptr) {
GELOGE(INTERNAL_ERROR, "cust aicpu op %s can't find kernel!", op_desc->GetName().c_str());
return INTERNAL_ERROR;
Status ModelManager::LaunchKernelCustAicpuSo(const string &kernel_name) {
GELOGI("LaunchCustAucpuSo in, kernel name %s", kernel_name.c_str());
std::lock_guard<std::mutex> lock(cust_aicpu_mutex_);
if (cust_aicpu_so_.size() == 0) return SUCCESS;
// get current context
rtContext_t rt_cur_ctx = nullptr;
auto rt_error = rtCtxGetCurrent(&rt_cur_ctx);
if (rt_error != RT_ERROR_NONE) {
GELOGE(RT_FAILED, "get current context failed, runtime result is %d", static_cast<int>(rt_error));
return RT_FAILED;
}
uintptr_t resource_id = reinterpret_cast<uintptr_t>(rt_cur_ctx);
auto it = cust_aicpu_so_.find(resource_id);
if (it == cust_aicpu_so_.end()) {
GELOGI("Cust aicpu so map is empty, context id %lu", resource_id);
return SUCCESS;
}
const void *aicpu_data = aicpu_kernel->GetBinData();
uint32_t aicpu_data_length = aicpu_kernel->GetBinDataSize();
void *d_aicpu_data = nullptr;
void *d_so_name = nullptr;
void *args = nullptr;
vector<void *> allocated_mem;
rtError_t status;
rtStream_t stream = nullptr;
GE_CHK_RT(rtMalloc(&d_aicpu_data, aicpu_data_length, RT_MEMORY_HBM));
GE_CHK_RT(rtMemcpy(d_aicpu_data, aicpu_data_length, aicpu_data, aicpu_data_length, RT_MEMCPY_HOST_TO_DEVICE));
GE_CHK_RT(rtMalloc(&d_so_name, so_name.size(), RT_MEMORY_HBM));
GE_CHK_RT(rtMemcpy(d_so_name, so_name.size(), reinterpret_cast<const void *>(so_name.c_str()), so_name.size(),
RT_MEMCPY_HOST_TO_DEVICE));
vector<CustAicpuSoBuf> v_cust_so;
void *args = nullptr;
CustAicpuSoBuf cust_aicpu_so_buf;
cust_aicpu_so_buf.kernelSoBuf = reinterpret_cast<uint64_t>(reinterpret_cast<uintptr_t>(d_aicpu_data));
cust_aicpu_so_buf.kernelSoBufLen = aicpu_data_length;
cust_aicpu_so_buf.kernelSoName = reinterpret_cast<uint64_t>(reinterpret_cast<uintptr_t>(d_so_name));
cust_aicpu_so_buf.kernelSoNameLen = so_name.size();
for (const auto &it_so : it->second) {
const void *aicpu_data = it_so.second->GetBinData();
uint32_t aicpu_data_length = it_so.second->GetBinDataSize();
string so_name = it_so.first;
void *d_aicpu_data = nullptr;
void *d_so_name = nullptr;
status = rtMalloc(&d_aicpu_data, aicpu_data_length, RT_MEMORY_HBM);
if (status != RT_ERROR_NONE) {
GELOGE(RT_FAILED, "Call rt failed, status: 0x%x", status);
return RT_ERROR_TO_GE_STATUS(status);
}
allocated_mem.push_back(d_aicpu_data);
status = rtMalloc(&d_so_name, so_name.size(), RT_MEMORY_HBM);
if (status != RT_ERROR_NONE) {
GELOGE(RT_FAILED, "Call rt failed, status: 0x%x", status);
return RT_ERROR_TO_GE_STATUS(status);
}
allocated_mem.push_back(d_so_name);
GE_CHK_RT(rtMemcpy(d_aicpu_data, aicpu_data_length, aicpu_data, aicpu_data_length, RT_MEMCPY_HOST_TO_DEVICE));
GE_CHK_RT(rtMemcpy(d_so_name, so_name.size(), reinterpret_cast<const void *>(so_name.c_str()), so_name.size(),
RT_MEMCPY_HOST_TO_DEVICE));
CustAicpuSoBuf cust_aicpu_so_buf;
cust_aicpu_so_buf.kernelSoBuf = reinterpret_cast<uint64_t>(reinterpret_cast<uintptr_t>(d_aicpu_data));
cust_aicpu_so_buf.kernelSoBufLen = aicpu_data_length;
cust_aicpu_so_buf.kernelSoName = reinterpret_cast<uint64_t>(reinterpret_cast<uintptr_t>(d_so_name));
cust_aicpu_so_buf.kernelSoNameLen = so_name.size();
v_cust_so.push_back(cust_aicpu_so_buf);
}
if (kernel_name == kDeleteCustOp) {
(void)cust_aicpu_so_.erase(it);
}
uint32_t args_size = sizeof(CustAicpuSoBuf) * v_cust_so.size();
status = rtMalloc(&args, args_size, RT_MEMORY_HBM);
if (status != RT_ERROR_NONE) {
GELOGE(RT_FAILED, "Call rt failed, status: 0x%x", status);
return RT_ERROR_TO_GE_STATUS(status);
}
allocated_mem.push_back(args);
GE_CHK_RT(rtMemcpy(args, args_size, v_cust_so.data(), args_size, RT_MEMCPY_HOST_TO_DEVICE));
BatchLoadOpFromBufArgs batch_cust_so;
batch_cust_so.soNum = v_cust_so.size();
batch_cust_so.args = reinterpret_cast<uint64_t>(reinterpret_cast<uintptr_t>(args));
void *batch_args = nullptr;
uint32_t batch_args_size = sizeof(BatchLoadOpFromBufArgs);
status = rtMalloc(&batch_args, batch_args_size, RT_MEMORY_HBM);
if (status != RT_ERROR_NONE) {
GELOGE(RT_FAILED, "Call rt failed, status: 0x%x", status);
return RT_ERROR_TO_GE_STATUS(status);
}
allocated_mem.push_back(batch_args);
GE_CHK_RT(rtMemcpy(batch_args, batch_args_size, static_cast<void *>(&batch_cust_so), batch_args_size,
RT_MEMCPY_HOST_TO_DEVICE));
uint32_t args_size = sizeof(CustAicpuSoBuf);
GE_CHK_RT(rtMalloc(&args, args_size, RT_MEMORY_HBM));
GE_CHK_RT(rtMemcpy(args, args_size, static_cast<void *>(&cust_aicpu_so_buf), args_size, RT_MEMCPY_HOST_TO_DEVICE));
GE_CHK_RT(rtStreamCreate(&stream, 0));
GE_CHK_RT(rtCpuKernelLaunch(nullptr, kLoadOpFromBuf, 1, args, args_size, nullptr, stream));
GE_CHK_RT(rtCpuKernelLaunch(nullptr, kernel_name.c_str(), 1, batch_args, batch_args_size, nullptr, stream));
status = rtStreamSynchronize(stream);
if (status != RT_ERROR_NONE) {
GELOGE(RT_FAILED, "Call rt stream sync failed, status: 0x%x", status);
GE_CHK_RT(rtStreamDestroy(stream));
GE_CHK_RT(rtFree(args));
GE_CHK_RT(rtFree(d_aicpu_data));
GE_CHK_RT(rtFree(d_so_name));
return RT_ERROR_TO_GE_STATUS(status);
}
GE_CHK_RT(rtStreamDestroy(stream));
GE_CHK_RT(rtFree(args));
GE_CHK_RT(rtFree(d_aicpu_data));
GE_CHK_RT(rtFree(d_so_name));
GELOGI("Cpu kernel launch loadOpFromBuf task success.");
std::function<void()> callback = [&]() {
for (auto mem : allocated_mem) {
GE_CHK_RT(rtFree(mem));
}
GE_CHK_RT(rtStreamDestroy(stream));
};
GE_MAKE_GUARD(release, callback);
GELOGI("Cpu kernel launch task success.");
return SUCCESS;
}
Status ModelManager::ClearAicpuSo() {
GE_CHK_STATUS_RET(LaunchKernelCustAicpuSo(kDeleteCustOp), "delete cust op so failed.");
return SUCCESS;
}
Status ModelManager::LaunchCustAicpuSo() {
GE_CHK_STATUS_RET(LaunchKernelCustAicpuSo(kBatchLoadBuf), "launch cust op so failed.");
return SUCCESS;
}

@ -270,9 +270,13 @@ class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ModelManager {
ge::Status DestroyAicpuSessionForInfer(uint32_t model_id);
ge::Status LoadCustAicpuSo(const OpDescPtr op_desc, string so_name);
ge::Status LoadCustAicpuSo(const OpDescPtr &op_desc, const string &so_name);
ge::Status LaunchCustAicpuSo(const OpDescPtr op_desc, string so_name);
ge::Status LaunchCustAicpuSo();
ge::Status ClearAicpuSo();
ge::Status LaunchKernelCustAicpuSo(const string &kernel_name);
ge::Status GetOrigInputInfo(uint32_t model_id, uint32_t index, OriginInputInfo &orig_input_info);
@ -340,7 +344,7 @@ class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ModelManager {
std::set<uint64_t> sess_ids_;
std::vector<rtExceptionInfo> exception_infos_;
std::mutex cust_aicpu_mutex_;
std::set<std::string> cust_aicpu_so_;
std::map<uintptr_t, std::map<std::string, CustAICPUKernelPtr>> cust_aicpu_so_;
static DumpProperties dump_properties_;
};

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

Loading…
Cancel
Save