11 ms·
Tensorflow 2.0 AMD Support
- jefft255 7y agoMy tf or pytorch code usually uses custom CUDA extensions, so sadly it will never be plug and play on AMD gpus for me. I hate that scientific computing and ML settled on a (admittedly superior) proprietary API.
- partingshots 7y agoGoogle is working on integrating CUDA directly into TensorFlow with the end goal being that you can use any GPU to do your computation. Basically a leapfrog over the inherently closed system that Nvidia has tried to implement. I’m going to be glad when that finally happens. It’s not healthy for machine learning to be so dependent on a single provider like that.
- minxomat 7y agoIt's going to be oracle v Google all over again.
- monocasa 7y agoOracle v Google is still working its way through the court system.
- black_puppydog 7y agoby the time Google v NVidia will hit the highest courts, those will be stacked with AI overlords. I wonder what they'd think about being stuck in a proprietary API. :D
- nl 7y agoGoogle is working on integrating CUDA directly into TensorFlow What does this mean? And how does having CUDA in TF make it better for vendors that don't support CUDA? Could you post a link to this work?
- shmerl 7y ago> Google is working on integrating CUDA directly into TensorFlow How is it going to untie it from Nvidia? The only way to do it, is not to use CUDA, but something portable that can target any GPU.
- thrwe4234safd 7y agoIIRC ROCm basically takes PTX bytecode and runs them on AMD cards, so this shouldn't (theoretically) be an issue.
- jefft255 7y agoYeah I’m sure stuff like this can work without code rewrite but my guess is that it’s far from plug and play. I couldn’t use that to run my model on an AMD card tommorrow without some effort.
- TomVDB 7y agoThat wasn't the case when I last looked it. IIRC ROCm (in the form of HIP) defines a new C/C++ API that maps to either AMD intrincis or CUDA depending on a compile time flag. It required converting your CUDA source code to ROCm code, though there was a code translation tool to help you with that. To be honest: I don't really understand what ROCm stands for. AMD has been redefining their GP compute platforms so many times that it's easy to lose track. https://rocm-documentation.readthedocs.io/en/latest/Programming_Guides/Programming-Guides.html#rocm-languages https://rocm-documentation.readthedocs.io/en/latest/Programm...
- dnpp123 7y agoFinally..... Me, yesterday : https://github.com/tensorflow/tensorflow/issues/30638#issuecomment-559201634 https://github.com/tensorflow/tensorflow/issues/30638#issuec...
- rvz 7y ago> Can't bloody nvidia just open source everything. Those managers should be hanged. Wasted way too much time on this. As much as I want NVIDIA to open-source their drivers, they won't because of the same reasons the Raspberry Pi guys won't open-source their bootloader; they have to protect their IP. To us it is a triumphant revelation to the 'open-source' community if they open-source their drivers, but in reality, to them it is absolutely 'treasonous' for someone in the company to open-source them as it is essentially risks their IP being stolen or fully reverse-engineered from a 1:1 reference to the original code. Not as simple as it sounds to just 'open-source' something like drivers does it?
- Hello71 7y agoand AMD has no IP?
- bgorman 7y agoThe claims about their IP being stolen are not credible. For one, AMD has an open source graphics stack and none of their IP has been stolen. Furthermore, Nvidia actually has pretty good support for nouveau (open source driver) on the Tegra line. Nvidia's real IP has not been compromised. Nvidia had to provide good open source support because the automotive industry wants guarantees that hardware will be able to run modern kernels many years in the future. Open sourcing/upstreaming the device drivers has business value because it means the actual devices sold will be supported by Linux until they are truly obsolete. (Think i368) Device drivers are not sexy, all they do is setup/shutdown hardware and provide hooks for the operating system to make system calls work. This is not core IP, kernel drivers are the bare minimum to enable hardware to be useful. The real reason Nvidia doesn't want to open source it's device drivers is because it would cost money to do so. It would likely require a total rewrite, and Nvidias current driver presumably shares code between platforms with a shim that only Nvidia knows about. If everyone used Linux Nvidia would probably have open source drivers for workstations (like they do for embedded)
- montalbano 7y agoI posted this because I have noticed many people aren't aware TensorFlow can run on AMD gpus. When informed, a common response is how well does it work? This GitHub issue provides answers to both those questions with respect to the latest major release of TensorFlow. (Admittedly just a single benchmark data point, but better than nothing.)
- paol 7y agoFrom skimming the thread I get the impression it's a beta quality / work-in-progres kind of deal. Is that the case?
- edgyquant 7y agoThat's because it really doesn't work on AMD gpus (at least on Linux.). Sure if you spent a lot of time setting up the rocm driver you might get lucky but it's alpha quality at best and in my case (and the case of several people in this thread and the GitHub one linked) it doesn't work at all.
- acoye 7y agoI was following the old GH issue / thread related to OpenCL support for 1.x of TensorFlow. I tinkered an got it working with opensource kernel drivers on GCN1 (HD 7970) https://github.com/tensorflow/tensorflow/issues/22 https://github.com/tensorflow/tensorflow/issues/22 You could do it, and GCN was good at compute (still is with Radeon VI) but I must admit it was far more complicated than any AI researcher would have liked compared to the closed source binary approach of NVidia / Cuda.
- zapnuk 7y agoWith nvidea not supporting MacOS beyond the current version, and Google pushing Swift for Tensorflow, I assume both Apple and Google have an increasing incentive to improve the adaptation of AMD GPUs for deep learing.
- losvedir 7y agoHow do you mean Google is pushing Swift for Tensorflow? I knew the fast.ai folks were working on it, but I didn't know Google was pushing it at all.
- dagmx 7y agoGoogle is the company developing it with Chris Latner in charge
- pjmlp 7y agoAnd thanks to it they decided on a language that is barely workable outside Apple's eco-system, instead of more mature alternatives. I don't have big hopes for the project.
- girvo 7y agoI’m definitely not disagreeing with you, but the Linux story isn’t completely horrible mostly due to IBM’s work. Though I’ve no idea if they’ve kept pace with the macOS version and tooling, it’s been a couple years since I looked. A shame, I quite like it as a language.
- pjmlp 7y agoIBM seems to have lost interest. Kitura last commit was on June 2018. And even with all that support, it is not possible to write OS independent Swift without kludges (import darwin vs glibc, really?). Also many enterprises impose Windows desktops, so none of their dev divisions would even consider Tensorflows's Swift variant, regardless how well it would be doing on GNU/Linux.
- bonoboTP 7y agoWe've been experimenting with TF 1.14 on a Radeon VII. When you manage to properly install it, it does work at about 90% the speed of an NVIDIA RTX 2080 Ti, but is much cheaper, which can be a good trade-off. However, the tooling and installation procedure is still rough around the edges and the documentation is lacking. Last time I tried to upgrade the rocm things and the drivers, and bumped up against an issue that one of the packages tried to write to /data/jenkins_workspace during installation. We have /data as an NFS mount and is not writable even for the root user, so the installation broke down. Worked around it, but there are other issues as well. The order of packages you install can matter as well, I had to purge packages and reinstall them a few times. It worked with TF 1.14.1 but not with 1.14.0 if I recall correctly. The first few iterations are very slow, it seems it needs to find the optimal conv implementation for all kernel sizes separately. Also, the card does not have anything like NVIDIA's tensor cores for half-precision (float16/FP16) computation. It can do FP16 but won't speed up and delivers worse results (in terms of prediction accuracy) than NVIDIA cards running FP16. There is no prediction accuracy difference in FP32. And some other small issues here and there. So be warned and test it yourself on one card before investing in big multi-GPU machines. But I do wish AMD entering the field will benefit us through increased competition in the long run. But at the moment ROCm seems like just a side project for a small team in AMD and they can't yet deliver the streamlined experience we're used to from CUDA.
- danielscrubs 7y agofloat16 or bfloat16?
- bonoboTP 7y agoI wasn't aware of the difference, but now I looked. I've always used float16, not bfloat16 (tf.float16 is the usual float16), and it causes a large speed boost on Turing NVIDIA cards with tensor cores as opposed to float32. But certainly bfloat16 sounds attractive with its larger dynamic range, as float16 requires workarounds like loss scaling to avoid rounding down to zero when the exponent gets too small.
- bonoboTP 7y ago
- rjkennedy98 7y agoI am so excited for this. I have some AMD GPUs that I used for ethereum mining that I would LOVE to turn into an AI machine.
- sangnoir 7y agoYou can run AMD's port of Tensorflow 1.3 today if you don't want to wait for main-lined support in TF 2.0.
- ngcc_hk 7y agoSurprise. Can this support Mbp 15 2019 vega?
- yold__ 7y agoYes, the vega architecture is supported by rocm (basically AMD's cuda). You're best bet would be to use the pre-built docker images though.
- rarecoil 7y agoOn macOS? It is possible to use a GPU inside of Docker/macOS with Hyperkit? There's PCIe passthrough and/or SR-IOV support? ROCm requires Linux kernel extensions.
- spicyramen 7y agoGoogle implemented AMD for Stadia. As my understanding this is part of their Cloud infrastructure: will be interesting to see if they start supporting AMD in their cloud compute engine instances. If this happens, we should see a price difference and "probably" a push from their customer base to also support AMD in their Deep Learning VM. There is a company out there called LogicalClocks which already integrated AMD and TensorFlow
- jamesblonde 7y agoYes, we added support in our Resource Manager (a fork of YARN) for AMD GPUs and ROCm. It works fine with TensorFlow, and our benchmarks should at ROCm 2.10, the Radeon VII's performance for RESNET-50 is just a few percent lower than the 2080Ti. If you install our open-source platform, Hopsworks, using TensorFlow on Nvidia or AMD is exactly the same experience. We handle the complexity of installing/configuring drivers/libraries.
- vkaku 7y agoI'd like to point out that bfloat16! = traditional float16 and forms of bfloat16 are not available for hardware acceleration on all GPUs yet.
- ksec 7y agoDoes anyone know if AMD intend to bring ROCm to Navi? Because I dont see any Vega successor on their Roadmap, and Navi doesn't seems to be focus on GPU Compute.
- AstralStorm 7y agoIt's being done, albeit not quickly. https://github.com/RadeonOpenCompute/ROCm/issues/887 https://github.com/RadeonOpenCompute/ROCm/issues/887
- rarecoil 7y agoPhoronix states that Arcturus is the next compute acceleration chipset after Vega20, and thus Navi support may be unofficial if it does work: https://www.phoronix.com/scan.php?page=news_item&px=Radeon-ROCm-2.9-Released https://www.phoronix.com/scan.php?page=news_item&px=Radeon-R...
- ksec 7y agoThank You. Wasn't aware of Arcturus, I have always thought GPU Compute and GPU Gaming focus are at odds with each other and the trade off do not make any sense. So I am glad after so many years we have GPU specifically for Compute and GPU for gaming.
- mastazi 7y agoOf course many HN readers know that TF has been available for AMD for a while, but I still think that this Github thread is newsworthy, specifically this comment[1]: > The RADEON VII's performance is crazy with tensorflow 2.0a. In our tests, we reached close to the same speed like our 2080ti(about 10-15% less)! But the Radeon VII has more memory which was a bottleneck in our case. On this price this videocard has the best value to do machine learning we think that in our company! The comment above echoes the findings of HN user bonoboTP, see comment currently at the top of this thread[2] [1] comment link on Github: https://github.com/ROCmSoftwarePlatform/tensorflow-upstream/issues/362#issuecomment-479366031 https://github.com/ROCmSoftwarePlatform/tensorflow-upstream/... [2] comment link on HN: https://news.ycombinator.com/item?id=21657173 https://news.ycombinator.com/item?id=21657173
- Roark66 7y agoI've checked the prices and it seems a XFX branded Radeon VII with 16GB RAM can be had for similar price as Nvidia RTX 2070 super with 8GB. This is very interesting. I hope someone publishes benchmarks comparing those cards in training most frequently used network architectures. I would be heading to buy one of those Radeon cards myself if not for their lack of performance with conv networks. Also, current version of Nvidia RTX cards with tensorflow supports automatic mixed precision training which can significantly speed up training of some networks. I think we're still quite far from having a serious competitor to nvidia in general purpose machine learning.
- bonoboTP 7y ago> I hope someone publishes benchmarks comparing those cards in training most frequently used network architectures. I just did a haphazard, not very scientific, but ballpark-useful comparison: https://news.ycombinator.com/item?id=21666411 https://news.ycombinator.com/item?id=21666411
- ralphc 7y agoJust ordered a 16" MacBook Pro with a AMD Radeon Pro 5000M. Will that now work with TF 2.0? How does it compare with the Radeons mentioned here?
- DreGPU 7y agoI’m pretty sure it won’t, at least not tensorflow-gpu. Tensorflow-cpu will though. There’s no ROCm support for MacOS and obviously no CUDA support.