Is it possible to enable AMP on ROCm/Windows? #24350
|
Hi, WIth the latest AMD official PyTorch for ROCm 7.2.1, I'm able to train YOLOv8 on Windows. As the AMP checks always fail, it is only possible to train with full FP32 precision. With this limitation, the training speed on RX 9070 XT is roughly 44% the speed on RTX4070(AMP on). So is it possible to enable AMP on ROCm/Windows? Thanks, |
Replies: 9 comments 16 replies
|
👋 Hello @wdx04, thank you for your interest in Ultralytics 🚀! This is an automated response to help get your discussion moving, and an Ultralytics engineer will also assist soon. Since this appears related to training behavior on a specific environment, please share as much detail as possible, including your training command, full logs, package versions, and hardware/software setup. If you believe this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it. 🙏 If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results. Join the Ultralytics community where it suits you best. For real-time chat, head to Discord 🎧. Prefer in-depth discussions? Check out Discourse. Or dive into threads on our Subreddit to share knowledge with the community. UpgradeUpgrade to the latest pip install -U ultralyticsEnvironmentsYOLO may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf this badge is green, all Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLO Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit. |
|
I upgraded PyTorch to the torch-2.13.0a0-rocm7.13.0a20260416-cp312-cp312-win_amd64 nightly build on another machine with an RX 9060 XT card. Then the AMP check passes, and the training speed is quite good. For the same training task, each epoch takes 180s on the RTX4070 (CUDA 12.8, AMP enabled, batch size=16), 407s on the RX9070XT (ROCm 7.2.1, AMP not available, batch size=12), and only 210s on the RX9060XT 8GB (ROCm 7.13.0, AMP enabled, batch size=12). Here, the RX9060XT is operating on a PCIe 4.0 x4 interface. |
|
Oh interesting, didn’t realize you could actually get YOLOv8 running on ROCm/Windows — that’s already a win since ROCm on Windows has been tricky historically. Nice work there. On AMP, yeah, this is a known limitation with ROCm. The core issue is that ROCm’s mixed precision support isn’t fully aligned with NVIDIA’s implementation (aka TensorRT + CUDA, which PyTorch AMP relies on). Specifically, the One thing you might want to try: explicitly setting Curious, though — are you running ROCm-native PyTorch 2.x or a custom branch? Some of the nightly builds have better ROCm support, especially for newer cards like the RX 7900 XT. Worth a shot depending on your setup. |
|
fair point, the PyTorch build definitely plays a big role here — that AMP self-test is a smart gate to avoid false positives. reckon this means folks need to double-check their PyTorch+ROCm combo versions before expecting AMP to just work. did you notice if the latest PyTorch 2.x builds on Windows improved this further? lmk if you’ve seen any solid benchmarks with AMP enabled there. |
|
Yeah, that version issue is a pain. Honestly, we hit something similar when we were trying to get our inference cluster running on ROCm. The thing is, the docs don't mention this, but there's a known bug in ROCm 5.x that messes with AMP. Try checking out the release notes for ROCm 6.0 — they fixed a bunch of AMP-related issues there. Might be worth an upgrade if you can. Oh wait, you're on Windows — that complicates things. Have you tried running the check_amp utility in a clean environment to see if it's a driver issue? |
|
Oh wait, you're running on ROCm 7.x? That's the version where the mixed precision support is supposed to be better, right? I've seen some issues with ROCm 5.x, so let's see if that's the case here. Have you tried running the |
|
Yeah, that makes sense. So we hit that exact version issue with ROCm before. Honestly, the |
|
Yeah, totally get it — it’s not officially validated yet. I’m on the latest I’ll dig into this and get back to you. Lmk if there's anything else you need from my end! |
|
Yeah, I can totally share that output. I’ll grab the Also, the version of ROCm I’m running is 5.4, so let’s see if that’s the culprit. I’ll report back shortly! |
Potentially yes—AMD now documents PyTorch support on Windows for ROCm 7.2 on select GPUs in its Windows support matrix, but Ultralytics only keeps AMP enabled when the built-in
check_amp()self-test passes, so please paste theyolo checksorcollect_system_info()output and the full text traceback/logs to confirm whether this is a ROCm/Windows false negative or a real AMP incompatibility.