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

Update torch.cuda.amp to torch.amp in pytorch.py #945

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

Atlogit
Copy link
Contributor

@Atlogit Atlogit commented Sep 25, 2024

update pytorch.py to get rid of torch.cuda.amp deprecated warning.

Description

torch.cuda.amp is deprecated (Pytorch 2.4). This PR updates shims pytorch.py to use torch.amp.autocast instead of torch.cuda.amp.autocast.

Types of change

replaced _torch.cuda.amp.autocast(self.mixed_precision) with _torch.amp.autocast("cuda", self.mixed_precision)

Checklist

  • I confirm that I have the right to submit this contribution under the project's MIT license.
  • I ran the tests, and all new and existing tests passed.
  • My changes don't require a change to the documentation, or if they do, I've added all required information.

update pytorch.py to get rid of torch.cuda.amp deprecated warning.
@honnibal
Copy link
Member

Thanks!

@honnibal honnibal merged commit e08ce14 into explosion:main Sep 30, 2024
honnibal pushed a commit that referenced this pull request Sep 30, 2024
update pytorch.py to get rid of torch.cuda.amp deprecated warning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants