Thank you for your reply. However, it is introduced into torch since 1.8.0 and I use 1.2.0.
And I use torch.nn.functional.interpolate() in the network, so it would definitely throw a RuntimeError if I set torch.use_deterministic_algorithms to true.
But I think it is not the reason, because it reproduces the same result when I use SGD or initialize network from a certain checkpoint.