Ah OK.
The backward pass of repeat_interleave is not deterministic as explained in the linked docs:

Additionally, the backward path for  repeat_interleave()  operates nondeterministically on the CUDA backend because  repeat_interleave()  is implemented using  index_select() , the backward path for which is implemented using  index_add_() , which is known to operate nondeterministically (in the forward direction) on the CUDA backend (see above).