tf.math.bincount incorrect with large values
@cbreak-black,
I tried to execute the mentioned code on tensorflow v2.15 on both colab and the Ubuntu22.04 & observed that the output is as intended. Kindly find the gist of it [here](https://colab.research.google.com/gist/tilakrayal/12e749b2b659a99b69ad6e3ed15a3aa4/untitled.ipynb) and screen shot for the reference.

![Screenshot 2024-02-22 11 02 42 AM](https://github.com/tensorflow/tensorflow/assets/81610181/37278b15-be15-459c-ada9-3e4de80ae3b3)

Thank you!
 Interesting! I can reproduce the problem only when running on my GPU (RTX 3090Ti, CUDA 12.0, Driver 525.60.13, it works fine on CPU. Since it works on the GPU used by colab, it seems like it's something hardware / compute capability specific, or maybe cuda version specific. I'll try to isolate it further.

Here the output of `tf.sysconfig.get_build_info()` from my local system, where it fails:
```
OrderedDict([('cpu_compiler', '/usr/bin/x86_64-linux-gnu-gcc-11'),
             ('cuda_compute_capabilities', ['sm_61', 'sm_75', 'compute_86']),
             ('cuda_version', '12.0'),
             ('cudnn_version', '8'),
             ('is_cuda_build', True),
             ('is_rocm_build', False),
             ('is_tensorrt_build', False)])
```

And from colab, where it seems to work:
```
OrderedDict([('cpu_compiler', '/usr/lib/llvm-17/bin/clang'),
             ('cuda_compute_capabilities',
              ['sm_50', 'sm_60', 'sm_70', 'sm_75', 'compute_80']),
             ('cuda_version', '12.2'),
             ('cudnn_version', '8'),
             ('is_cuda_build', True),
             ('is_rocm_build', False),
             ('is_tensorrt_build', True)])
``` Alright, had the time to update my system to CUDA 12.3, and recompile tensorflow 2.14 (with CUDA 12.2), and the result is correct:
```
>>> tf.sysconfig.get_build_info()
OrderedDict([('cpu_compiler', '/usr/bin/x86_64-linux-gnu-gcc-11'), ('cuda_compute_capabilities', ['sm_61', 'sm_75', 'compute_86']), ('cuda_version', '12.2'), ('cudnn_version', '8'), ('is_cuda_build', True), ('is_rocm_build', False), ('is_tensorrt_build', False)])
>>> tf.reduce_sum(tf.math.bincount(tf.range(50000)))
<tf.Tensor: shape=(), dtype=int32, numpy=50000>
```

It seems the problem is cuda related, and possibly cuda-caused. Don't know if there's any reason to keep this issue open. 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/63013">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/63013">No</a>
 @cbreak-black,
Yes as you mentioned, this issue is not related to tensorflow and more likely related to CUDA version which is not handled by the tensorflow team. Also I request to follow the tensorflow installation with the compatible test build configurations to avoid such type of errors/warnings.
 Thank you!
### Issue type

Bug

### Have you reproduced the bug with TensorFlow Nightly?

No

### Source

source

### TensorFlow version

v2.15.0

### Custom code

No

### OS platform and distribution

Ubuntu 22.04

### Mobile device

_No response_

### Python version

3.10

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

12.0

### GPU model and memory

RTX 3090Ti

### Current behavior?

The `tf.math.bincount` function returns incorrect results with medium size values, even though those don't exceed int32. Using int64 seems to work around the bug, at least at the number ranges that I tested.

This problem seems to have been introduced between 2.13 and 2.14, but still exists with 2.15.

### Standalone code to reproduce the issue

```shell
The expected result of the following function is `100000`.


tf.reduce_sum(tf.math.bincount(tf.range(100000)))
```
```


### Relevant log output

```shell
>>> tf.reduce_sum(tf.math.bincount(tf.range(50000)))
<tf.Tensor: shape=(), dtype=int32, numpy=42950>
>>> tf.reduce_sum(tf.math.bincount(tf.range(45000)))
<tf.Tensor: shape=(), dtype=int32, numpy=45000>
>>> tf.reduce_sum(tf.math.bincount(tf.range(47000)))
<tf.Tensor: shape=(), dtype=int32, numpy=45692>
>>> tf.reduce_sum(tf.math.bincount(tf.range(47000), dtype=tf.int64))
<tf.Tensor: shape=(), dtype=int64, numpy=47000>
```
