`torch.nn.CTCLoss` Trigger out-of-bound Read under Compute Sanitizer
Labels: module: nn, module: loss, module: cuda, triaged, module: sanitizers

### 🐛 Describe the bug

A test case for `torch.nn.CTCLoss` triggers out-of-bound read error under compute sanitizer. Without sanitizers, the test terminates normally.
A similar issue is #88047, but the test shown in that issue won't trigger an error when it's run in GPU, so I open a new issue here.
Test:
```python
import torch

def test():
    ctc_loss = torch.nn.CTCLoss()
    arg_1_0 = torch.rand([50, 16, 20], dtype=torch.float32).clone().cuda()
    arg_1_1 = torch.randint(-8,0,[16, 30], dtype=torch.int64).clone().cuda()
    arg_1_2 = torch.randint(-128,0,[16], dtype=torch.int64).clone().cuda()
    arg_1_3 = torch.randint(-16384,0,[16], dtype=torch.int64).clone().cuda()
    arg_1 = [arg_1_0,arg_1_1,arg_1_2,arg_1_3,]
    res = ctc_loss(*arg_1)

test()
```
Error log:
```
========= COMPUTE-SANITIZER
========= Invalid __global__ read of size 4 bytes
=========     at 0x2400 in _ZN2at6native43_GLOBAL__N__ab835dce_10_LossCTC_cu_88d8892b29ctc_loss_log_alpha_gpu_kernelIflEEvPT_PKS3_PKllPKT0_S8_lS4_llllllS8_lll
=========     by thread (0,2,0) in block (0,0,0)
=========     Address 0x7fb73cdf9960 is out of bounds
=========     and is 26,272 bytes before the nearest allocation at 0x7fb73ce00000 of size 2,097,152 bytes
========= 
========= Invalid __global__ read of size 4 bytes
=========     at 0x2400 in _ZN2at6native43_GLOBAL__N__ab835dce_10_LossCTC_cu_88d8892b29ctc_loss_log_alpha_gpu_kernelIflEEvPT_PKS3_PKllPKT0_S8_lS4_llllllS8_lll
=========     by thread (0,3,0) in block (0,0,0)
=========     Address 0x7fb73cdfa1c4 is out of bounds
=========     and is 24,124 bytes before the nearest allocation at 0x7fb73ce00000 of size 2,097,152 bytes
========= 
========= Invalid __global__ read of size 4 bytes
=========     at 0x2400 in _ZN2at6native43_GLOBAL__N__ab835dce_10_LossCTC_cu_88d8892b29ctc_loss_log_alpha_gpu_kernelIflEEvPT_PKS3_PKllPKT0_S8_lS4_llllllS8_lll
=========     by thread (0,5,0) in block (0,0,0)
=========     Address 0x7fb73cdf5f30 is out of bounds
=========     and is 41,168 bytes before the nearest allocation at 0x7fb73ce00000 of size 2,097,152 bytes
========= 
========= Invalid __global__ read of size 4 bytes
=========     at 0x2400 in _ZN2at6native43_GLOBAL__N__ab835dce_10_LossCTC_cu_88d8892b29ctc_loss_log_alpha_gpu_kernelIflEEvPT_PKS3_PKllPKT0_S8_lS4_llllllS8_lll
=========     by thread (0,6,0) in block (0,0,0)
=========     Address 0x7fb73cdfbd64 is out of bounds
=========     and is 17,052 bytes before the nearest allocation at 0x7fb73ce00000 of size 2,097,152 bytes
========= 
========= Invalid __global__ read of size 4 bytes
=========     at 0x2400 in _ZN2at6native43_GLOBAL__N__ab835dce_10_LossCTC_cu_88d8892b29ctc_loss_log_alpha_gpu_kernelIflEEvPT_PKS3_PKllPKT0_S8_lS4_llllllS8_lll
=========     by thread (0,8,0) in block (0,0,0)
=========     Address 0x7fb73cdfb120 is out of bounds
=========     and is 20,192 bytes before the nearest allocation at 0x7fb73ce00000 of size 2,097,152 bytes
========= 
========= Invalid __global__ read of size 4 bytes
=========     at 0x2400 in _ZN2at6native43_GLOBAL__N__ab835dce_10_LossCTC_cu_88d8892b29ctc_loss_log_alpha_gpu_kernelIflEEvPT_PKS3_PKllPKT0_S8_lS4_llllllS8_lll
=========     by thread (0,14,0) in block (0,0,0)
=========     Address 0x7fb73cdf6fb8 is out of bounds
=========     and is 36,936 bytes before the nearest allocation at 0x7fb73ce00000 of size 2,097,152 bytes
========= 
========= Program hit cudaErrorLaunchFailure (error 719) due to "unspecified launch failure" on CUDA API call to cudaStreamSynchronize.
========= 
========= Program hit cudaErrorLaunchFailure (error 719) due to "unspecified launch failure" on CUDA API call to cudaGetLastError.
========= 
Traceback (most recent call last):
  File "/home/yuyao/trial/test.py", line 12, in <module>
    test()
  File "/home/yuyao/trial/test.py", line 10, in test
    res = ctc_loss(*arg_1)
  File "/home/yuyao/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1427, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/yuyao/.local/lib/python3.10/site-packages/torch/nn/modules/loss.py", line 1756, in forward
    return F.ctc_loss(log_probs, targets, input_lengths, target_lengths, self.blank, self.reduction,
  File "/home/yuyao/.local/lib/python3.10/site-packages/torch/nn/functional.py", line 2630, in ctc_loss
    return torch.ctc_loss(
RuntimeError: CUDA error: unspecified launch failure
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
========= Target application returned an error
========= ERROR SUMMARY: 8 errors
```

### Versions

```
PyTorch version: 1.14.0a0+gitbdc9911
Is debug build: False
CUDA used to build PyTorch: 11.6
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.1 LTS (x86_64)
GCC version: (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
Clang version: 11.1.0-6
CMake version: version 3.22.1
Libc version: glibc-2.35

Python version: 3.10.6 (main, Nov  2 2022, 18:53:38) [GCC 11.3.0] (64-bit runtime)
Python platform: Linux-5.15.0-52-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 11.6.124
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

Nvidia driver version: 515.65.01
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.4.1
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.4.1
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.4.1
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.4.1
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.4.1
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.4.1
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.4.1
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.21.5
[pip3] torch==1.14.0a0+gitbdc9911
[pip3] torchvision==0.13.1
[conda] blas                      1.0                         mkl  
[conda] cudatoolkit               11.3.1               h2bc3f7f_2  
[conda] mkl                       2021.4.0           h06a4308_640  
[conda] mkl-service               2.4.0            py39h7f8727e_0  
[conda] mkl_fft                   1.3.1            py39hd3c417c_0  
[conda] mkl_random                1.2.2            py39h51133e4_0  
[conda] numpy                     1.21.5           py39he7a7128_1  
[conda] numpy-base                1.21.5           py39hf524024_1  
[conda] numpydoc                  1.2                pyhd3eb1b0_0  
[conda] torch                     1.14.0a0+gitce2f870          pypi_0    pypi
```

cc @albanD @mruberry @jbschlosser @walterddr @kshitij12345 @saketh-are @ngimel