|
|
|
@@ -149,14 +149,7 @@ DavinciModel::~DavinciModel() { |
|
|
|
GELOGW("UnloadDumpInfo failed, ret: %u.", ret); |
|
|
|
} |
|
|
|
|
|
|
|
for (const auto &op_and_addr : saved_task_addrs_) { |
|
|
|
auto addr = op_and_addr.second; |
|
|
|
if (addr != nullptr) { |
|
|
|
GE_CHK_RT(rtFree(addr)); |
|
|
|
} |
|
|
|
addr = nullptr; |
|
|
|
} |
|
|
|
saved_task_addrs_.clear(); |
|
|
|
ClearTaskAddrs(); |
|
|
|
|
|
|
|
GE_CHK_STATUS(ModelRunStop()); |
|
|
|
|
|
|
|
@@ -221,6 +214,17 @@ DavinciModel::~DavinciModel() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void DavinciModel::ClearTaskAddrs() { |
|
|
|
for (const auto &op_and_addr : saved_task_addrs_) { |
|
|
|
auto addr = op_and_addr.second; |
|
|
|
if (addr != nullptr) { |
|
|
|
GE_CHK_RT(rtFree(addr)); |
|
|
|
} |
|
|
|
addr = nullptr; |
|
|
|
} |
|
|
|
saved_task_addrs_.clear(); |
|
|
|
} |
|
|
|
|
|
|
|
void DavinciModel::UnbindHcomStream() { |
|
|
|
if (!all_hccl_stream_list_.empty()) { |
|
|
|
for (size_t i = 0; i < all_hccl_stream_list_.size(); i++) { |
|
|
|
@@ -262,8 +266,11 @@ Status DavinciModel::Assign(const GeModelPtr &ge_model) { |
|
|
|
/// @return: void |
|
|
|
/// |
|
|
|
void DavinciModel::Shrink() { |
|
|
|
DumperShrink(); |
|
|
|
skt_info_ = {0, 0, 0, 0, nullptr, nullptr, {}, {}, {}, {}, {}, RT_KERNEL_DEFAULT, -1, 0, nullptr}; |
|
|
|
ge_model_.reset(); // delete object. |
|
|
|
op_list_.clear(); |
|
|
|
ClearTaskAddrs(); |
|
|
|
} |
|
|
|
|
|
|
|
Status DavinciModel::InitWeightMem(void *dev_ptr, void *weight_ptr, size_t weight_size) { |
|
|
|
@@ -737,7 +744,6 @@ Status DavinciModel::ReportProfilingData() { |
|
|
|
} |
|
|
|
ProfilingManager::Instance().ReportProfilingData(model_id_, GetTaskDescInfo(), compute_graph_desc_info); |
|
|
|
GE_CHK_STATUS(SinkModelProfile(), "Sink model profiler failed."); |
|
|
|
op_list_.clear(); |
|
|
|
|
|
|
|
return SUCCESS; |
|
|
|
} |
|
|
|
@@ -936,11 +942,15 @@ Status DavinciModel::InitInputOutputForDynamic(const ComputeGraphPtr &compute_gr |
|
|
|
} |
|
|
|
if (IsDataOp(op_desc->GetType())) { |
|
|
|
GELOGD("init data op %s", op_desc->GetName().c_str()); |
|
|
|
data_op_list_.push_back(op_desc); |
|
|
|
auto data_op = AttrUtils::CopyOpDesc(op_desc); |
|
|
|
GE_CHECK_NOTNULL(data_op); |
|
|
|
data_op_list_.push_back(data_op); |
|
|
|
} |
|
|
|
if (op_desc->GetType() == NETOUTPUT) { |
|
|
|
GELOGD("init netouput op %s", op_desc->GetName().c_str()); |
|
|
|
output_op_list_.push_back(op_desc); |
|
|
|
auto output_op = AttrUtils::CopyOpDesc(op_desc); |
|
|
|
GE_CHECK_NOTNULL(output_op); |
|
|
|
output_op_list_.push_back(output_op); |
|
|
|
} |
|
|
|
} |
|
|
|
return SUCCESS; |
|
|
|
@@ -978,7 +988,9 @@ Status DavinciModel::InitDataOp(const NodePtr &node, uint32_t &data_op_index, ma |
|
|
|
return SUCCESS; |
|
|
|
} |
|
|
|
|
|
|
|
data_op_list_.push_back(op_desc); |
|
|
|
auto data_op = AttrUtils::CopyOpDesc(op_desc); |
|
|
|
GE_CHECK_NOTNULL(data_op); |
|
|
|
data_op_list_.push_back(data_op); |
|
|
|
|
|
|
|
// Make information for copy input data. |
|
|
|
const vector<int64_t> output_size_list = ModelUtils::GetOutputSize(op_desc); |
|
|
|
@@ -1033,7 +1045,9 @@ void DavinciModel::AdjustDataOpList(const map<uint32_t, OpDescPtr> &data_by_inde |
|
|
|
|
|
|
|
data_op_list_.clear(); |
|
|
|
for (auto &item : data_by_index) { |
|
|
|
data_op_list_.emplace_back(item.second); |
|
|
|
auto data_op = AttrUtils::CopyOpDesc(item.second); |
|
|
|
GE_CHECK_NOTNULL_EXEC(data_op, return); |
|
|
|
data_op_list_.emplace_back(data_op); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@@ -1065,7 +1079,9 @@ Status DavinciModel::InitNetOutput(const NodePtr &node) { |
|
|
|
return SUCCESS; |
|
|
|
} |
|
|
|
|
|
|
|
output_op_list_.push_back(op_desc); |
|
|
|
auto output_op = AttrUtils::CopyOpDesc(op_desc); |
|
|
|
GE_CHECK_NOTNULL(output_op); |
|
|
|
output_op_list_.push_back(output_op); |
|
|
|
// Make information for copy output data. |
|
|
|
const vector<int64_t> input_size_list = ModelUtils::GetInputSize(op_desc); |
|
|
|
const vector<void *> virtual_addr_list = ModelUtils::GetInputDataAddrs(runtime_param_, op_desc); |
|
|
|
|