Browse Source

fix(mgb/cuda): fix conv error when the input tensor is too large

GitOrigin-RevId: 1b1d693795
tags/v1.7.0.m1
Megvii Engine Team 3 years ago
parent
commit
0d16952470
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      dnn/src/cuda/conv_bias/cudnn_conv.cpp

+ 6
- 0
dnn/src/cuda/conv_bias/cudnn_conv.cpp View File

@@ -40,6 +40,12 @@ bool ConvBiasForwardImpl::AlgoCUDNNConv::is_available(const SizeArgs& args) cons
return false;
}

// In conv_args.init_conv_desc will call cudnnSetTensor4dDescriptorEx(),which can't
// been supported when total_nr_elems() > 2 ^ 31
if (args.src_layout->total_nr_elems() > INT_MAX ||
args.dst_layout->total_nr_elems() > INT_MAX) {
return false;
}
auto dst_layout = *args.dst_layout;
if (dst_layout.dtype.enumv() != args.bias_layout->dtype.enumv()) {
dst_layout.dtype = DType();


Loading…
Cancel
Save