forked from mindspore-Ecosystem/mindspore
!49306 fix the address bug of input node has no user in the old runtime
Merge pull request !49306 from limingqi107/new_actor_runtime
This commit is contained in:
commit
bd3dd5af8b
|
@ -43,6 +43,10 @@ void AscendInferenceSession::LoadInputData(const std::shared_ptr<KernelGraph> &k
|
|||
}
|
||||
auto pk_node = input_node->cast<ParameterPtr>();
|
||||
MS_EXCEPTION_IF_NULL(pk_node);
|
||||
if (!pk_node->IsUsedByRealKernelInGraph(kernel_graph->graph_id())) {
|
||||
MS_LOG(INFO) << "Kernel graph inputs have anfnode which has no user.";
|
||||
continue;
|
||||
}
|
||||
auto device_address = AnfAlgo::GetMutableOutputAddr(pk_node, 0);
|
||||
MS_EXCEPTION_IF_NULL(device_address);
|
||||
if (!common::AnfAlgo::IsParameterWeight(pk_node)) {
|
||||
|
@ -70,6 +74,10 @@ GraphId AscendInferenceSession::CompileGraphImpl(NotNull<FuncGraphPtr> func_grap
|
|||
}
|
||||
auto pk_node = input_node->cast<ParameterPtr>();
|
||||
MS_EXCEPTION_IF_NULL(pk_node);
|
||||
if (!pk_node->IsUsedByRealKernelInGraph(kernel_graph->graph_id())) {
|
||||
MS_LOG(INFO) << "Kernel graph inputs have anfnode which has no user.";
|
||||
continue;
|
||||
}
|
||||
auto device_address = AnfAlgo::GetMutableOutputAddr(pk_node, 0);
|
||||
MS_EXCEPTION_IF_NULL(device_address);
|
||||
if (common::AnfAlgo::IsParameterWeight(pk_node)) {
|
||||
|
|
|
@ -42,6 +42,10 @@ void GpuInferenceSession::LoadInputData(const std::shared_ptr<KernelGraph> &kern
|
|||
}
|
||||
auto pk_node = input_nodes[i]->cast<ParameterPtr>();
|
||||
MS_EXCEPTION_IF_NULL(pk_node);
|
||||
if (!pk_node->IsUsedByRealKernelInGraph(kernel_graph->graph_id())) {
|
||||
MS_LOG(INFO) << "Kernel graph inputs have anfnode which has no user.";
|
||||
continue;
|
||||
}
|
||||
auto device_address = AnfAlgo::GetMutableOutputAddr(pk_node, 0);
|
||||
MS_EXCEPTION_IF_NULL(device_address);
|
||||
if (!common::AnfAlgo::IsParameterWeight(pk_node)) {
|
||||
|
@ -69,6 +73,10 @@ GraphId GpuInferenceSession::CompileGraphImpl(NotNull<FuncGraphPtr> func_graph)
|
|||
}
|
||||
auto pk_node = input_nodes[i]->cast<ParameterPtr>();
|
||||
MS_EXCEPTION_IF_NULL(pk_node);
|
||||
if (!pk_node->IsUsedByRealKernelInGraph(kernel_graph->graph_id())) {
|
||||
MS_LOG(INFO) << "Kernel graph inputs have anfnode which has no user.";
|
||||
continue;
|
||||
}
|
||||
auto device_address = AnfAlgo::GetMutableOutputAddr(pk_node, 0);
|
||||
MS_EXCEPTION_IF_NULL(device_address);
|
||||
if (common::AnfAlgo::IsParameterWeight(pk_node)) {
|
||||
|
|
|
@ -355,6 +355,12 @@ void GPUSession::LoadInputData(const std::shared_ptr<KernelGraph> &kernel_graph,
|
|||
MS_EXCEPTION_IF_NULL(input_node);
|
||||
if (input_node->isa<Parameter>() && AnfAlgo::OutputAddrExist(input_node, 0)) {
|
||||
auto pk_node = input_node->cast<ParameterPtr>();
|
||||
MS_EXCEPTION_IF_NULL(pk_node);
|
||||
if (!pk_node->IsUsedByRealKernelInGraph(kernel_graph->graph_id())) {
|
||||
MS_LOG(INFO) << "Kernel graph inputs have anfnode which has no user.";
|
||||
tensor->set_sync_status(kNoNeedSync);
|
||||
continue;
|
||||
}
|
||||
auto device_address = AnfAlgo::GetMutableOutputAddr(pk_node, 0);
|
||||
MS_EXCEPTION_IF_NULL(device_address);
|
||||
bool need_sync = CheckIfNeedSync(tensor, device_address, pk_node);
|
||||
|
|
Loading…
Reference in New Issue