Skip to content

Fix deprecated statement#3307

Merged
vfdev-5 merged 12 commits intopytorch:masterfrom
Gulin7:fix-deprecated-statement
Dec 9, 2024
Merged

Fix deprecated statement#3307
vfdev-5 merged 12 commits intopytorch:masterfrom
Gulin7:fix-deprecated-statement

Conversation

@Gulin7
Copy link
Copy Markdown
Contributor

@Gulin7 Gulin7 commented Nov 27, 2024

Fixes #3304

Description:
Replaced all occurances of torch.cuda.amp.autocast with torch.amp.autocast('cuda',...)

Gulin7 and others added 2 commits November 27, 2024 09:05
Replaced torch.cuda.amp.autocast with torch.amp.autocast("cuda",...).
@github-actions github-actions bot added module: engine Engine module examples Examples labels Nov 27, 2024
Copy link
Copy Markdown
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @Gulin7
I left few comments to address

@github-actions github-actions bot added the module: metrics Metrics module label Nov 28, 2024
@Gulin7
Copy link
Copy Markdown
Contributor Author

Gulin7 commented Nov 28, 2024

@vfdev-5 I addressed your comments, tag me and let me know if there is anything else that needs improvement.

@vfdev-5
Copy link
Copy Markdown
Collaborator

vfdev-5 commented Nov 28, 2024

@@ -1,31 +1,4 @@
{
"nbformat": 4,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please make just necessary changes without all unrelated updates?

@vfdev-5
Copy link
Copy Markdown
Collaborator

vfdev-5 commented Dec 2, 2024

@Gulin7 there is a failing test with error message:


=========================== short test summary info ============================
FAILED tests/ignite/engine/test_create_supervised.py::test_create_supervised_trainer_amp_error - AssertionError: Regex pattern did not match.
 Regex: 'Please install torch>=1.12.0 to use scaler argument.'
 Input: "Please install torch>=1.12.0 to use amp_mode='amp'."
======================== 1 failed, 3 warnings in 2.71s =========================

and also there is this comment to address: #3307 (comment)

Can you please fix them? Thanks!

Copy link
Copy Markdown
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vfdev-5 vfdev-5 merged commit a3d691c into pytorch:master Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples Examples module: engine Engine module module: metrics Metrics module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants