TransformerEngine icon indicating copy to clipboard operation
TransformerEngine copied to clipboard

[PyTorch] Fix autocast deprecation warnings

Open yaox12 opened this issue 1 year ago • 6 comments

Description

Fix autocast deprecation warnings.

Starting from PyTorch 2.4, use

torch.get_autocast_dtype("cuda")
torch.amp.autocast("cuda")

instead of device-specific APIs.

Closes https://github.com/NVIDIA/TransformerEngine/pull/1167.

Type of change

  • [ ] Documentation change (change only to the documentation, either a fix or a new content)
  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] Infra/Build change
  • [ ] Code refractor

Checklist:

  • [ ] I have read and followed the contributing guidelines
  • [ ] The functionality is complete
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] My changes generate no new warnings
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [ ] New and existing unit tests pass locally with my changes

yaox12 avatar Oct 21 '24 02:10 yaox12

/te-ci pytorch

yaox12 avatar Oct 21 '24 03:10 yaox12

/te-ci pytorch

yaox12 avatar Oct 21 '24 04:10 yaox12

/te-ci pytorch

yaox12 avatar Oct 23 '24 04:10 yaox12

/te-ci pytorch

yaox12 avatar Nov 04 '24 09:11 yaox12

@ksivaman Can you review again?

yaox12 avatar Nov 18 '24 08:11 yaox12

Does this look good to you? @ksivaman

yaox12 avatar Dec 13 '24 05:12 yaox12

/te-ci pytorch

yaox12 avatar Apr 28 '25 01:04 yaox12

/te-ci pytorch

yaox12 avatar Apr 29 '25 03:04 yaox12

/te-ci pytorch

yaox12 avatar Apr 30 '25 03:04 yaox12

/te-ci pytorch

ksivaman avatar May 03 '25 03:05 ksivaman