Merge pull request !28751 from limingqi107/new_actor_runtimetags/v1.6.0
| @@ -82,7 +82,7 @@ bool EnvironSetCPUKernel::Launch(const std::vector<AddressPtr> &inputs, const st | |||
| if (env == nullptr) { | |||
| MS_LOG(EXCEPTION) << "Get the env failed, handle: " << host_handle << ", key: " << host_key; | |||
| } | |||
| auto env_value = std::make_shared<EnvironValue>(value_ptr, value_size_, value_type_attr_, kGPUDevice); | |||
| auto env_value = std::make_shared<EnvironValue>(value_ptr, value_size_, value_type_attr_, kCPUDevice); | |||
| env->Set(host_key, env_value); | |||
| // Set output handle. | |||
| @@ -61,7 +61,7 @@ void EnvironMgr::Clear() { | |||
| mutex.unlock(); | |||
| } | |||
| bool EnvironMgr::CheckEnvInput(const CNodePtr &kernel_node) { | |||
| bool EnvironMgr::CheckEnvInput(const CNodePtr &kernel_node) const { | |||
| MS_EXCEPTION_IF_NULL(kernel_node); | |||
| // Check the value type attr. | |||
| auto value_type_attr = TypeId(AnfAlgo::GetNodeAttr<int>(kernel_node, kEnvValueTypeAttr)); | |||
| @@ -98,7 +98,7 @@ bool EnvironMgr::CheckEnvInput(const CNodePtr &kernel_node) { | |||
| return true; | |||
| } | |||
| bool EnvironMgr::IsScalarTensor(TypeId type, std::vector<size_t> shape) { | |||
| bool EnvironMgr::IsScalarTensor(TypeId type, const std::vector<size_t> &shape) const { | |||
| if (type == kObjectTypeTensorType) { | |||
| MS_LOG(ERROR) << "The type is invalid: " << type; | |||
| return false; | |||
| @@ -41,9 +41,9 @@ class EnvironMgr { | |||
| void Clear(); | |||
| // Check whether the inputs of EnvironGet kernel or EnvironSet kernel are valid. | |||
| bool CheckEnvInput(const CNodePtr &kernel_node); | |||
| bool CheckEnvInput(const CNodePtr &kernel_node) const; | |||
| // Check whether is scalar tensor. Environ handle and env key only support scalar tensor currently. | |||
| bool IsScalarTensor(TypeId type, std::vector<size_t> shape); | |||
| bool IsScalarTensor(TypeId type, const std::vector<size_t> &shape) const; | |||
| private: | |||
| EnvironMgr() = default; | |||
| @@ -1219,14 +1219,15 @@ void KernelGraph::CacheGraphOutputToFrontNodeWithIndex(const std::vector<AnfNode | |||
| std::vector<KernelWithIndex> backend_output_nodes; | |||
| for (auto &backend_output : backend_outputs) { | |||
| auto temp_backend_outputs = AnfAlgo::GetAllOutputWithIndex(backend_output); | |||
| backend_output_nodes.insert(backend_output_nodes.end(), temp_backend_outputs.begin(), temp_backend_outputs.end()); | |||
| (void)backend_output_nodes.insert(backend_output_nodes.end(), temp_backend_outputs.begin(), | |||
| temp_backend_outputs.end()); | |||
| } | |||
| MS_LOG(INFO) << "Get graph front output nodes."; | |||
| std::vector<KernelWithIndex> front_output_nodes; | |||
| for (auto &front_output : front_outputs) { | |||
| auto temp_front_outputs = AnfAlgo::GetAllOutputWithIndex(front_output); | |||
| front_output_nodes.insert(front_output_nodes.end(), temp_front_outputs.begin(), temp_front_outputs.end()); | |||
| (void)front_output_nodes.insert(front_output_nodes.end(), temp_front_outputs.begin(), temp_front_outputs.end()); | |||
| } | |||
| if (backend_output_nodes.size() != front_output_nodes.size()) { | |||
| @@ -1425,7 +1426,7 @@ bool KernelGraph::IsChildGraphResult(const AnfNodePtr &node) { | |||
| for (const auto &child_graph_result : child_graph_result_) { | |||
| MS_EXCEPTION_IF_NULL(child_graph_result); | |||
| auto outputs = AnfAlgo::GetAllOutput(child_graph_result); | |||
| child_graph_results.insert(child_graph_results.end(), outputs.begin(), outputs.end()); | |||
| (void)child_graph_results.insert(child_graph_results.end(), outputs.begin(), outputs.end()); | |||
| } | |||
| return find(child_graph_results.begin(), child_graph_results.end(), node) != child_graph_results.end(); | |||
| @@ -22,7 +22,7 @@ ControlActor::ControlActor(const std::string &name, KernelTransformType type, co | |||
| const std::vector<KernelWithIndex> ¶meters, const AnfNodePtr &node) | |||
| : MemoryAwareActor(name, type, nullptr, memory_manager_aid), formal_parameters_(parameters), node_(node) { | |||
| for (size_t i = 0; i < parameters.size(); ++i) { | |||
| input_partials_.emplace_back(std::make_shared<OpPartial>()); | |||
| (void)input_partials_.emplace_back(std::make_shared<OpPartial>()); | |||
| } | |||
| input_device_tensors_.resize(parameters.size()); | |||
| } | |||
| @@ -119,7 +119,7 @@ void ControlActor::Run(OpContext<DeviceTensor> *const context) { | |||
| void ControlActor::RunOpPartial(const OpPartialPtr &partial, size_t position, OpContext<DeviceTensor> *const context) { | |||
| MS_EXCEPTION_IF_NULL(context); | |||
| auto &sequential_num = context->sequential_num_; | |||
| input_op_partials_[sequential_num].emplace_back(position, partial); | |||
| (void)input_op_partials_[sequential_num].emplace_back(position, partial); | |||
| auto is_run = CheckRunningCondition(context); | |||
| MS_LOG(DEBUG) << "Actor(" << GetAID().Name() | |||
| @@ -266,14 +266,14 @@ void ControlActor::IncreaseDynamicRefCounts(OpContext<DeviceTensor> *const conte | |||
| } | |||
| // Increase dynamic ref count by the output partial. | |||
| for (const auto &partial_arrow : output_partial_arrows_) { | |||
| MS_EXCEPTION_IF_NULL(partial_arrow); | |||
| if (IntToSize(partial_arrow->from_output_index_) >= input_partials_.size()) { | |||
| std::string error_info = "Invalid partial input:" + std::to_string(partial_arrow->from_output_index_) + | |||
| for (const auto &output_partial_arrow : output_partial_arrows_) { | |||
| MS_EXCEPTION_IF_NULL(output_partial_arrow); | |||
| if (IntToSize(output_partial_arrow->from_output_index_) >= input_partials_.size()) { | |||
| std::string error_info = "Invalid partial input:" + std::to_string(output_partial_arrow->from_output_index_) + | |||
| " current:" + std::to_string(input_partials_.size()) + " for actor:" + GetAID().Name(); | |||
| SET_OPCONTEXT_FAIL_RET_WITH_ERROR((*context), error_info); | |||
| } | |||
| auto output_partial = input_partials_[partial_arrow->from_output_index_]; | |||
| auto output_partial = input_partials_[output_partial_arrow->from_output_index_]; | |||
| IncreaseDynamicRefCount(output_partial); | |||
| } | |||
| } | |||
| @@ -285,16 +285,16 @@ void ControlActor::SendMemoryFreeReq(OpContext<DeviceTensor> *const context) { | |||
| // Collect the input device tensors. | |||
| std::vector<DeviceTensor *> memory_free_list; | |||
| if (input_op_datas_.count(sequential_num) > 0) { | |||
| for (auto &input_data : input_op_datas_[sequential_num]) { | |||
| MS_EXCEPTION_IF_NULL(input_data); | |||
| MS_EXCEPTION_IF_NULL(input_data->data_); | |||
| memory_free_list.emplace_back(input_data->data_); | |||
| for (auto &input_op_data : input_op_datas_[sequential_num]) { | |||
| MS_EXCEPTION_IF_NULL(input_op_data); | |||
| MS_EXCEPTION_IF_NULL(input_op_data->data_); | |||
| (void)memory_free_list.emplace_back(input_op_data->data_); | |||
| } | |||
| } | |||
| if (input_op_partials_.count(sequential_num) > 0) { | |||
| for (auto &input_partial_pair : input_op_partials_[sequential_num]) { | |||
| const auto &partial_device_tensors = GetAllDeviceTensors(input_partial_pair.second); | |||
| for (auto &input_op_partial : input_op_partials_[sequential_num]) { | |||
| const auto &partial_device_tensors = GetAllDeviceTensors(input_op_partial.second); | |||
| (void)std::copy(partial_device_tensors.begin(), partial_device_tensors.end(), | |||
| std::back_inserter(memory_free_list)); | |||
| } | |||
| @@ -204,24 +204,24 @@ void EntranceActor::EraseInput(const OpContext<DeviceTensor> *const context) { | |||
| const auto &data_iter = input_op_datas_.find(sequential_num); | |||
| if (data_iter != input_op_datas_.end()) { | |||
| input_op_datas_.erase(data_iter); | |||
| (void)input_op_datas_.erase(data_iter); | |||
| } | |||
| const auto &control_iter = input_op_controls_.find(sequential_num); | |||
| if (control_iter != input_op_controls_.end()) { | |||
| input_op_controls_.erase(control_iter); | |||
| (void)input_op_controls_.erase(control_iter); | |||
| } | |||
| const auto &loop_body_control_iter = loop_body_input_op_controls_.find(sequential_num); | |||
| if (loop_body_control_iter != loop_body_input_op_controls_.end()) { | |||
| loop_body_input_op_controls_.erase(loop_body_control_iter); | |||
| (void)loop_body_input_op_controls_.erase(loop_body_control_iter); | |||
| } | |||
| const auto &iter = real_parameters_with_branch_id_.find(sequential_num); | |||
| if (iter != real_parameters_with_branch_id_.end()) { | |||
| iter->second.pop(); | |||
| if (iter->second.empty()) { | |||
| real_parameters_with_branch_id_.erase(sequential_num); | |||
| (void)real_parameters_with_branch_id_.erase(sequential_num); | |||
| } | |||
| } | |||
| } | |||
| @@ -236,7 +236,7 @@ void EntranceActor::SendMemoryFreeReq(OpContext<DeviceTensor> *const context) { | |||
| for (auto &input_data : input_op_datas_[sequential_num]) { | |||
| MS_EXCEPTION_IF_NULL(input_data); | |||
| MS_EXCEPTION_IF_NULL(input_data->data_); | |||
| memory_free_list.emplace_back(input_data->data_); | |||
| (void)memory_free_list.emplace_back(input_data->data_); | |||
| } | |||
| } | |||
| @@ -29,7 +29,7 @@ void ExitActor::Init() { | |||
| for (auto &data_arrow : output_branch_data_arrows) { | |||
| MS_EXCEPTION_IF_NULL(data_arrow); | |||
| auto data = std::make_unique<OpData<DeviceTensor>>(data_arrow->to_op_id_, nullptr, data_arrow->to_input_index_); | |||
| output_branch_data_[i].emplace_back(data_arrow->from_output_index_, std::move(data)); | |||
| (void)output_branch_data_[i].emplace_back(data_arrow->from_output_index_, std::move(data)); | |||
| } | |||
| } | |||
| } | |||
| @@ -116,7 +116,7 @@ void ExitActor::IncreaseDynamicRefCounts(OpContext<DeviceTensor> *const context) | |||
| " current:" + std::to_string(input_partials_.size()) + " for actor:" + GetAID().Name(); | |||
| SET_OPCONTEXT_FAIL_RET_WITH_ERROR((*context), error_info); | |||
| } | |||
| auto output_partial = input_partials_[partial_arrow->from_output_index_]; | |||
| auto output_partial = input_partials_[IntToSize(partial_arrow->from_output_index_)]; | |||
| IncreaseDynamicRefCount(output_partial); | |||
| } | |||
| } | |||
| @@ -139,7 +139,7 @@ void ExitActor::CopyDeviceAddress(OpContext<DeviceTensor> *const context) { | |||
| for (size_t i = 0; i < input_device_tensors_.size(); ++i) { | |||
| auto input_device_tensor = input_device_tensors_[i]; | |||
| if (!is_need_copy_device_tensors_[i]) { | |||
| new_device_tensors.emplace_back(input_device_tensor); | |||
| (void)new_device_tensors.emplace_back(input_device_tensor); | |||
| continue; | |||
| } | |||
| @@ -147,7 +147,7 @@ void ExitActor::CopyDeviceAddress(OpContext<DeviceTensor> *const context) { | |||
| const KernelWithIndex &node_with_index = input_device_tensor->GetNodeIndex(); | |||
| MS_EXCEPTION_IF_NULL(node_with_index.first); | |||
| if (HasAbstractRef(node_with_index.first)) { | |||
| new_device_tensors.emplace_back(input_device_tensor); | |||
| (void)new_device_tensors.emplace_back(input_device_tensor); | |||
| continue; | |||
| } | |||
| MS_EXCEPTION_IF_NULL(device_contexts_[i]); | |||
| @@ -155,8 +155,8 @@ void ExitActor::CopyDeviceAddress(OpContext<DeviceTensor> *const context) { | |||
| auto new_device_tensor = device_contexts_[i]->CreateDeviceAddress( | |||
| nullptr, input_device_tensor->GetSize(), input_device_tensor->format(), input_device_tensor->type_id()); | |||
| MS_EXCEPTION_IF_NULL(new_device_tensor); | |||
| created_device_tensors_.emplace_back(new_device_tensor); | |||
| new_device_tensors.emplace_back(new_device_tensor.get()); | |||
| (void)created_device_tensors_.emplace_back(new_device_tensor); | |||
| (void)new_device_tensors.emplace_back(new_device_tensor.get()); | |||
| new_device_tensor->SetNodeIndex(node_with_index.first, node_with_index.second); | |||
| new_device_tensor->set_from_persistent_mem(input_device_tensor->from_persistent_mem()); | |||
| @@ -62,7 +62,7 @@ void GatherActor::SendOutput(OpContext<DeviceTensor> *const context) { | |||
| IntToSize(partial_arrow->to_input_index_), context); | |||
| } else { | |||
| ActorDispatcher::Send(partial_arrow->to_op_id_, &ControlActor::RunOpPartial, | |||
| input_partials_[partial_arrow->from_output_index_], | |||
| input_partials_[IntToSize(partial_arrow->from_output_index_)], | |||
| IntToSize(partial_arrow->to_input_index_), context); | |||
| } | |||
| } | |||
| @@ -105,7 +105,7 @@ void GatherActor::IncreaseDynamicRefCounts(OpContext<DeviceTensor> *const contex | |||
| if (partial_arrow->from_output_index_ == 0) { | |||
| IncreaseDynamicRefCount(gather_input_); | |||
| } else { | |||
| IncreaseDynamicRefCount(input_partials_[partial_arrow->from_output_index_]); | |||
| IncreaseDynamicRefCount(input_partials_[IntToSize(partial_arrow->from_output_index_)]); | |||
| } | |||
| } | |||
| } | |||
| @@ -132,14 +132,14 @@ void GatherActor::GatherInput(OpContext<DeviceTensor> *const context) { | |||
| for (size_t i = 0; i < input_device_tensors_.size(); ++i) { | |||
| const auto &device_tensor = input_device_tensors_[i]; | |||
| if (device_tensor != nullptr) { | |||
| gather_input_->device_tensors_.emplace_back(i + offset, device_tensor); | |||
| (void)gather_input_->device_tensors_.emplace_back(i + offset, device_tensor); | |||
| } | |||
| } | |||
| // Put other partials in the first partial. | |||
| for (size_t i = 1; i < input_partials_.size(); ++i) { | |||
| if (input_partials_[i] != nullptr && input_partials_[i]->func_graph_ != nullptr) { | |||
| gather_input_->partials_.emplace_back(i + offset, input_partials_[i]); | |||
| (void)gather_input_->partials_.emplace_back(i + offset, input_partials_[i]); | |||
| } | |||
| } | |||
| } | |||
| @@ -83,7 +83,7 @@ void StackActor::RunOpData(OpData<DeviceTensor> *const input_data, OpContext<Dev | |||
| input_stack_data_[context->sequential_num_][input_data->index_].push(input_data->data_); | |||
| } else { | |||
| // The outputs of call nodes are placed directly in the input data. | |||
| input_op_datas_[context->sequential_num_].emplace_back(input_data); | |||
| (void)input_op_datas_[context->sequential_num_].emplace_back(input_data); | |||
| } | |||
| auto is_run = CheckRunningCondition(context); | |||
| @@ -121,7 +121,7 @@ void StackActor::RunOpPartial(const OpPartialPtr &partial, size_t position, OpCo | |||
| local_device_tensors_.size()) { | |||
| input_stack_partials_[context->sequential_num_][position].push(self_partial); | |||
| } else { | |||
| input_op_partials_[context->sequential_num_].emplace_back(position, self_partial); | |||
| (void)input_op_partials_[context->sequential_num_].emplace_back(position, self_partial); | |||
| } | |||
| auto is_run = CheckRunningCondition(context); | |||
| @@ -304,7 +304,7 @@ void StackActor::SendMemoryFreeReq(OpContext<DeviceTensor> *const context) { | |||
| for (auto &input_data : input_op_datas_[sequential_num]) { | |||
| MS_EXCEPTION_IF_NULL(input_data); | |||
| MS_EXCEPTION_IF_NULL(input_data->data_); | |||
| memory_free_list.emplace_back(input_data->data_); | |||
| (void)memory_free_list.emplace_back(input_data->data_); | |||
| } | |||
| } | |||
| @@ -319,7 +319,7 @@ void StackActor::SendMemoryFreeReq(OpContext<DeviceTensor> *const context) { | |||
| if ((input_stack_data_num_ != 0) && (input_stack_data_.count(sequential_num) > 0)) { | |||
| for (auto &stack_data_pair : input_stack_data_[sequential_num]) { | |||
| if (!stack_data_pair.second.empty()) { | |||
| memory_free_list.emplace_back(stack_data_pair.second.top()); | |||
| (void)memory_free_list.emplace_back(stack_data_pair.second.top()); | |||
| } | |||
| } | |||
| } | |||
| @@ -192,7 +192,7 @@ void SuperKernelActor::SendMemoryFreeReq(OpContext<DeviceTensor> *const context) | |||
| MS_EXCEPTION_IF_NULL(input_data); | |||
| MS_EXCEPTION_IF_NULL(input_data->data_); | |||
| if (input_data->data_->dynamic_ref_count() != INT32_MAX) { | |||
| memory_free_list.emplace_back(input_data->data_); | |||
| (void)memory_free_list.emplace_back(input_data->data_); | |||
| } | |||
| } | |||
| } | |||
| @@ -264,7 +264,7 @@ void GraphScheduler::Initialize() { | |||
| if (ret != MINDRT_OK) { | |||
| MS_LOG(EXCEPTION) << "Actor manager init failed."; | |||
| } | |||
| (void)common::SetOMPThreadNum(); | |||
| common::SetOMPThreadNum(); | |||
| auto OMP_thread_num_used = common::GetEnv("OMP_NUM_THREADS"); | |||
| MS_LOG(INFO) << "The actor thread number: " << actor_thread_num | |||
| << ", the kernel thread number: " << (actor_and_kernel_thread_num - actor_thread_num) | |||
| @@ -902,7 +902,7 @@ void GraphScheduler::LinkDataArrowInSinkMode(const KernelGraphPtr &graph, const | |||
| } | |||
| auto to_actor_name = graph->ToString() + "_SuperKernelActor"; | |||
| auto to_actor = dynamic_cast<SuperKernelActor *>(FetchActor(to_actor_name)); | |||
| auto to_actor = FetchActor(to_actor_name); | |||
| MS_EXCEPTION_IF_NULL(to_actor); | |||
| auto &input_nodes = graph->input_nodes(); | |||
| @@ -970,7 +970,7 @@ void GraphScheduler::LinkDataArrowInNonSinkMode(const KernelGraphPtr &graph, | |||
| if (IsSkippedKernelActor(kernel) || (!IsKernelActor(kernel, graph_compiler_info.strategy_))) { | |||
| continue; | |||
| } | |||
| const auto &kernel_actor = dynamic_cast<KernelActor *>(FetchActor(kernel->fullname_with_scope())); | |||
| const auto &kernel_actor = FetchActor(kernel->fullname_with_scope()); | |||
| MS_EXCEPTION_IF_NULL(kernel_actor); | |||
| for (size_t i = 0; i < AnfAlgo::GetInputNum(kernel); ++i) { | |||
| @@ -1323,7 +1323,7 @@ void GraphScheduler::LinkControlArrowBySkippedNode(AbstractActor *to_actor, cons | |||
| for (size_t i = 0; i < input_num; ++i) { | |||
| auto kernel_with_index = AnfAlgo::GetPrevNodeOutput(skipped_node, i, false); | |||
| MS_EXCEPTION_IF_NULL(kernel_with_index.first); | |||
| auto from_actor = dynamic_cast<KernelActor *>(FetchActor(kernel_with_index.first->fullname_with_scope())); | |||
| auto from_actor = FetchActor(kernel_with_index.first->fullname_with_scope()); | |||
| MS_EXCEPTION_IF_NULL(from_actor); | |||
| MS_LOG(INFO) << "Link control arrow by skipped node: " << skipped_node->fullname_with_scope() | |||
| << ", from actor: " << from_actor->GetAID().Name() << ", to actor: " << to_actor->GetAID().Name(); | |||
| @@ -1341,9 +1341,9 @@ void GraphScheduler::LinkControlArrowBySendRecvNodes(const KernelGraphPtr &graph | |||
| MS_EXCEPTION_IF_NULL(from_send_node); | |||
| MS_EXCEPTION_IF_NULL(from_recv_node); | |||
| MS_LOG(INFO) << "Link control arrow for to_allreduce_node: " << to_allreduce_node->fullname_with_scope(); | |||
| auto to_allreduce_actor = dynamic_cast<KernelActor *>(FetchActor(to_allreduce_node->fullname_with_scope())); | |||
| auto from_send_actor = dynamic_cast<KernelActor *>(FetchActor(from_send_node->fullname_with_scope())); | |||
| auto from_recv_actor = dynamic_cast<KernelActor *>(FetchActor(from_recv_node->fullname_with_scope())); | |||
| auto to_allreduce_actor = FetchActor(to_allreduce_node->fullname_with_scope()); | |||
| auto from_send_actor = FetchActor(from_send_node->fullname_with_scope()); | |||
| auto from_recv_actor = FetchActor(from_recv_node->fullname_with_scope()); | |||
| MS_EXCEPTION_IF_NULL(to_allreduce_actor); | |||
| MS_EXCEPTION_IF_NULL(from_send_actor); | |||
| MS_EXCEPTION_IF_NULL(from_recv_actor); | |||
| @@ -1369,8 +1369,8 @@ void GraphScheduler::LinkControlArrowBySendRecvNodes(const KernelGraphPtr &graph | |||
| MS_EXCEPTION_IF_NULL(to_send_node); | |||
| MS_EXCEPTION_IF_NULL(to_recv_node); | |||
| MS_LOG(INFO) << "Link control arrow for from_allreduce_node: " << from_allreduce_node->fullname_with_scope(); | |||
| auto from_allreduce_actor = dynamic_cast<KernelActor *>(FetchActor(from_allreduce_node->fullname_with_scope())); | |||
| auto to_send_actor = dynamic_cast<KernelActor *>(FetchActor(to_send_node->fullname_with_scope())); | |||
| auto from_allreduce_actor = FetchActor(from_allreduce_node->fullname_with_scope()); | |||
| auto to_send_actor = FetchActor(to_send_node->fullname_with_scope()); | |||
| auto to_recv_actor = dynamic_cast<KernelActor *>(FetchActor(to_recv_node->fullname_with_scope())); | |||
| MS_EXCEPTION_IF_NULL(from_allreduce_actor); | |||
| MS_EXCEPTION_IF_NULL(to_send_actor); | |||
| @@ -1382,7 +1382,7 @@ void GraphScheduler::LinkControlArrowBySendRecvNodes(const KernelGraphPtr &graph | |||
| AddControlArrow(to_send_actor, to_recv_actor); | |||
| // to_recv_actor --> outputs of from_allreduce_actor | |||
| for (auto &output_data_arrow : from_allreduce_actor->output_data_arrows_) { | |||
| auto output_actor = dynamic_cast<KernelActor *>(FetchActor(output_data_arrow->to_op_id_.Name())); | |||
| auto output_actor = FetchActor(output_data_arrow->to_op_id_.Name()); | |||
| if (output_actor != nullptr) { | |||
| AddControlArrow(to_recv_actor, output_actor); | |||
| } | |||
| @@ -1513,8 +1513,8 @@ void GraphScheduler::LinkControlArrowByCommunicationNode(const std::vector<CNode | |||
| // Ensure communication node to execute orderly. | |||
| for (size_t i = 1; i < communication_nodes.size(); ++i) { | |||
| auto from_actor = dynamic_cast<KernelActor *>(FetchActor(communication_nodes[i - 1]->fullname_with_scope())); | |||
| auto to_actor = dynamic_cast<KernelActor *>(FetchActor(communication_nodes[i]->fullname_with_scope())); | |||
| auto from_actor = FetchActor(communication_nodes[i - 1]->fullname_with_scope()); | |||
| auto to_actor = FetchActor(communication_nodes[i]->fullname_with_scope()); | |||
| MS_EXCEPTION_IF_NULL(from_actor); | |||
| MS_EXCEPTION_IF_NULL(to_actor); | |||
| AddControlArrow(from_actor, to_actor); | |||
| @@ -1526,8 +1526,8 @@ void GraphScheduler::LinkControlArrowByCommunicationNode(const std::vector<CNode | |||
| MS_EXCEPTION_IF_NULL(graph); | |||
| auto &execution_order = graph->execution_order(); | |||
| for (size_t i = 1; i < execution_order.size(); ++i) { | |||
| auto from_actor = dynamic_cast<KernelActor *>(FetchActor(execution_order[i - 1]->fullname_with_scope())); | |||
| auto to_actor = dynamic_cast<KernelActor *>(FetchActor(execution_order[i]->fullname_with_scope())); | |||
| auto from_actor = FetchActor(execution_order[i - 1]->fullname_with_scope()); | |||
| auto to_actor = FetchActor(execution_order[i]->fullname_with_scope()); | |||
| if ((from_actor != nullptr) && (to_actor != nullptr)) { | |||
| AddControlArrow(from_actor, to_actor); | |||
| } | |||