by jdewerd · 2y ago · 0 comments
Ooooh, is that why the consumer cards don't do compute? Yikes, I was hoping that was just a bit of misguided segmentation but this sounds like a high level architecture problem, like an interstate without an on ramp. Oof.
Typically, software developers only support a single GPGPU API, and that API is nVidia CUDA.
Technically, consumer AMD cards are awesome at compute. For example, UE5 renders triangle meshes with compute instead of graphics https://www.youtube.com/watch?v=TMorJX3Nj6U Moreover, AMD cards often outperform nVidia equivalents because nVidia prioritized ray tracing and DLSS over compute power and memory bandwidth.
The issue is, no tech company is interested in adding D3D or Vulkan backend to AI libraries like PyTorch. nVidia is not doing that because they are happy with the status quo. Intel and AMD are not doing that because both hope to replace CUDA with their proprietary equivalents, instead of an open GPU API.
AMD is interested in making PyTorch take advantage of their chips, and has done so.
> we are delighted that the PyTorch 2.0 stable release includes support for AMD Instinct™ and Radeon™ GPUs that are supported by the ROCm™ software platform.
When NVIDIA is charging 1000% profit margins for a GPU aimed at use as an AI accelerator, you can expect competitors to be willing to do what it takes to move into that market.
https://www.tomshardware.com/news/nvidia-makes-1000-profit-o...
All the companies that are now screaming hellfire because of Nvidia's market maker position are also the companies that gave Nvidia a warchest filled with billions of dollars. How is AMD supposed to compete when the whole market is funding their rival?
Microsoft has an offline dxc.exe compiler which compiles HLSL to Spir-V. Also, DXVK has a JIT compiler which recompiles DXBC byte codes to Spir-V. Both technologies are old, stable and reliable, for example the DXVK’s JIT compiler is a critical software component of the SteamDeck console.
> The lowest-effort path so far is most likely
I agree that’s most likely to happen, but the outcome is horrible from consumer PoV.
Mesa is Linux-only, Rust is too hard to use for vast majority of developers (myself included), AMD will never support older cards with ROCm, and we now have the third discrete GPU vendor, Intel.
(note that rusticl + zink does deal with it _partially_ to some extent nowadays)
+ Vulkan memory management doesn't expose unified address space primitives
Like AMD did with FreeSync (now VRR) and FSR3 (whatever open standard it will morph into)?
I'll never understand the hate AMD gets from the open source community. Mind-boggling.
A large part of that hate is that, for a very long time, they had the worst of both worlds: a fragile proprietary driver and subpar performance.
Only recently have they fixed both. Indeed I only found out about their newfound openness a few years ago. Not everyone has gotten the memo.
i'm using Apache TVM right now to run LLMs via Vulkan on Intel Arc cards.
Intel has their own pytorch wheels here for their GPUs: https://developer.intel.com/ipex-whl-stable-xpu
Neither oneAPI, nor ROCm are proprietary?
oneAPI is a set of SYCL related standards. Originally that was Intel, but now that's owned by the UXL foundation, which is part of the Linux foundation.
How many man hours is a project like this?
These software projects were great to validate the technology choices, but note I only did bare minimum to implement specific ML models. Implementing a complete PyTorch backend gonna involve dramatically more work. I can’t even estimate how much more because I’m not an expert in Python or these Python-based ML libraries.
To go on a tangent, I note your custom 'BCML1' 5bit per weight compression codec and your optimised hand-coded AVX2 to encode it... was that really needed? Are the weights encoded on every startup? Why not do it once and save to disk?
There is very little NVIDIA and CUDA cards off of X86_64 and maybe OpenPower architectures. So I disagree. Also, OpenCL, despite being kind of a "betrayed standard", enjoys quite a lot of popularity even on x86_64 (sometimes even with NVIDIA hardware) - even if it is not as popular there.
> AMD cards often outperform nVidia equivalents
Can you link to benchmarks or other analysis supporting this claim? This has not been my impression in recent years, though I don't routinely look at high-end AMD hardware.
> because nVidia prioritized ray tracing and DLSS over compute power and memory bandwidth.
Has it really?
Current generation nVidia: https://en.wikipedia.org/wiki/GeForce_40_series#Desktop
Current generation AMD: https://en.wikipedia.org/wiki/Template:AMD_Radeon_RX_7000
The key performance characteristics are processing power TFlops, and memory bandwidth GB/s.
nVidia 4080 which costs $1200: 43 TFlops FP16, 43 TFlops FP32, 0.672 TFlops FP64, 717 GB/s memory.
AMD 7900 XTX which costs $1000: 93 TFlops FP16, 47 TFlops FP32, 1.5 TFlops FP64, 960 GB/s memory.
Note that for applications which bottleneck on FP16 compute (many ML workloads) or FP64 compute (many traditional HPC workloads: numerical solvers, fluid dynamics, etc), the 7900 XTX even outperforms the 4090 which costs $1600.
Ampere and newer also have native sparsity support which means that you can skip over the zeroes 'for free', which Nvidia uses to market double the TFlops, which is kind of misleading imo. But the 195 TFlops are even before sparsity is included!
I'm not sure if the 93 TFlops (120 with boost clocks) on AMD are with FP16 or FP32 accumulation, as with FP32 accumulation the 4080 slows down significantly and gets much closer with 97.5 TFlops.
Intel Xe-HPG (used in the Arc A cards) also offers very aggressive matrix acceleration via XMX, with 137.6 FP16 TFlops at base clock, vs. 17.2 FP32 TFlops.
https://www.videocardbenchmark.net/directCompute.html
has:
GeForce RTX 4090 28,916
RTX 6000 Ada 23,296
GeForce RTX 4080 22,016
Radeon RX 7900 XTX 18,767
and Geekbench 6:
https://browser.geekbench.com/opencl-benchmarks
has:
GeForce RTX 4090 321928
L40 292357 <- L40S is out and may be better
RTX 6000 Ada 274348
H100 267514
NVIDIA GeForce RTX 239863
Radeon RX 7900 XTX 199412
The attempts to bring C++ to it never were properly done, and that is why OpenCL 3.0 is basically OpenCL 1.0 rebranded.
OpenCL 3.0 got rid of the mandatory features of OpenCL 2.0 that nobody was willing to implement.
http://richg42.blogspot.com/2014/05/the-truth-on-opengl-driv...
that's the reason blender kicked their openCL implemention to the curb after years of futzing with it. it wasn't portable because AMD's openCL was so broken they had to have their own special codepath anyway, and it didn't perform well and wasn't worth the effort.
AMD has left a trail of abandoned code and disappointed developers in their wake. These two repos are the same thing for AMD's ecosystem and NVIDIA's ecosystem, how do you think the support story compares?
https://github.com/HSA-Libraries/Bolt
https://github.com/NVIDIA/thrust
in the last few years they have (once again) dumped everything and started over, ROCm supported essentially no consumer cards and rotated support rapidly even in the CDNA world. It offers no binary compatibility support story, it has to be compiled for specific chips within a generation, not even just "RDNA3" but "Navi 31 specifically". Etc etc. And nobody with consumer cards could access it until like, six months ago, and that still is only on windows, consumer cards are not even supported on linux (!).
That's fine for non-commercial and HPC, but it makes it difficult to imagine ever shipping commercial products to end-users on it. I guess you... ship as source, and your users have to figure out ROCm and compile it in-situ? Or ship a binary for every single GPU to ever release (including NVIDIA, Intel, ....)
https://geohot.github.io/blog/jekyll/update/2023/06/07/a-div...
This is on top of the actual problems that still remain, as geohot found out. Installing ROCm is a several-hour process that will involve debugging the platform just to get it to install, and then you will probably find that the actual code demos segfault when you run them.
AMD's development processes are not really open, and actual development is silo'd inside the company with quarterly code dumps outside. The current code is not guaranteed to run on the actual driver itself, they do not test it even in the supported configurations, because all the development is happening on internal builds etc, not release code.
oh and AMD themselves isn't using the open driver of course... they only test and validate on AMDGPU-PRO.
it hasn't got traction because it's a low-quality product and nobody can even access it and run it anyway, let alone ship commercial products on it. and now everyone regrets it because it's turned into a money fountain.
Misguided segmentation or a high level architecture problem however, it is not. A specialized product will perform its specialty better than a general purpose product. There's minimal demand for a card that's good at both compute and gaming. These people exist, but are few compared to those who only care about one or the other.
The benefit of splitting GCN into RDNA and CDNA was immediate. Comparing the Radeon VII (GCN 5) vs RX 5700 XT (RDNA 1), you'll see that they're fairly evenly matched on gaming, trading blows with the Radeon VII slightly ahead when averaged. The RX 5700 XT takes a very heavy loss on compute benchmarks. Both are TSMC 7nm, but the RX 5700 XT has fewer shaders (2560 vs 3840), a smaller die (251 vs 311 mm2), and lower power consumption (225 vs 300 w) which shows how much more efficient it is at gaming. That much lower power consumption and noise, and a couple hundred dollars cheaper made it a much more compelling card for gamers.
CDNA cards are apparently missing components needed for gaming, like render output units. Hence, they have no official support for DirectX, OpenGL, or Vulkan. I've never seen anyone get one of these working for gaming. In exchange, their compute performance is so good that a number of companies are buying these cards over Nvidia's, despite the overwhelming CUDA ecosystem. In 2013, a GCN based supercomputer made the top 100. That is the one and only GCN based system to ever make the top 100. Compare to now, where 8 of the top 10 most energy efficient super computers use CDNA accelerators, as does the number 1 fastest supercomputer outright.
They're few, but they're very important, because 5 years from now, they will be the ones working for the companies that AMD will want to sell their compute cards to.
The reasons you cite may still be more important. I'm not saying AMD made a bad decision. I'm just saying that neglecting the path from hobbyist to professional (or student to professional) is not insignificant.
No, just a cool trillion dollars of market cap are saying that, nbd :)
https://www.tomshardware.com/news/amd-enables-rocm-and-pytor...
Someone writing for the rocm platform will be writing HIP and then HIPCC will compile that down into the actual runtime targeting the given architecture. HIP is pretty platform agnostic so very little device specific optimization tends to go into idiomatic HIP.
They're fundamentally a hardware company (as per Lisa Su's CV) which didn't cotton on to the fact that Cuda was the killer. I remember how @Bridgman kept playing a rearguard action on Phoronix, his job being to keep devs on board. Losing battle.
I kinda understand it because [80/90]s era hardware people intrinsically think hardware is the top dog in the stack, and that's where all AMD management come from including Su.
Kodura understood that Nvidia was killing AMD because the consumer cards could run CUDA. So he pushed through, against Lisa Su, the Radeon VII, which until very recently, and for many years, was the only consumer card that ROCm supported. He was basically fired shortly thereafter, and the RVII, which was a fantastic card, was shutdown sharpish. Then they brought in Wang who crystallised the consumer/pro segmentation.
Now they're furiously trying to backpedal, and it's too late. There are multiple attempting competitors, but basically the only one worth talking about is AAPL and Metal.
AMD lost the window.
I kid you not, but the software side of ATI’s reviews and incentives were literally QA got rewarded for finding bugs and then the software engineers were then rewarded for fixing them. You can imagine what happened next. The bitch of it is that it was overall just a symptom of the problem that the company as a whole didn’t prioritize software. NVIDIA knew that the drivers and software efficiency of using the hardware was just as if not more important than the hardware (the stories in the 1990s of how John Carmack used various hacks with hardware is a good example of that).
Though now Nvidia are outselling them in dGPUs by nearly 10x, so it's pretty easy for them to do "both".
Sure, if those things are relevant to you, it was a killer card, but most consumers judge GPUs first and foremost by their gaming performance, in which the VII was a total dud. The 5700 XT was nearly as fast in those with far less hardware because getting proper utilization on GCN/CDNA is a pain compared to RDNA.
RDNA2 completed the gaming oriented flip with Infinity Cache (which is also useful outside of games, but still has limited application in GPGPU) which allowed them to offer competitive gaming performance to Nvidia with far less hardware, a big difference from the Vega era.
An argument about whether the Radeon VII was a "fantastic card" misses the point, it could have been another GPU. OP's main point was that AMD had a years-long policy of not officially supporting any of their consumer-grade GPUs for computing applications, as a result AMD had lost critical opportunities during this time period - even a small market share is better than none. OP mentioned Radeon VII because it was the only exception, and it only happened because there was strong support from some groups within AMD - which didn't last long. After RDNA was released, computing support on consumer GPUs was put on pause again until several months ago. There's a big difference between "not optimally designed for computing" and "no official support of computing at all".
The outcome is that it created a great barrier of entry for developers and power users with desktop GPUs. You have to figure out everything by yourself, which is not supposed to be particularly difficult as it's the norm in the FOSS world. The problem is that, in a community-driven project, you would have received help or at least a hint from your peers or project maintainers who's familiar with the system. Not so for AMD. if something doesn't work, no AMD developers will provide any help or even hints - and by not providing support, the "community" is never really established. The ROCm GitHub Issues page was (is?) basically a post-apocalypse world abandoned by AMD, full of user self-help threads with no input from developers. Almost nothing works and nobody known why. Even if the problem reported is a general one, it would still be ignored or closed if you're not running an officially-supported system and GPU.
One time, I needed to understand a hardware feature of an AMD GPU, I eventually had to read ROCm and Linux kernel source code before finding an answer. For most users, it's completely unacceptable.
> Sure, if those things are relevant to you, it was a killer card
Disclosure: I use the Radeon VII for bandwidth-heavy simulations so I have a pro-Radeon VII bias. But I don't think my bias affected my judgement here.
That being said, I can't imagine this is something that's been good for adoption of AMD cards for compute tasks. The wonderful thing about CUDA is you don't need a special accelerator card to develop cuda code.
In contrast, current NVIDIA GPUs are very compute heavy architectures (to the point that they often artificially limit certain aspects of their consumer cards other than fp64 to not interfere with the workstation cards), and they take great advantage of it all with their various features combining software and hardware capabilities.
Ironically, mining is probably the most optimized GPGPU application a regular end-user can run on AMD GPUs. One reason was that GCN was a computing-first GPU, but also that miners have a strong motivation to go through the troubles of overcoming the lack of computing support by AMD. They would write the entire application in OpenCL 1.0 and optimize it to extract the last bit of performance in spite of its difficulties - the hashing kernels used for mining also tends to be much simpler than other applications, so it's feasible to do so. Meanwhile other people who want a decent programming environment would've picked CUDA without looking back.
Eg the 7900 XTX competes with the 4090 in rastering but is between 30 and 50% cheaper, 7900 XT / 4080, 7800 XT / 4070 are all winning by decent amount in pricing. Frankly this focus has allowed them to catch back in a field they've behind for more than a decade now.
The rise of RT and other compute tools in gaming (DLSS and co) is hurting this strategy, but their APU being on PS5 AND Xbox Series keep them in the race, game engines and game developpers need to make it work on AMD tech.
With Nvidia pricing and memory choice this generation, it's the first time in a while that bying an AMD card for gaming is the better choice at almost every price point (unless you can afford the 4090).
I found it surprising because I wasn't aware at the time there was any, and it's not like it isn't something I should have known.
No, not really. Sure, the consumer cards are based on a less suitable architecture, so they won't be as good, but it's not like it's not a general purpose GPU architecture anymore.
The real problem is that ROCm has made the very weird technical decision of shipping GPU machine code, rather than bytecode. Nvidia has their own bytecode NVPTX, and Intel just uses SPIR-V for oneAPI.
This means that ROCm support for a GPU architecture requires shipping binaries of all the libraries (such as rocBLAS, rocDNN, rocsparse, rocFFT) for all architectures.
As the cherry on top, on paper one GPU family consists of different architectures! The RX 6700 XT identifies as a different 'architecture' (gfx1031) than the RX 6800 XT (gfx1030). These are 'close enough' that you can tell ROCm to use gfx1030 binaries on gfx1031 and it'll usually just work, but still.
I feel like this is a large part of the reason AMD is so bad about supporting older GPUs in ROCm. It'd cost a bit of effort, sure, but I feel like the enormous packages you'd get are a bigger issue. (This is another factor that kills hobbyist ROCm, because anyone with a Pascal+ GPU can do CUDA, but ROCm support is usually limited to newer and higher end cards.)
As far as I can tell, the gfx1030 and gfx1031 ISAs are identical in all but name. LLVM treats them exactly the same and all tests for the ROCm math libraries will pass when you run gfx1030 code on gfx1031 GPUs using the override.
The Debian package for HIP has a patch so that if the user has a gfx1031 GPU and there are no gfx1031 code objects available, it will fall back to using gfx1030 code objects instead. When I proposed that patch upstream, it was rejected in favour of adding a new ISA that explicitly supports all the GPUs in a family. That solution is more complex and is taking longer to implement, but will more thoroughly solve that problem (as the solution Debian is using only works well when there's one ISA in the family that is a subset of all the others).
Some of the ROCm libraries are partially written in assembly. Hopefully they all have C reference implementations that can be compiled for the other architectures.
My guess is that the AMD strategy of only shipping libraries for some cards + open source means ROCm-ish as built by Linux distros, who are likely to build the libs for all the architectures and not just the special few, can be expected to drive people away from the official releases.