Repository: pytorch
Issue: conv2d wrong results on 3090/3090ti
Labels: triaged,module: half

### 🐛 Describe the bug

I have 8 input tensor with dtype=float32, the expected behavior of the following code is to **return a zero tensor**.
I ran it on my **3090/3090ti** ,the result is not all zeros and has a **much larger error** compared to what float32 should have.
While the result is all zeros if the dtype is float16 or float64.

```python
import torch
import torch.nn as nn
torch.manual_seed(42)
torch.set_default_dtype(torch.float32)

batchsize = 8

input_batch = torch.randn(batchsize, 64, 16, 16).cuda()
input_first = input_batch[0].unsqueeze(0).clone()

net = nn.Conv2d(64, 128, kernel_size=1, stride=1, bias=False).cuda()

print(net(input_batch)[0]-net(input_first))
```
```
tensor([[[[ 9.2685e-05, -2.4992e-04,  1.5020e-04,  ...,  7.5430e-05,
            1.0422e-04,  1.9684e-04],
          [ 3.3550e-05, -1.5840e-05, -7.9334e-05,  ...,  1.6463e-04,
            5.4136e-05,  1.6505e-04],
          [ 9.8839e-05, -5.8293e-05,  1.3053e-04,  ...,  3.4472e-04,
            6.6888e-05, -3.2061e-04],
          ...,
          [ 3.1710e-05, -1.6572e-04,  2.0644e-04,  ..., -1.4180e-04,
            2.7990e-04, -3.2854e-04],
          [ 3.2908e-04, -2.3088e-04, -3.5465e-04,  ...,  3.6773e-04,
            2.8825e-04,  1.2505e-04],
          [ 2.3980e-04,  6.1691e-05, -9.7908e-05,  ..., -1.2532e-04,
           -1.7248e-05,  3.3058e-05]],

         [[ 1.6022e-04,  6.1244e-06, -7.1526e-07,  ...,  5.4538e-05,
            6.8903e-05, -2.4739e-04],
          [-1.6376e-04,  1.0026e-04,  1.0914e-04,  ..., -5.3421e-05,
           -3.3021e-05,  2.1392e-04],
          [ 5.6386e-05, -1.2365e-04, -1.1462e-04,  ...,  1.7971e-05,
           -4.3385e-05,  1.6844e-04],
          ...,
          [ 1.2579e-04,  2.0719e-04, -2.4647e-05,  ...,  2.7519e-04,
            5.1627e-05,  6.7085e-05],
          [-2.2280e-04,  2.9814e-04,  1.6269e-04,  ...,  1.6677e-04,
            9.7752e-05, -7.2986e-05],
          [ 2.0266e-05,  3.0109e-04, -7.1228e-05,  ...,  5.1796e-05,
           -3.5924e-04, -1.2362e-04]],

         [[ 1.0639e-05, -1.1134e-04,  6.1929e-05,  ..., -2.4796e-05,
            1.9896e-04,  2.7418e-05],
          [-4.6492e-05,  2.0468e-04, -2.7716e-06,  ..., -6.8188e-05,
            3.4183e-04, -2.2969e-04],
          [-2.4623e-04,  3.9500e-04,  5.5999e-05,  ..., -2.4128e-04,
           -1.5005e-04, -5.8562e-05],
          ...,
          [ 1.2705e-04, -1.2219e-05,  4.1641e-05,  ...,  1.1839e-04,
            4.4793e-05, -7.9527e-05],
          [-7.8976e-05, -5.3179e-05,  1.6132e-04,  ...,  9.6560e-05,
           -2.2628e-04,  5.8055e-05],
          [-4.8876e-06,  2.3258e-04, -9.0599e-05,  ..., -1.4369e-04,
            2.3127e-05, -5.8293e-05]],

         ...,

         [[-2.3872e-05, -1.9767e-04,  7.8864e-06,  ...,  8.9884e-05,
            2.4074e-04, -4.3465e-05],
          [ 7.1287e-05,  3.0786e-04,  3.3963e-04,  ...,  3.5405e-05,
           -1.9133e-05,  1.8358e-04],
          [ 3.3754e-04,  1.0240e-04, -5.2512e-05,  ...,  1.5199e-04,
            1.2663e-04,  6.6608e-05],
          ...,
          [ 1.9336e-04,  1.5610e-04,  5.0187e-05,  ...,  2.4384e-04,
            7.4700e-05, -2.0316e-04],
          [-1.9525e-04, -1.0386e-04,  3.1728e-04,  ..., -1.1736e-04,
            1.5479e-04,  1.4033e-05],
          [ 9.1821e-05, -4.0402e-04, -1.6704e-04,  ..., -1.1945e-04,
            1.1135e-04, -5.9102e-05]],

         [[ 6.1393e-05, -6.8009e-05,  3.2294e-04,  ...,  9.9301e-05,
           -4.1574e-06,  1.9190e-04],
          [ 2.2650e-04, -1.1492e-04,  6.4313e-05,  ..., -5.7057e-05,
           -2.2188e-04, -2.1189e-05],
          [ 1.6111e-04,  2.1440e-04, -4.3064e-05,  ..., -3.9339e-06,
            1.8221e-04, -2.2078e-04],
          ...,
          [-1.1819e-04, -1.0467e-04, -3.6376e-04,  ...,  1.1517e-04,
           -6.0856e-05,  2.7171e-04],
          [ 9.1031e-05,  9.3460e-05, -1.2469e-04,  ..., -3.3736e-05,
            2.2650e-05, -9.9003e-05],
          [-9.9540e-05, -2.8908e-04,  3.2604e-04,  ..., -1.1039e-04,
            3.5608e-04,  8.9467e-05]],

         [[-2.3961e-04, -8.1927e-05, -8.7082e-05,  ..., -3.2249e-04,
            3.6597e-05,  1.1235e-04],
          [-2.0185e-04,  8.7149e-05,  3.7772e-04,  ...,  1.5683e-04,
            1.9097e-04, -9.5069e-05],
          [ 2.3845e-04, -2.6214e-04,  4.2915e-06,  ..., -4.4803e-04,
           -2.3680e-04,  1.9309e-04],
          ...,
          [-5.8055e-05, -1.4442e-04, -1.0109e-04,  ...,  5.1185e-05,
            9.0137e-05,  1.6093e-05],
          [ 1.0067e-04, -8.1927e-05, -9.0122e-05,  ..., -2.1887e-04,
           -1.5021e-04, -3.5465e-06],
          [-2.7707e-04,  3.8862e-04,  2.0415e-05,  ...,  3.0470e-04,
           -3.3958e-04, -1.5503e-04]]]], device='cuda:0',
       grad_fn=<SubBackward0>)
```


