Then someone ran it
flodl 0.9.0 trains on AMD. I still do not own an AMD card. Three of them ran it anyway, because I asked and two people answered.
The last post had a sentence in it that I did not enjoy writing: no AMD card had ever run a training step. flodl built against ROCm, linked against it, found the cards. Whether it trained on one was a question I could not answer, because there was no AMD GPU in this project’s workshop.
There still isn’t. flodl 0.9.0 trains on AMD anyway.
Asking
On November 20 I opened an issue and posted it to two subreddits. It said what was true: this has never run on your hardware, I cannot test it, expect something to break, paste what you see and I will investigate. An hour of someone’s card, with no promise that the hour would end well.
The first report arrived the next day.
What came back
Three cards have now trained ResNet-20 to completion: a Strix Halo integrated GPU, a Radeon AI PRO R9700 and a Radeon RX 7900 XTX. Test accuracy landed between 91.59% and 91.96%, against 91.46% on the NVIDIA card I use as the reference. Two R9700 in one box ran 1.91x faster than one. A 150M-parameter language model completes on two of the three cards.
On the third it fails in its first forward pass, and I do not know why yet. That one is open.
Getting there meant finding out what was wrong, and plenty was. The ROCm runtime in flodl’s own container image crashed on one chip and ran five times slower than it should on another. The trainer froze an integrated GPU: host and device share memory there, and the staging copy that speeds up a discrete card does harm instead. LSTM and GRU did not run at all. The end-of-run summary called a card at full load 100% idle. None of this was visible from a machine with an NVIDIA card in it, and all of it is fixed in 0.9.0.
What I did not expect
I expected failure logs. What arrived were measurements.
One tester ran the same model in PyTorch on the same cards to find out how much of the slowness was AMD’s stack and how much was flodl. Most of it was the stack. Some of it was flodl: an optimizer step that cost more than it should, on every vendor, which I had never noticed because nothing had made me look. That is fixed for everyone now, NVIDIA included.
The same tester sent four patches, and suggested a mixed-precision mode that turned out to be the fastest way to train a small model on both of their chips. It ships in this release as a trainer setting.
So I asked for an hour of a GPU and got collaborators. The work is credited where it happened: the reports and the numbers from dhekimian and DhruvDh are in the issue, the patches are linked from it, and the changelog names each fix by who found it. Thank you both.
It worked
I did not know whether asking would work. flodl is a small project, and an hour of someone’s GPU is a real thing to ask for.
It worked, and not only here: the Apple GPU support in this release also came from someone outside the project, on hardware I have no way to test either. Twice now, the gap was a machine I do not own and the answer was a person who does.
So there will be more of these. When flodl reaches something I cannot verify alone, I will say so plainly and ask. If you would like to be asked, the issue tracker is where it happens.
What is still not proven
Three cards is three cards. One model fails on one of them. And the run this was all for has not happened: AMD and NVIDIA cards training one model together, which is the situation flodl’s distributed layer was built for. That is next.
0.9.0 has more in it than this, a web interface for one, and it gets its own post. The AMD guide has the setup, and the issue stays open: if you have a card that is not in the table, it is still an hour.