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 deprecated pytorch methods #1814

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

lipeng31
Copy link

  • torch.cuda.amp.GradScaler(...) => torch.amp.GradScaler("cuda", ...)
  • torch.cuda.amp.autocast(...) => torch.amp.autocast("cuda", ...)

- torch.cuda.amp.GradScaler(...) => torch.amp.GradScaler("cuda", ...)
- torch.cuda.amp.autocast(...) => torch.amp.autocast("cuda", ...)
@csukuangfj
Copy link
Collaborator

could you make it backward compatible?

@lipeng31
Copy link
Author

I read the PyTorch docs and found the first version that provides both torch.cuda.amp.autocast and torch.cuda.amp.GradScaler is 1.6.0, and the first version that provides torch.amp.autocast("cuda", ...) and torch.amp.GradSclaer("cuda", ...) is 1.10.0 which was released 3 years ago, so the compatibility problem happens only for the versions of [1.6.0,1.10.0). I'm not sure if this icefall is supposed to support those versions of PyTorch. Additionally, maintaining compatibility with those versions of PyTorch would require numerous changes throughout the codebase, potentially making the code less clean. Could you reconsider the necessity of this compatibility? Thanks.

@lipeng31
Copy link
Author

Last commit fails some checks. I'll fix it soon.

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