Often device assertions are trigged by e.g. invalid indices. You could run the script via CUDA_LAUNCH_BLOCKING=1 python script.pt args and check the stacktrace for the failing operation.
Once you know which line of code is raising this error, you can add print statements to debug the issue further.