As given in the error message, an indexing operation is failing.
Rerun the code via CUDA_LAUNCH_BLOCKING=1 python script.py args, check the stacktrace for the operation, which is causing the issue, and make sure the indices are valid.