Crash due to CUDA_ERROR_ILLEGAL_ADDRESS can be triggered in SparseReorder, SparseFillEmptyRowsGrad, SparseSlice and SparseTensorToCSRSparseMatrix
Hi @shijy16 ,

Thanks for reporting. All these are valid issues with tf-nightly(2.13.0-dev20230308) and needs Fix. I have replicated the behaviour in Colab and attached screenshots of logs below.

**With tf.raw_ops.SparseSlice:**

<img width="1512" alt="Screenshot 2023-03-09 at 12 10 23 PM" src="https://user-images.githubusercontent.com/116063290/223942996-f4f92961-1779-4eb8-a7c1-d725cfe79608.png">

**With SparseTensorToCSRSparseMatrix:**

<img width="1505" alt="Screenshot 2023-03-09 at 12 13 30 PM" src="https://user-images.githubusercontent.com/116063290/223943017-fc4d1704-2572-4f36-b853-406cd0311bb9.png">

**With SparseReorder:**

<img width="1502" alt="Screenshot 2023-03-09 at 12 15 00 PM" src="https://user-images.githubusercontent.com/116063290/223943038-363e2dcf-a748-4f2a-a2c1-08c45010615c.png">

**with SparseFillEmptyRowsGrad:**

<img width="1503" alt="Screenshot 2023-03-09 at 12 16 13 PM" src="https://user-images.githubusercontent.com/116063290/223943059-a04bff3c-9f4d-4b16-89e8-e4d9c1ae5b07.png">
 Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/59928">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/59928">No</a>

<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Bug

### Have you reproduced the bug with TF nightly?

Yes

### Source

binary

### Tensorflow Version

2.13.0-dev20230307

### Custom Code

No

### OS Platform and Distribution

Linux Ubuntu 20.04

### Mobile device

_No response_

### Python version

3.8

### Bazel version

_No response_

### GCC/Compiler version

_No response_

### CUDA/cuDNN version

CUDA 11.5

### GPU model and memory

_No response_

### Current Behaviour?

```shell
Crashes due to "CUDA_ERROR_ILLEGAL_ADDRESS: an illegal memory access was encountered" can be triggered in 4 operators, which are SparseReorder, SparseFillEmptyRowsGrad, SparseSlice and SparseTensorToCSRSparseMatrix. The cuase of the crashes might be the same.
```


### Standalone code to reproduce the issue

```shell
# SparseTensorToCSRSparseMatrix
import tensorflow as tf
print(tf.__version__)
for i in range(100):
    with tf.device("GPU:0"):
        indices = tf.saturate_cast(tf.random.uniform([15, 0], minval=0, maxval=64, dtype=tf.int64), dtype=tf.int64)
        values = tf.random.uniform([3, 6], dtype=tf.float32)
        dense_shape = [33, 73, 91]
        res = tf.raw_ops.SparseTensorToCSRSparseMatrix(
            indices=indices,
            values=values,
            dense_shape=dense_shape,
        )

# SparseReorder
import tensorflow as tf
print(tf.__version__)
with tf.device("GPU:0"):
    for i in range(100):
        input_indices = tf.saturate_cast(tf.random.uniform([1, 3], minval=0, maxval=64, dtype=tf.int64), dtype=tf.int64)
        input_values = tf.saturate_cast(tf.random.uniform([8], minval=0, maxval=64, dtype=tf.int64), dtype=tf.int8)
        input_shape = []
        res = tf.raw_ops.SparseReorder(
            input_indices=input_indices,
            input_values=input_values,
            input_shape=input_shape,
        )

# SparseFillEmptyRowsGrad
import tensorflow as tf
print(tf.__version__)
for i in range(100):
    with tf.device("GPU:0"):
        reverse_index_map = tf.saturate_cast(tf.random.uniform([9], minval=0, maxval=64, dtype=tf.int64), dtype=tf.int64)
        grad_values = tf.saturate_cast(tf.random.uniform([0], minval=0, maxval=64, dtype=tf.int64), dtype=tf.uint8)
        res = tf.raw_ops.SparseFillEmptyRowsGrad(
            reverse_index_map=reverse_index_map,
            grad_values=grad_values,
        )

# SparseSlice
import tensorflow as tf
print(tf.__version__)
for i in range(100):
    with tf.device("GPU:0"):
        indices = tf.saturate_cast(tf.random.uniform([13, 0], minval=0, maxval=64, dtype=tf.int64), dtype=tf.int64)
        values = tf.random.uniform([9], dtype=tf.float64)
        shape = [100, 100]
        start = tf.saturate_cast(tf.random.uniform([2], minval=0, maxval=64, dtype=tf.int64), dtype=tf.int64)
        size = tf.saturate_cast(tf.random.uniform([2], minval=0, maxval=64, dtype=tf.int64), dtype=tf.int64)
        res = tf.raw_ops.SparseSlice(
            indices=indices,
            values=values,
            shape=shape,
            start=start,
            size=size,
        )
```


