forked from mindspore-Ecosystem/mindspore
!68 fix bug: Failed to get parameter data in model parallel scenes, when the size of tensor large than 2GB
Merge pull request !68 from WeibiaoYu/master
This commit is contained in:
commit
a44b5293de
|
@ -361,12 +361,11 @@ MeTensorPtr TransformUtil::GenerateMeTensor(const GeTensorPtr& ge_tensor, const
|
||||||
MS_LOG(ERROR) << "GE tensor data size is zero!";
|
MS_LOG(ERROR) << "GE tensor data size is zero!";
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
errno_t ret = memcpy_s(me_data_ptr, me_data_size, ge_tensor->GetData(), ge_tensor->GetSize());
|
|
||||||
if (ret != EOK) {
|
// Use memcpy here, not memcpy_s, just because the size of ge_tensor may be bigger than 2GB
|
||||||
MS_LOG(INFO) << "GE tensor data size is " << ge_tensor->GetSize() << " bytes";
|
// which is the size limit of memcpy_s
|
||||||
MS_LOG(ERROR) << "Copy GE tensor data to me tensor failed";
|
memcpy(me_data_ptr, ge_tensor->GetData(), ge_tensor->GetSize());
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
return make_shared<MeTensor>(me_tensor);
|
return make_shared<MeTensor>(me_tensor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue