!48900 Disable internal device address relationship in zero copy.

Merge pull request !48900 from gaoyong10/dynamic_shape_03
This commit is contained in:
i-robot 2023-02-15 09:02:05 +00:00 committed by Gitee
commit f0694b2f0c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 4 additions and 1 deletions

View File

@ -669,7 +669,10 @@ void KernelRuntime::AssignStaticMemoryInput(const session::KernelGraph &graph) {
MS_LOG(INFO) << "It is not suggested to use a lonely weight parameter as the output of graph";
continue;
}
DeviceAddressPtr device_address = GetInternalDeviceAddress(graph, item);
// If kernel has flag kFlagEnableZeroCopyInGraph, the internal parameter and the corresponding
// cnode cannot use the same device address.
DeviceAddressPtr device_address =
(graph.has_flag(kFlagEnableZeroCopyInGraph) ? nullptr : GetInternalDeviceAddress(graph, item));
GetDeviceAddress(item, shadow_backend_node_map, index, graph, &device_address);
AnfAlgo::SetOutputAddr(device_address, index, item.get());
}