Replace torch.cuda.amp.autocast with torch.amp.autocast('cuda')#1756
Replace torch.cuda.amp.autocast with torch.amp.autocast('cuda')#1756QuantuMope wants to merge 1 commit intopytorchfrom
Conversation
|
I feel a tricky thing is that some of our cluster docker images were built with older pytorch versions where torch has no amp attribute. |
I think the oldest torch version is 2.1 on our cluster dockers, which I've confirmed works with this change. Are there dockers that have older versions than this? |
I think "horizonrobotics/cuda:11.3-cudnn8-py3.8-ubuntu20.04_kincpp" is using torch 1.11+cu11.3, this is the docker I am currently running for env v1, but I think I will switch to v2 soon. I also noticed some @Haichao-Zhang 's running jobs using this docker image, but not sure if he is still actively using it. |
Got it. We can just hold off on this PR for now and merge it when we need it. |
As of torch 2.6,
torch.cuda.amp.autocastis now deprecated. This PR replaces all calls withtorch.amp.autocast('cuda'). Confirmed that this is backward compatible withtorch >= 2.1which is used by CICD.