@ -598,9 +598,9 @@ void BlockMemAssigner::GetOutAndWorkSpaceMem(vector<int64_t> &all_memory_size) {
GE_IF_BOOL_EXEC ( ge : : TensorUtils : : GetSize ( output_desc , size ) ! = SUCCESS , GELOGI ( " Get size failed " ) ) ;
GE_IF_BOOL_EXEC ( size < 0 ,
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 " ,
size , node_op_desc - > GetName ( ) . c_str ( ) ) ;
size , node_op_desc - > GetName ( ) . c_str ( ) ) ;
return ; ) ;
batch_all_memory_size [ batch_label ] . emplace_back ( size ) ;
if ( batch_total_size . find ( batch_label ) = = batch_total_size . end ( ) ) {
@ -692,23 +692,23 @@ bool BlockMemAssigner::IsOutNodeSetContinuousInput(const NodePtr &n, uint32_t ou
auto out_anchor = n - > GetOutDataAnchor ( out_index ) ;
GE_IF_BOOL_EXEC ( out_anchor = = nullptr ,
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. " ,
n - > GetName ( ) . c_str ( ) , out_index ) ;
n - > GetName ( ) . c_str ( ) , out_index ) ;
return false ; ) ;
for ( auto const & peer_in_anchor : out_anchor - > GetPeerInDataAnchors ( ) ) {
GE_IF_BOOL_EXEC ( peer_in_anchor = = nullptr ,
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. " ,
n - > GetName ( ) . c_str ( ) , out_index ) ;
n - > GetName ( ) . c_str ( ) , out_index ) ;
return false ; ) ;
auto peer_node = peer_in_anchor - > GetOwnerNode ( ) ;
GE_IF_BOOL_EXEC ( peer_node = = nullptr ,
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. " ,
n - > GetName ( ) . c_str ( ) , out_index ) ;
n - > GetName ( ) . c_str ( ) , out_index ) ;
return false ; ) ;
// Get the continuous input type of the node, default is false
@ -716,9 +716,9 @@ bool BlockMemAssigner::IsOutNodeSetContinuousInput(const NodePtr &n, uint32_t ou
auto peer_in_node_desc = peer_node - > GetOpDesc ( ) ;
GE_IF_BOOL_EXEC ( peer_in_node_desc = = nullptr ,
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. " ,
n - > GetName ( ) . c_str ( ) , out_index ) ;
n - > GetName ( ) . c_str ( ) , out_index ) ;
return false ; ) ;
// If GetBool fail, is_input_continuous is false.
@ -819,7 +819,7 @@ bool BlockMemAssigner::IsContinuousMemoryReuse(const NodePtr &n, const NodePtr &
( in_anchor - > GetPeerOutAnchor ( ) - > GetOwnerNode ( ) = = nullptr ) | |
( in_anchor - > GetPeerOutAnchor ( ) - > GetOwnerNode ( ) - > GetOpDesc ( ) = = nullptr ) ) {
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. " ,
n - > GetName ( ) . c_str ( ) , out_index ) ;
return false ;
@ -1242,7 +1242,7 @@ Status BlockMemAssigner::ApplyContinuousMemory(const NodePtr &n, const vector<in
if ( ! isAllOutputRef & & isOutputHasRef ) {
REPORT_INNER_ERROR ( " E19999 " , " continuous output node ref part input, not support now. node_name:%s " ,
n - > GetName ( ) . c_str ( ) ) ;
n - > GetName ( ) . c_str ( ) ) ;
GELOGE ( INTERNAL_ERROR , " [Check][OutRefStatus]continuous output node ref part input, not support, node_name:%s " ,
n - > GetName ( ) . c_str ( ) ) ;
return INTERNAL_ERROR ;
@ -1255,7 +1255,7 @@ Status BlockMemAssigner::ApplyContinuousMemory(const NodePtr &n, const vector<in
auto output_op_desc = node_op_desc - > GetOutputDescPtr ( index ) ;
if ( output_op_desc = = nullptr ) {
REPORT_INNER_ERROR ( " E19999 " , " get output_desc failed, node_name:%s, output_index:%u " ,
n - > GetName ( ) . c_str ( ) , index ) ;
n - > GetName ( ) . c_str ( ) , index ) ;
GELOGE ( INTERNAL_ERROR , " [Get][OutputDesc]node_name:%s, output_index:%u " , n - > GetName ( ) . c_str ( ) , index ) ;
return INTERNAL_ERROR ;
}
@ -1268,7 +1268,7 @@ Status BlockMemAssigner::ApplyContinuousMemory(const NodePtr &n, const vector<in
int64_t size = 0 ;
if ( ge : : TensorUtils : : GetSize ( * output_op_desc , size ) ! = SUCCESS ) {
REPORT_CALL_ERROR ( " E19999 " , " get tensor_size failed, node_name:%s, output_index:%u " ,
n - > GetName ( ) . c_str ( ) , index ) ;
n - > GetName ( ) . c_str ( ) , index ) ;
GELOGE ( INTERNAL_ERROR , " [Get][TensorSize]node_name:%s, output_index:%u " , n - > GetName ( ) . c_str ( ) , index ) ;
return INTERNAL_ERROR ;
}
@ -1310,7 +1310,7 @@ Status BlockMemAssigner::ApplyContinuousMemory(const NodePtr &n, const vector<in
+ + ( block - > ref_count_ ) ;
} else {
REPORT_CALL_ERROR ( " E19999 " , " apply continuousMemory failed, node_name:%s, total_size:%ld " ,
n - > GetName ( ) . c_str ( ) , total_size ) ;
n - > GetName ( ) . c_str ( ) , total_size ) ;
GELOGE ( INTERNAL_ERROR , " [Apply][ContinuousMemory]node_name:%s, total_size:%ld " , n - > GetName ( ) . c_str ( ) , total_size ) ;
return INTERNAL_ERROR ;
}
@ -1346,9 +1346,9 @@ MemoryBlock *BlockMemAssigner::ApplyOutMemory(const NodePtr &n, uint32_t index,
block = symbol_blocks_ [ symbol ] ;
GE_IF_BOOL_EXEC ( block = = nullptr ,
REPORT_INNER_ERROR ( " E19999 " , " get ref block failed, node_name:%s, symbol:%s " ,
node_op_desc - > GetName ( ) . c_str ( ) , node_index_io . ToString ( ) . c_str ( ) ) ;
node_op_desc - > GetName ( ) . c_str ( ) , node_index_io . ToString ( ) . c_str ( ) ) ;
GELOGE ( FAILED , " [Get][RefBlock]node_name:%s, symbol:%s " ,
node_op_desc - > GetName ( ) . c_str ( ) , node_index_io . ToString ( ) . c_str ( ) ) ;
node_op_desc - > GetName ( ) . c_str ( ) , node_index_io . ToString ( ) . c_str ( ) ) ;
return nullptr ) ;
// reduce old size
size_t align_size = block - > Size ( ) ;
@ -1401,9 +1401,9 @@ MemoryBlock *BlockMemAssigner::ApplyOutMemory(const NodePtr &n, uint32_t index,
int out_count = 0 ;
GE_IF_BOOL_EXEC ( index > = n - > GetAllOutDataAnchors ( ) . size ( ) ,
REPORT_INNER_ERROR ( " E19999 " , " out index:%u exceed out_size:%lu, node_name:%s " ,
index , n - > GetAllOutDataAnchors ( ) . size ( ) , n - > GetName ( ) . c_str ( ) ) ;
index , n - > GetAllOutDataAnchors ( ) . size ( ) , n - > GetName ( ) . c_str ( ) ) ;
GELOGE ( FAILED , " [Check][OutIndex]index:%u exceed out_size:%lu, node_name:%s " ,
index , n - > GetAllOutDataAnchors ( ) . size ( ) , n - > GetName ( ) . c_str ( ) ) ;
index , n - > GetAllOutDataAnchors ( ) . size ( ) , n - > GetName ( ) . c_str ( ) ) ;
return nullptr ) ;
auto out_data_anchor = n - > GetOutDataAnchor ( index ) ;
GE_IF_BOOL_EXEC ( out_data_anchor = = nullptr ,
@ -1616,12 +1616,12 @@ Status BlockMemAssigner::AssignOutputMemoryWithReuse(const NodePtr &node, vector
op_desc - > GetOutputsSize ( ) , memorys_type . size ( ) ) ;
if ( has_mem_type_attr & & ( memorys_type . size ( ) ! = op_desc - > GetOutputsSize ( ) ) ) {
REPORT_INNER_ERROR ( " E19999 " , " Attr[%s] size:%zu not equal to node output size:%zu, node_name:%s " ,
ATTR_NAME_OUTPUT_MEM_TYPE_LIST . c_str ( ) , memorys_type . size ( ) ,
op_desc - > GetOutputsSize ( ) , op_desc - > GetName ( ) . c_str ( ) ) ;
ATTR_NAME_OUTPUT_MEM_TYPE_LIST . c_str ( ) , memorys_type . size ( ) ,
op_desc - > GetOutputsSize ( ) , op_desc - > GetName ( ) . c_str ( ) ) ;
GELOGE ( INTERNAL_ERROR ,
" [Check][MemTypeAttr]Attr %s size:%zu not equal to node output size:%zu, node_name:%s " ,
ATTR_NAME_OUTPUT_MEM_TYPE_LIST . c_str ( ) , memorys_type . size ( ) ,
op_desc - > GetOutputsSize ( ) , op_desc - > GetName ( ) . c_str ( ) ) ;
" [Check][MemTypeAttr]Attr %s size:%zu not equal to node output size:%zu, node_name:%s " ,
ATTR_NAME_OUTPUT_MEM_TYPE_LIST . c_str ( ) , memorys_type . size ( ) ,
op_desc - > GetOutputsSize ( ) , op_desc - > GetName ( ) . c_str ( ) ) ;
return INTERNAL_ERROR ;
}
@ -1748,9 +1748,10 @@ void BlockMemAssigner::AssignMemoryWithReuse(vector<int64_t> &ranges) {
if ( has_tvm_workspace_mem_type_attr & & ( temp . size ( ) ! = tvm_workspace_memory_type . size ( ) ) ) {
REPORT_INNER_ERROR ( " E19999 " , " Attr[%s]size:%zu is not equal to workspace size:%zu, node_name:%s " ,
TVM_ATTR_NAME_WORKSPACE_TYPE . c_str ( ) , tvm_workspace_memory_type . size ( ) , temp . size ( ) , n - > GetName ( ) . c_str ( ) ) ;
TVM_ATTR_NAME_WORKSPACE_TYPE . c_str ( ) , tvm_workspace_memory_type . size ( ) ,
temp . size ( ) , n - > GetName ( ) . c_str ( ) ) ;
GELOGE ( INTERNAL_ERROR , " [Check][Attr]Attr %s size:%zu is not equal to workspace size:%zu, node_name:%s " ,
TVM_ATTR_NAME_WORKSPACE_TYPE . c_str ( ) , tvm_workspace_memory_type . size ( ) , temp . size ( ) , n - > GetName ( ) . c_str ( ) ) ;
TVM_ATTR_NAME_WORKSPACE_TYPE . c_str ( ) , tvm_workspace_memory_type . size ( ) , temp . size ( ) , n - > GetName ( ) . c_str ( ) ) ;
return ;
}
for ( size_t i = 0 ; i < temp . size ( ) ; i + + ) {
@ -2160,10 +2161,11 @@ bool BlockMemAssigner::GetWorkSpaceMemoryType(const NodePtr &node, size_t index,
ge : : AttrUtils : : GetListInt ( op_desc , TVM_ATTR_NAME_WORKSPACE_TYPE , workspace_memory_type ) ;
if ( has_workspace_mem_type_attr & & ( workspace_memory_type . size ( ) < = index ) ) {
REPORT_INNER_ERROR ( " E19999 " , " get workspace mem_type failed, "
" index %zu invalid, bigger than attr %s size:%zu, node_name:%s " ,
index , TVM_ATTR_NAME_WORKSPACE_TYPE . c_str ( ) , workspace_memory_type . size ( ) , node - > GetName ( ) . c_str ( ) ) ;
" index %zu invalid, bigger than attr %s size:%zu, node_name:%s " ,
index , TVM_ATTR_NAME_WORKSPACE_TYPE . c_str ( ) ,
workspace_memory_type . size ( ) , node - > GetName ( ) . c_str ( ) ) ;
GELOGE ( INTERNAL_ERROR , " [Get][WorkspaceMemType]index %zu invalid, bigger than attr %s size:%zu, node_name:%s " ,
index , TVM_ATTR_NAME_WORKSPACE_TYPE . c_str ( ) , workspace_memory_type . size ( ) , node - > GetName ( ) . c_str ( ) ) ;
index , TVM_ATTR_NAME_WORKSPACE_TYPE . c_str ( ) , workspace_memory_type . size ( ) , node - > GetName ( ) . c_str ( ) ) ;
return false ;
}
memory_type = has_workspace_mem_type_attr ? workspace_memory_type [ index ] : RT_MEMORY_HBM ;