|
@@ -2189,17 +2189,21 @@ Status GraphManager::OptimizeStage2(ge::ComputeGraphPtr &compute_graph) { |
|
|
return ret; |
|
|
return ret; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Assign functional op labels. |
|
|
|
|
|
GE_TIMESTAMP_START(AssignFunctionalLabels); |
|
|
|
|
|
LabelAllocator label_allocator(compute_graph); |
|
|
|
|
|
GE_CHK_STATUS_RET(label_allocator.AssignFunctionalLabels(), "Assign label failed."); |
|
|
|
|
|
GE_TIMESTAMP_END(AssignFunctionalLabels, "ModelBuilder::AssignFunctionalLabels"); |
|
|
|
|
|
|
|
|
|
|
|
// Add memcpy addr asynchronous node. |
|
|
|
|
|
GE_TIMESTAMP_START(AddMemcpyAddrAsyncNode); |
|
|
|
|
|
MemcpyAddrAsyncPass memcpy_addr; |
|
|
|
|
|
GE_CHK_STATUS_RET(memcpy_addr.Run(compute_graph), "Add memcpy_addr_async node failed."); |
|
|
|
|
|
GE_TIMESTAMP_END(AddMemcpyAddrAsyncNode, "MemcpyAddrAsyncPass::Run."); |
|
|
|
|
|
|
|
|
bool is_dynamic_shape = false; |
|
|
|
|
|
(void)AttrUtils::GetBool(compute_graph, ATTR_NAME_DYNAMIC_SHAPE_PARTITIONED, is_dynamic_shape); |
|
|
|
|
|
if (!is_dynamic_shape) { |
|
|
|
|
|
// Assign functional op labels. |
|
|
|
|
|
GE_TIMESTAMP_START(AssignFunctionalLabels); |
|
|
|
|
|
LabelAllocator label_allocator(compute_graph); |
|
|
|
|
|
GE_CHK_STATUS_RET(label_allocator.AssignFunctionalLabels(), "Assign label failed."); |
|
|
|
|
|
GE_TIMESTAMP_END(AssignFunctionalLabels, "ModelBuilder::AssignFunctionalLabels"); |
|
|
|
|
|
|
|
|
|
|
|
// Add memcpy addr asynchronous node. |
|
|
|
|
|
GE_TIMESTAMP_START(AddMemcpyAddrAsyncNode); |
|
|
|
|
|
MemcpyAddrAsyncPass memcpy_addr; |
|
|
|
|
|
GE_CHK_STATUS_RET(memcpy_addr.Run(compute_graph), "Add memcpy_addr_async node failed."); |
|
|
|
|
|
GE_TIMESTAMP_END(AddMemcpyAddrAsyncNode, "MemcpyAddrAsyncPass::Run."); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// After while sub graph handle, mark all node rw type |
|
|
// After while sub graph handle, mark all node rw type |
|
|
auto result = GetCompilerStages(compute_graph->GetGraphID()).optimizer.HandleMemoryRWConflict(compute_graph); |
|
|
auto result = GetCompilerStages(compute_graph->GetGraphID()).optimizer.HandleMemoryRWConflict(compute_graph); |
|
|