Hi,
This error happens when you try to index a Tensor with an index that is bigger than it’s size. Unfortunately, because of the way  CUDA works, it is hard to raise easily the error without loosing speed.
You should set CUDA_LAUNCH_BLOCKING=1 and rerun your program, that way, the python stack trace will point to the correct line.
A common reason for such issues is that your labels are badly formated for a sample (that appears late in the training) and it makes the loss computation (or Embedding layer) try to index too far in your score Tensor (or enbedding matrix). You might want to double check that all the labels (and inputs) in your dataset are correct.