Which PyTorch version are you using (you can check it via print(torch.__version__)).
torch.utils.checkpoint was introduced some time ago, so I’ wondering if you are working with a really old PyTorch build. If so, could you update to the latest stable release (1.7.0) and retry your code?