Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace torch.cuda.amp.autocast with torch.amp.autocast('cuda',...) #3304

Closed
vfdev-5 opened this issue Nov 22, 2024 · 6 comments · Fixed by #3307
Closed

Replace torch.cuda.amp.autocast with torch.amp.autocast('cuda',...) #3304

vfdev-5 opened this issue Nov 22, 2024 · 6 comments · Fixed by #3307

Comments

@vfdev-5
Copy link
Collaborator

vfdev-5 commented Nov 22, 2024

Fix the warning:

 FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.

by replacing everywhere in the codebase:

- torch.cuda.amp.autocast(...
+ torch.amp.autocast("cuda", ...
Copy link

Hey 👋, I've just created a thread for this issue on PyTorch-Ignite Discord where you can quickly talk to the community on the topic.

🤖 This comment was automatically posted by Discuss on Discord

@Gulin7
Copy link
Contributor

Gulin7 commented Nov 24, 2024

Hi, @vfdev-5 , could you please assign me to this issue?

@vfdev-5
Copy link
Collaborator Author

vfdev-5 commented Nov 24, 2024

@Gulin7 you can start working on it

@Gulin7
Copy link
Contributor

Gulin7 commented Nov 24, 2024

@vfdev-5 I searched for the use of torch.cuda.amp.autocast(... and found nothing, except a reference in some mock tests.

@vfdev-5
Copy link
Collaborator Author

vfdev-5 commented Nov 25, 2024

You should search for autocast, for example:
https://github.com/pytorch/ignite/blob/master/ignite/engine/__init__.py#L188

@Gulin7
Copy link
Contributor

Gulin7 commented Nov 28, 2024

@vfdev-5 I made a PR, I'm waiting for feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants