Repository: pytorch
Issue: cuDNN error: CUDNN_STATUS_MAPPING_ERROR on gtx_1080/A10 when conv1d is called
Labels: module: cudnn,module: cuda,triaged

### 🐛 Describe the bug

In the past week i experienced issues when training my model with pytorch. Whenever conv1d is called on my data like shown below:
```
class Conv1DBlock(torch.nn.Module):
    """
    A 1D-Convolution with ReLU, batch-norm and non-broadcasted dropout
    Will pad to the same output length
    """

    def __init__(self, in_size, out_size, filter_size, dropout):
        """
        :param in_size: input feature size
        :param out_size: output feature size
        :param filter_size: filter size
        :param dropout: dropout probability
        """
        super().__init__()
        assert filter_size % 2 == 1, "Only odd filter sizes allowed"
        self.conv = nn.Conv1d(in_size, out_size, filter_size, padding=filter_size // 2)
        self.bn = nn.BatchNorm1d(num_features=out_size)
        self.dropout = dropout

    def forward(self, x):
        """
        :param x: [B, F_in, T]
        :return: [B, F_out, T]
        """
        x = self.conv(x)
        x = nn.functional.relu(x)
        # TODO: does not consider masking!
        x = self.bn(x)
        x = nn.functional.dropout(x, p=self.dropout, training=self.training)
        return x
```
I get the following error:

```
File "/u/schuemann/experiments/speech_translation_2023/recipe/i6_experiments/users/rossenbach/experiments/librispeech/tts_architecture_improvement_23/pytorch_networks/ctc_aligner_tts_fe_v7.py", line 148, in Conv1DBlock.forward
    line: x = self.conv(x)
    locals:
      x = <local> !RuntimeError: numel: integer multiplication overflow
      self = <local> Conv1DBlock(
                       (conv): Conv1d(512, 256, kernel_size=(5,), stride=(1,), padding=(2,))
                       (bn): BatchNorm1d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
                     )
      self.conv = <local> Conv1d(512, 256, kernel_size=(5,), stride=(1,), padding=(2,))
  File "/work/asr4/rossenbach/rescale/pytorch_mixed_precision/env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1194, in Module._call_impl
    line: return forward_call(*input, **kwargs)
    locals:
      forward_call = <local> <bound method Conv1d.forward of Conv1d(512, 256, kernel_size=(5,), stride=(1,), padding=(2,))>
      input = <local> !RuntimeError: numel: integer multiplication overflow
      kwargs = <local> {}
  File "/work/asr4/rossenbach/rescale/pytorch_mixed_precision/env/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 313, in Conv1d.forward
    line: return self._conv_forward(input, self.weight, self.bias)
    locals:
      self = <local> Conv1d(512, 256, kernel_size=(5,), stride=(1,), padding=(2,))
      self._conv_forward = <local> <bound method Conv1d._conv_forward of Conv1d(512, 256, kernel_size=(5,), stride=(1,), padding=(2,))>
      input = <local> !RuntimeError: numel: integer multiplication overflow
      self.weight = <local> !RuntimeError: numel: integer multiplication overflow
      self.bias = <local> !RuntimeError: numel: integer multiplication overflow
  File "/work/asr4/rossenbach/rescale/pytorch_mixed_precision/env/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 309, in Conv1d._conv_forward
    line: return F.conv1d(input, weight, bias, self.stride,
                          self.padding, self.dilation, self.groups)
    locals:
      F = <global> <module 'torch.nn.functional' from '/work/asr4/rossenbach/rescale/pytorch_mixed_precision/env/lib/python3.10/site-packages/torch/nn/functional.py'>
      F.conv1d = <global> <built-in method conv1d of type object at 0x7f098f5c8460>
      input = <local> !RuntimeError: numel: integer multiplication overflow
      weight = <local> !RuntimeError: numel: integer multiplication overflow
      bias = <local> !RuntimeError: numel: integer multiplication overflow
      self = <local> Conv1d(512, 256, kernel_size=(5,), stride=(1,), padding=(2,))
      self.stride = <local> (1,)
      self.padding = <local> (2,)
      self.dilation = <local> (1,)
      self.groups = <local> 1
RuntimeError: cuDNN error: CUDNN_STATUS_MAPPING_ERROR
```
Now as the title states, i've tried out several different GPUs with different memory configurations but the error still persists.
As this probably is an error with my pytorch/cuda combination i've also tried out several different environments to get rid of this error.
The current environment used includes torch==1.13.1+cu117 .
But I've also tried: PyTorch version: 2.0.1+cu117 and 2.0.1 with cuda 12.1.

There are also other previous threads mentioning this issue like in 
https://discuss.pytorch.org/t/nvidia-a100-gpu-runtimeerror-cudnn-error-cudnn-status-mapping-error/121648
But the solutions discussed don't seem to work with my congifuration.
If you have any ideas what the issue might be I'd very much appreciate the help.



### Versions

PyTorch version: 1.13.1+cu117
Is debug build: False
CUDA used to build PyTorch: 11.7
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.3 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: Could not collect
CMake version: version 3.22.1
Libc version: glibc-2.35

Python version: 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (64-bit runtime)
Python platform: Linux-5.15.0-46-generic-x86_64-with-glibc2.35
Is XNNPACK available: True

CPU:
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Address sizes:                   39 bits physical, 48 bits virtual
Byte Order:                      Little Endian
CPU(s):                          4
On-line CPU(s) list:             0-3
Vendor ID:                       GenuineIntel
Model name:                      Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
CPU family:                      6
Model:                           158
Thread(s) per core:              1
Core(s) per socket:              4
Socket(s):                       1
Stepping:                        9
CPU max MHz:                     3800.0000
CPU min MHz:                     800.0000
BogoMIPS:                        6799.81
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave a
vx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d arch_capabilities
Virtualization:                  VT-x
L1d cache:                       128 KiB (4 instances)
L1i cache:                       128 KiB (4 instances)
L2 cache:                        1 MiB (4 instances)
L3 cache:                        6 MiB (1 instance)
NUMA node(s):                    1
NUMA node0 CPU(s):               0-3
Vulnerability Itlb multihit:     KVM: Mitigation: VMX disabled
Vulnerability L1tf:              Mitigation; PTE Inversion; VMX conditional cache flushes, SMT disabled
Vulnerability Mds:               Mitigation; Clear CPU buffers; SMT disabled
Vulnerability Meltdown:          Mitigation; PTI
Vulnerability Mmio stale data:   Mitigation; Clear CPU buffers; SMT disabled
Vulnerability Retbleed:          Mitigation; IBRS
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; IBRS, IBPB conditional, RSB filling
Vulnerability Srbds:             Mitigation; Microcode
Vulnerability Tsx async abort:   Mitigation; TSX disabled

Versions of relevant libraries:
[pip3] mypy-extensions==1.0.0
[pip3] numpy==1.25.2
[pip3] torch==1.13.1
[pip3] torchaudio==0.13.1
[pip3] torchdata==0.5.1

cc @csarofeen @ptrblck @xwang233