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

Fix deprecated statement #3307

Merged
merged 12 commits into from
Dec 9, 2024
Merged

Conversation

Gulin7
Copy link
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
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

examples/references/segmentation/pascal_voc2012/main.py Outdated Show resolved Hide resolved
examples/transformers/main.py Outdated Show resolved Hide resolved
ignite/engine/__init__.py Outdated Show resolved Hide resolved
ignite/engine/__init__.py Outdated Show resolved Hide resolved
tests/ignite/engine/test_create_supervised.py Outdated Show resolved Hide resolved
tests/ignite/engine/test_create_supervised.py Outdated Show resolved Hide resolved
tests/ignite/engine/test_create_supervised.py Outdated Show resolved Hide resolved
@github-actions github-actions bot added the module: metrics Metrics module label Nov 28, 2024
@Gulin7
Copy link
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
Collaborator

vfdev-5 commented Nov 28, 2024

@@ -1,31 +1,4 @@
{
"nbformat": 4,
Copy link
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?

ignite/engine/__init__.py Outdated Show resolved Hide resolved
@vfdev-5
Copy link
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!

ignite/engine/__init__.py Outdated Show resolved Hide resolved
Copy link
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
15 of 17 checks passed
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