pull/1222/head
wangxiaotian22 4 years ago
parent 919753675f
commit 19a55bcdb4

@ -70,7 +70,7 @@ Status BinaryBlockMemAssigner::GetMemoryRanges(vector<int64_t> &range_ceils) {
return SUCCESS; return SUCCESS;
} }
if ((all_memory_size.front() <= 0) || (log(kLogBase) == 0)) { if ((all_memory_size.front() <= 0) || (log(kLogBase) == 0)) {
GELOGE(FAILED, "[check][mem_range_step]first mem_range_step:%ld less than 0,invalid," GELOGE(FAILED, "[Check][MemRangeStep]first mem_range_step:%ld less than 0,invalid,"
"maybe has dynamic shape in graph", all_memory_size.front()); "maybe has dynamic shape in graph", all_memory_size.front());
REPORT_INNER_ERROR("E19999", "first mem_range_step:%ld less than 0,invalid," REPORT_INNER_ERROR("E19999", "first mem_range_step:%ld less than 0,invalid,"
"maybe has dynamic shape in graph", all_memory_size.front()); "maybe has dynamic shape in graph", all_memory_size.front());
@ -87,12 +87,12 @@ Status BinaryBlockMemAssigner::GetMemoryRanges(vector<int64_t> &range_ceils) {
GE_CHK_BOOL_EXEC((range_number != 0), GE_CHK_BOOL_EXEC((range_number != 0),
REPORT_INNER_ERROR("E19999", "inner data[range_number] is 0, judge invalid"); REPORT_INNER_ERROR("E19999", "inner data[range_number] is 0, judge invalid");
return PARAM_INVALID, return PARAM_INVALID,
"[check][range_number]inner data is 0, judge invalid."); "[Check][RangeNumber]inner data is 0, judge invalid.");
size_t range_number_limit = all_memory_size.size() / range_number; size_t range_number_limit = all_memory_size.size() / range_number;
int64_t range_ceil = min_memory_size; int64_t range_ceil = min_memory_size;
for (size_t i = 1; i <= range_number; i++) { for (size_t i = 1; i <= range_number; i++) {
GE_IF_BOOL_EXEC(TypeUtils::CheckUint64MulOverflow(static_cast<uint64_t>(range_ceil), kRangeCeilInterval), GE_IF_BOOL_EXEC(TypeUtils::CheckUint64MulOverflow(static_cast<uint64_t>(range_ceil), kRangeCeilInterval),
GELOGE(FAILED, "[check][mem_range_ceil]Multiply result is out of range," GELOGE(FAILED, "[Check][MemRangeCeil]Multiply result is out of range,"
"range_ceil:%ld, interval:%u", range_ceil, kRangeCeilInterval); "range_ceil:%ld, interval:%u", range_ceil, kRangeCeilInterval);
REPORT_INNER_ERROR("E19999", "process mem_range_ceil,multiply result out of range," REPORT_INNER_ERROR("E19999", "process mem_range_ceil,multiply result out of range,"
"range_ceil:%ld, interval:%u", range_ceil, kRangeCeilInterval); "range_ceil:%ld, interval:%u", range_ceil, kRangeCeilInterval);

@ -597,7 +597,7 @@ void BlockMemAssigner::GetOutAndWorkSpaceMem(vector<int64_t> &all_memory_size) {
int64_t size = 0; int64_t size = 0;
GE_IF_BOOL_EXEC(ge::TensorUtils::GetSize(output_desc, size) != SUCCESS, GELOGI("Get size failed")); GE_IF_BOOL_EXEC(ge::TensorUtils::GetSize(output_desc, size) != SUCCESS, GELOGI("Get size failed"));
GE_IF_BOOL_EXEC(size < 0, GE_IF_BOOL_EXEC(size < 0,
GELOGE(FAILED, "[check][TensorSize]tensor_size:%ld is invalid, maybe it is unknown shape node, Node_name:%s", GELOGE(FAILED, "[Check][TensorSize]tensor_size:%ld is invalid, maybe it is unknown shape node, Node_name:%s",
size, node_op_desc->GetName().c_str()); size, node_op_desc->GetName().c_str());
REPORT_INNER_ERROR("E19999", "tensor_size:%ld is invalid, maybe it is unknown shape node, Node_name:%s", REPORT_INNER_ERROR("E19999", "tensor_size:%ld is invalid, maybe it is unknown shape node, Node_name:%s",
size, node_op_desc->GetName().c_str()); size, node_op_desc->GetName().c_str());
@ -691,21 +691,21 @@ bool BlockMemAssigner::IsOutNodeSetContinuousInput(const NodePtr &n, uint32_t ou
if (static_cast<size_t>(out_index) < n->GetAllOutDataAnchors().size()) { if (static_cast<size_t>(out_index) < n->GetAllOutDataAnchors().size()) {
auto out_anchor = n->GetOutDataAnchor(out_index); auto out_anchor = n->GetOutDataAnchor(out_index);
GE_IF_BOOL_EXEC(out_anchor == nullptr, GE_IF_BOOL_EXEC(out_anchor == nullptr,
GELOGE(FAILED, "[check][anchor]Node[%s] output[%u] anchor is null.", GELOGE(FAILED, "[Check][Anchor]Node[%s] output[%u] anchor is null.",
n->GetName().c_str(), out_index); n->GetName().c_str(), out_index);
REPORT_INNER_ERROR("E19999", "output anchor is null, node_name: %s output_index: %u.", REPORT_INNER_ERROR("E19999", "output anchor is null, node_name: %s output_index: %u.",
n->GetName().c_str(), out_index); n->GetName().c_str(), out_index);
return false;); return false;);
for (auto const &peer_in_anchor : out_anchor->GetPeerInDataAnchors()) { for (auto const &peer_in_anchor : out_anchor->GetPeerInDataAnchors()) {
GE_IF_BOOL_EXEC(peer_in_anchor == nullptr, GE_IF_BOOL_EXEC(peer_in_anchor == nullptr,
GELOGE(FAILED, "[check][anchor]Node[%s] output[%u] peer_in_anchor 0 is null.", GELOGE(FAILED, "[Check][Anchor]Node[%s] output[%u] peer_in_anchor 0 is null.",
n->GetName().c_str(), out_index); n->GetName().c_str(), out_index);
REPORT_INNER_ERROR("E19999", "output anchor peer is null, node_name: %s output_index: %u.", REPORT_INNER_ERROR("E19999", "output anchor peer is null, node_name: %s output_index: %u.",
n->GetName().c_str(), out_index); n->GetName().c_str(), out_index);
return false;); return false;);
auto peer_node = peer_in_anchor->GetOwnerNode(); auto peer_node = peer_in_anchor->GetOwnerNode();
GE_IF_BOOL_EXEC(peer_node == nullptr, GE_IF_BOOL_EXEC(peer_node == nullptr,
GELOGE(FAILED, "[check][node]Node[%s] output[%u] peer node is null.", GELOGE(FAILED, "[Check][Node]Node[%s] output[%u] peer node is null.",
n->GetName().c_str(), out_index); n->GetName().c_str(), out_index);
REPORT_INNER_ERROR("E19999", "output anchor peer node is null, node_name: %s output_index: %u.", REPORT_INNER_ERROR("E19999", "output anchor peer node is null, node_name: %s output_index: %u.",
n->GetName().c_str(), out_index); n->GetName().c_str(), out_index);
@ -715,7 +715,7 @@ bool BlockMemAssigner::IsOutNodeSetContinuousInput(const NodePtr &n, uint32_t ou
bool is_input_continuous = false; bool is_input_continuous = false;
auto peer_in_node_desc = peer_node->GetOpDesc(); auto peer_in_node_desc = peer_node->GetOpDesc();
GE_IF_BOOL_EXEC(peer_in_node_desc == nullptr, GE_IF_BOOL_EXEC(peer_in_node_desc == nullptr,
GELOGE(FAILED, "[check][op_desc]Node[%s] output[%u] nodedesc is null.", GELOGE(FAILED, "[Check][OpDesc]Node[%s] output[%u] nodedesc is null.",
n->GetName().c_str(), out_index); n->GetName().c_str(), out_index);
REPORT_INNER_ERROR("E19999", "output anchor peer op_desc is null, node_name:%s output_index:%u.", REPORT_INNER_ERROR("E19999", "output anchor peer op_desc is null, node_name:%s output_index:%u.",
n->GetName().c_str(), out_index); n->GetName().c_str(), out_index);
@ -818,7 +818,7 @@ bool BlockMemAssigner::IsContinuousMemoryReuse(const NodePtr &n, const NodePtr &
if ((in_anchor == nullptr) || (in_anchor->GetPeerOutAnchor() == nullptr) || if ((in_anchor == nullptr) || (in_anchor->GetPeerOutAnchor() == nullptr) ||
(in_anchor->GetPeerOutAnchor()->GetOwnerNode() == nullptr) || (in_anchor->GetPeerOutAnchor()->GetOwnerNode() == nullptr) ||
(in_anchor->GetPeerOutAnchor()->GetOwnerNode()->GetOpDesc() == nullptr)) { (in_anchor->GetPeerOutAnchor()->GetOwnerNode()->GetOpDesc() == nullptr)) {
GELOGE(FAILED, "[check][op_desc]Node[%s] output[%u] peer input node desc is null.", GELOGE(FAILED, "[Check][OpDesc]Node[%s] output[%u] peer input node desc is null.",
n->GetName().c_str(), out_index); n->GetName().c_str(), out_index);
REPORT_INNER_ERROR("E19999", "get output anchor peer op_desc fail, node_name: %s output_index: %u.", REPORT_INNER_ERROR("E19999", "get output anchor peer op_desc fail, node_name: %s output_index: %u.",
n->GetName().c_str(), out_index); n->GetName().c_str(), out_index);
@ -1107,7 +1107,7 @@ MemoryBlock *BlockMemAssigner::ApplyMemory(size_t block_size, size_t real_size,
const bool continuous, int64_t memory_type) { const bool continuous, int64_t memory_type) {
GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(n == nullptr, GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(n == nullptr,
REPORT_INNER_ERROR("E19999", "Input parameter n(type:node_ptr) is null, apply memory failed"); REPORT_INNER_ERROR("E19999", "Input parameter n(type:node_ptr) is null, apply memory failed");
return nullptr, "[check][param]Input parameter n(type:node_ptr) is null."); return nullptr, "[Check][Param]Input parameter n(type:node_ptr) is null.");
auto node_op_desc = n->GetOpDesc(); auto node_op_desc = n->GetOpDesc();
GE_IF_BOOL_EXEC(node_op_desc == nullptr, return nullptr); GE_IF_BOOL_EXEC(node_op_desc == nullptr, return nullptr);
std::string batch_label; std::string batch_label;
@ -1162,7 +1162,7 @@ MemoryBlock *BlockMemAssigner::ApplyMemory(size_t block_size, size_t real_size,
GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(block == nullptr, GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(block == nullptr,
REPORT_INNER_ERROR("E19999", "new a memoryblock object failed. node_name:%s out_index:%u", REPORT_INNER_ERROR("E19999", "new a memoryblock object failed. node_name:%s out_index:%u",
n->GetName().c_str(), out_index); n->GetName().c_str(), out_index);
return nullptr, "[new][object]new MemoryBlock failed, node_name:%s out_index:%u", n->GetName().c_str(), out_index); return nullptr, "[New][Object]new MemoryBlock failed, node_name:%s out_index:%u", n->GetName().c_str(), out_index);
// Data and netoutput need zero copy block // Data and netoutput need zero copy block
block->is_zero_copy_ = IsZeroCopyBlock(n, continuous); block->is_zero_copy_ = IsZeroCopyBlock(n, continuous);
@ -1227,7 +1227,7 @@ Status BlockMemAssigner::ApplyContinuousMemory(const NodePtr &n, const vector<in
auto node_op_desc = n->GetOpDesc(); auto node_op_desc = n->GetOpDesc();
GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(node_op_desc == nullptr, GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(node_op_desc == nullptr,
REPORT_INNER_ERROR("E19999", "Input parameter n(type:OpDescPtr) is null"); REPORT_INNER_ERROR("E19999", "Input parameter n(type:OpDescPtr) is null");
return INTERNAL_ERROR, "[check][param]Input parameter n(type:OpDescPtr) is null"); return INTERNAL_ERROR, "[Check][Param]Input parameter n(type:OpDescPtr) is null");
// continuous output support ref only when all output ref input // continuous output support ref only when all output ref input
bool isAllOutputRef = true; bool isAllOutputRef = true;

Loading…
Cancel
Save