-
-
Notifications
You must be signed in to change notification settings - Fork 16.2k
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 #13244
base: master
Are you sure you want to change the base?
Conversation
All Contributors have signed the CLA. ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 Hello @jacobdbrown4, thank you for submitting a YOLOv5 🚀 PR! To allow your work to be integrated as seamlessly as possible, we advise you to:
- ✅ Verify your PR is up-to-date with
ultralytics/yolov5
master
branch. If your PR is behind you can update your code by clicking the 'Update branch' button or by runninggit pull
andgit merge master
locally. - ✅ Verify all YOLOv5 Continuous Integration (CI) checks are passing.
- ✅ Reduce changes to the absolute minimum required for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." — Bruce Lee
I have read the CLA Document and I sign the CLA |
recheck |
@jacobdbrown4 thank you for your comment! To ensure we address your issue effectively, could you please verify that you are using the latest versions of YOLOv5 and all related dependencies? This helps us confirm whether the problem persists with the most recent updates. If the issue is still reproducible, please provide additional details such as error messages, steps to reproduce, and any relevant code snippets. This information will help us diagnose and resolve the issue more efficiently. Looking forward to your response! 😊 |
This pull request needs to be merged, inference times are slower due to this error constantly popping up with the newest versions of pytorch. |
Thank you for your input. Please ensure you're using the latest YOLOv5 version to see if the issue persists. If the problem continues, provide additional details so we can assist further. |
torch.cuda.amp
is deprecated as of Pytorch 2.4. This PR updates use totorch.amp
. This gets rid of thewarning as mentioned in #13226.
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Update to use latest CUDA AMP (Automatic Mixed Precision) API across various files for better compatibility and performance.
📊 Key Changes
torch.cuda.amp.autocast
withtorch.amp.autocast("cuda")
in multiple files.torch.cuda.amp.GradScaler
withtorch.amp.GradScaler("cuda")
.🎯 Purpose & Impact