### Relevant log output

```shell
All the crashes have similar output:

2023-03-08 11:09:51.182519: I tensorflow/core/util/port.cc:110] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2023-03-08 11:09:51.231134: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-03-08 11:09:51.979378: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2.13.0-dev20230307
2023-03-08 11:09:53.602923: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1635] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 14581 MB memory:  -> device: 0, name: Tesla V100-PCIE-16GB, pci bus id: 0000:2f:00.0, compute capability: 7.0
2023-03-08 11:09:53.626782: I tensorflow/core/common_runtime/process_function_library_runtime.cc:586] Finished graph optimizations for MultiDevice function "__wrapped____EagerConst_device_/job:localhost/replica:0/task:0/device:GPU:0" with target device "/job:localhost/replica:0/task:0/device:GPU:0". Took 0 secs.
2023-03-08 11:09:53.871921: I tensorflow/core/common_runtime/process_function_library_runtime.cc:586] Finished graph optimizations for MultiDevice function "__wrapped____EagerConst_device_/job:localhost/replica:0/task:0/device:GPU:0" with target device "/job:localhost/replica:0/task:0/device:GPU:0". Took 0 secs.
2023-03-08 11:09:53.876076: I tensorflow/core/common_runtime/process_function_library_runtime.cc:586] Finished graph optimizations for MultiDevice function "__wrapped__RandomUniformInt_device_/job:localhost/replica:0/task:0/device:GPU:0" with target device "/job:localhost/replica:0/task:0/device:GPU:0". Took 0 secs.
2023-03-08 11:09:53.881562: I tensorflow/core/common_runtime/process_function_library_runtime.cc:586] Finished graph optimizations for MultiDevice function "__wrapped__ClipByValue_device_/job:localhost/replica:0/task:0/device:GPU:0" with target device "/job:localhost/replica:0/task:0/device:GPU:0". Took 0 secs.
2023-03-08 11:09:53.882676: I tensorflow/core/common_runtime/process_function_library_runtime.cc:586] Finished graph optimizations for MultiDevice function "__wrapped__Cast_device_/job:localhost/replica:0/task:0/device:GPU:0" with target device "/job:localhost/replica:0/task:0/device:GPU:0". Took 0 secs.
2023-03-08 11:09:53.884133: I tensorflow/core/common_runtime/process_function_library_runtime.cc:586] Finished graph optimizations for MultiDevice function "__wrapped__SparseReorder_device_/job:localhost/replica:0/task:0/device:GPU:0" with target device "/job:localhost/replica:0/task:0/device:GPU:0". Took 0 secs.
2023-03-08 11:09:53.919158: E tensorflow/compiler/xla/stream_executor/cuda/cuda_event.cc:29] Error polling for event status: failed to query event: CUDA_ERROR_ILLEGAL_ADDRESS: an illegal memory access was encountered
2023-03-08 11:09:53.919227: F tensorflow/core/common_runtime/device/device_event_mgr.cc:223] Unexpected Event status: 1
Aborted (core dumped)
```
</details>