Fix single graph cache hit problem

Signed-off-by: zjun <zhangjun0@huawei.com>
This commit is contained in:
zjun 2022-06-06 11:15:08 +08:00
parent c1f8bdb59f
commit f14ab709cf
4 changed files with 5 additions and 5 deletions

View File

@ -1314,7 +1314,7 @@ void SessionBasic::GetSingleOpGraphInfo(const CNodePtr &kernel, const InputTenso
std::ostringstream buf;
auto prim = common::AnfAlgo::GetCNodePrimitive(kernel);
MS_EXCEPTION_IF_NULL(prim);
buf << prim->id();
buf << prim->name();
bool has_const_input = false;
for (size_t i = 0; i < input_tensors.size(); ++i) {
auto &tensor = input_tensors[i];

View File

@ -3174,7 +3174,7 @@ TopCellInfoPtr GradExecutor::GetTopCellWithDynamicShape(const py::object &cell,
}
const auto &cell_self_id = GetId(cell);
auto it = std::find_if(top_cell_list_.begin(), top_cell_list_.end(), [&cell_self_id](const TopCellInfoPtr &elem) {
return elem->cell_self_info()->cell_self_id == cell_self_id;
return elem->cell_self_info() != nullptr && elem->cell_self_info()->cell_self_id == cell_self_id;
});
if (it != top_cell_list_.end()) {
const auto &elem = *it;

View File

@ -187,7 +187,7 @@ class TopCellInfo {
std::string all_op_info_;
std::string grad_operation_;
abstract::AbstractBasePtr last_output_abs_;
CellSelfInfoPtr cell_self_info_;
CellSelfInfoPtr cell_self_info_{nullptr};
OrderedMap<FuncGraphPtr, GraphInfoPtr> graph_info_map_;
mindspore::HashSet<std::string> sub_cell_list_;
// Record `register hook` or `remove hook` function has been called by sub cell

View File

@ -193,8 +193,8 @@ bool DynamicTbeKernelMod::CopyTilingToDevice(void *stream_ptr) {
}
// cppcheck-suppress unreadVariable
auto lock = device::KernelRuntime::LockRuntime(stream_ptr);
auto ret = aclrtMemcpyAsync(tiling_data_ptr_, op_para_size, tiling_data_.c_str(), tiling_data_.size(),
ACL_MEMCPY_HOST_TO_DEVICE, stream_ptr);
auto ret = rtMemcpyAsync(tiling_data_ptr_, op_para_size, tiling_data_.c_str(), tiling_data_.size(),
RT_MEMCPY_HOST_TO_DEVICE_EX, stream_ptr);
if (ret != RT_ERROR_NONE) {
MS_LOG(EXCEPTION) << "Tiling aclrtMemcpyAsync failed, ret:" << ret;
}