### Versions

```
Collecting environment information...
PyTorch version: 2.0.1+cu118
Is debug build: False
CUDA used to build PyTorch: 11.8
ROCM used to build PyTorch: N/A

OS: Rocky Linux 9.2 (Blue Onyx) (x86_64)
GCC version: (GCC) 11.3.1 20221121 (Red Hat 11.3.1-4)
Clang version: Could not collect
CMake version: version 3.25.0
Libc version: glibc-2.34

Python version: 3.9.16 (main, Dec  8 2022, 00:00:00)  [GCC 11.3.1 20221121 (Red Hat 11.3.1-4)] (64-bit runtime)
Python platform: Linux-5.14.0-284.11.1.el9_2.x86_64-x86_64-with-glibc2.34
Is CUDA available: True
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration:
GPU 0: NVIDIA GeForce RTX 3090
GPU 1: NVIDIA GeForce RTX 3090
GPU 2: NVIDIA GeForce RTX 3090
GPU 3: NVIDIA GeForce RTX 3090
GPU 4: NVIDIA GeForce RTX 3090
GPU 5: NVIDIA GeForce RTX 3090
GPU 6: NVIDIA GeForce RTX 3090
GPU 7: NVIDIA GeForce RTX 3090

Nvidia driver version: 535.86.05
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Address sizes:                   52 bits physical, 57 bits virtual
Byte Order:                      Little Endian
CPU(s):                          80
On-line CPU(s) list:             0-79
Vendor ID:                       GenuineIntel
Model name:                      Intel(R) Xeon(R) Silver 4316 CPU @ 2.30GHz
CPU family:                      6
Model:                           106
Thread(s) per core:              2
Core(s) per socket:              20
Socket(s):                       2
Stepping:                        6
CPU max MHz:                     3400.0000
CPU min MHz:                     800.0000
BogoMIPS:                        4600.00
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 dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 invpcid_single intel_ppin ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect wbnoinvd dtherm ida arat pln pts avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid fsrm md_clear pconfig flush_l1d arch_capabilities
Virtualization:                  VT-x
L1d cache:                       1.9 MiB (40 instances)
L1i cache:                       1.3 MiB (40 instances)
L2 cache:                        50 MiB (40 instances)
L3 cache:                        60 MiB (2 instances)
NUMA node(s):                    2
NUMA node0 CPU(s):               0-19,40-59
NUMA node1 CPU(s):               20-39,60-79
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Mmio stale data:   Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Retbleed:          Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected

Versions of relevant libraries:
[pip3] numpy==1.24.1
[pip3] torch==2.0.1+cu118
[pip3] torchaudio==2.0.2+cu118
[pip3] torchvision==0.15.2+cu118
[pip3] triton==2.0.0
[conda] numpy                     1.24.2                   pypi_0    pypi
[conda] torch                     1.11.0+cu113             pypi_0    pypi
[conda] torchvision               0.12.0+cu113             pypi_0    pypi
```