From 197b00331eeab676de7b80704cbbdccdc8867432 Mon Sep 17 00:00:00 2001 From: VectorSL Date: Tue, 8 Sep 2020 17:00:45 +0800 Subject: [PATCH] tensorcore can only used in Volta or newer devices --- mindspore/ccsrc/runtime/device/gpu/kernel_info_setter.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mindspore/ccsrc/runtime/device/gpu/kernel_info_setter.cc b/mindspore/ccsrc/runtime/device/gpu/kernel_info_setter.cc index 88f76bc8e..4a71b50be 100644 --- a/mindspore/ccsrc/runtime/device/gpu/kernel_info_setter.cc +++ b/mindspore/ccsrc/runtime/device/gpu/kernel_info_setter.cc @@ -27,6 +27,7 @@ #include "utils/ms_utils.h" #include "backend/kernel_compiler/oplib/oplib.h" #include "backend/kernel_compiler/oplib/opinfo.h" +#include "runtime/device/gpu/cuda_common.h" namespace mindspore { namespace device { @@ -236,6 +237,12 @@ void UpdateKernelFormatInfo(const CNodePtr &kernel_node, const std::vector &kernel_graph) { + // TensorCore can be used only in Volta or newer devices. + const int marjor_sm = GET_MAJOR_SM; + if (marjor_sm < RECOMMEND_SM) { + format_transform_ = false; + return; + } auto kernels = kernel_graph->execution_order(); size_t conv_cnt = 0; size_t bn_cnt = 0; -- GitLab