diff --git a/mindspore/ccsrc/runtime/device/ascend/ascend_stream_assign.cc b/mindspore/ccsrc/runtime/device/ascend/ascend_stream_assign.cc index c59a7b44341..54440475361 100644 --- a/mindspore/ccsrc/runtime/device/ascend/ascend_stream_assign.cc +++ b/mindspore/ccsrc/runtime/device/ascend/ascend_stream_assign.cc @@ -541,6 +541,9 @@ void AscendStreamAssign::TrailingTimeOptimizationByReorder(const NotNull subgraph_cnodes; while (pos < cnode_ptr_list.end() && AnfAlgo::GetGraphId((*pos).get()) == subgraph_id) { + if (AnfAlgo::GetCNodeName(*pos) == kLabelGotoOpName) { + break; + } if (*pos != first_output_ptr) { subgraph_cnodes.emplace_back(*pos); } else {