Seems quite weird, to see where it is coming from, can you try to run it again but with the TORCH_SHOW_CPP_STACKTRACES=1 environment variable enabled?
Enabling anomaly mode Automatic differentiation package - torch.autograd — PyTorch 1.10.0 documentation 1 may also help.