提交 b8d7cd97 编写于 作者: V VectorSL

gpu change compute capacity strategy

上级 3fa31b34
...@@ -56,7 +56,8 @@ class CudaCommon { ...@@ -56,7 +56,8 @@ class CudaCommon {
#define GET_BLOCKS(total_threads) mindspore::device::gpu::CudaCommon::GetInstance().blocks_num(total_threads) #define GET_BLOCKS(total_threads) mindspore::device::gpu::CudaCommon::GetInstance().blocks_num(total_threads)
#define GET_THREADS mindspore::device::gpu::CudaCommon::GetInstance().threads_num() #define GET_THREADS mindspore::device::gpu::CudaCommon::GetInstance().threads_num()
#define GET_MAJOR_SM mindspore::device::gpu::CudaCommon::GetInstance().major_sm() #define GET_MAJOR_SM mindspore::device::gpu::CudaCommon::GetInstance().major_sm()
#define MINIUM_SM 7 #define MINIUM_SM 6
#define RECOMMEND_SM 7
} // namespace gpu } // namespace gpu
} // namespace device } // namespace device
} // namespace mindspore } // namespace mindspore
......
...@@ -96,9 +96,13 @@ std::pair<bool, size_t> GpuKernelFactory::GpuKernelAttrCheck(const std::string & ...@@ -96,9 +96,13 @@ std::pair<bool, size_t> GpuKernelFactory::GpuKernelAttrCheck(const std::string &
bool flag = true; bool flag = true;
// data type matching check of all input parameters of kernel // data type matching check of all input parameters of kernel
for (size_t input_index = 0; input_index < kernel_info->GetInputNum(); input_index++) { for (size_t input_index = 0; input_index < kernel_info->GetInputNum(); input_index++) {
if (marjor_sm < MINIUM_SM && kernel_info->GetInputDeviceType(input_index) == kNumberTypeFloat16) { if (marjor_sm < RECOMMEND_SM && kernel_info->GetInputDeviceType(input_index) == kNumberTypeFloat16) {
MS_LOG(EXCEPTION) << "Half precision op can be used on Devices which compute capacity is above " << MINIUM_SM if (marjor_sm < MINIUM_SM) {
<< ", but your device's compute capacity is " << marjor_sm; MS_LOG(EXCEPTION) << "Half precision ops can be used on Devices which computing capacity is >= " << MINIUM_SM
<< ", but the current device's computing capacity is " << marjor_sm;
}
MS_LOG(WARNING) << "It is recommended to use devices with a computing capacity >= " << RECOMMEND_SM
<< ", but the current device's computing capacity is " << marjor_sm;
} }
if (kernel_info->GetInputDeviceType(input_index) != if (kernel_info->GetInputDeviceType(input_index) !=
(iter->second)[attr_index].first.GetInputAttr(input_index).first) { (iter->second)[attr_index].first.GetInputAttr(input_index).first) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册