by tutanchamun · 7y ago · 0 comments
Good that AMD reverted their decision on FP64 which means the card has 3.5 TFlops.
The only real competitor in the consumer space seems to be the Nvidia Titan V which has 6.9 TFlops, 12 GByte of memory with 652.8 GB/s and costs 3000 USD.
The Radeon 7 only has half of the TFLOPS for FP64 but 16 GByte with 1024 GB/s and only costs 700 USD.
I don't have a use case for double precision but I'm sure people who need it will like the card.
OpenCL, while being a much cleaner API, suffers badly from the lack of quality libraries. The requirements aren't even that large for the killer application of DL - BLAS, a few convolution kernels, and random number generation. Darknet's {of the YOLO fame} interface to CUDA, for instance is composed of fewer than 10-15 functions.
AMD's efforts in this regards have not been very satisfactory IMO. Infact third party work such as CLBLAST are of much higher code quality than libraries like AMD's own CLBLAS (or it was). Sadly, AMD over the past few years has seems to have come under the belief that building a transpiler from CUDA bytecode to AMD's would be the magic bullet. It remains to be seen if this will suffice, but it does seem like a quixotic solution to a straightforward problem.
Had such a foundational software libraries (which mind you requires a lot of harware tailored optimization ) been perfected over the past few years (even while being multiple years behind NVDA), they could easily have turned the game, more so considering NVDA's shady tactics of banning GTX/RTX cards in the cloud.
I don't know what went wrong. It's not like AMD didn't have engineers working on ML applications; the direction seems misguided - AMD's engineers (unlike NVDIA's) seem to have focussed on porting frameworks onto low quality libraries, rather than securing the foundation. I'm afraid the ROCm effort will have the same effect.
Any "struct" or any other data you pass between CPU and GPU is automatically compiled by CLang / CUDA, and works on both. OpenCL on the other hand is... C-only (CUDA has C++), requires double-speak and has a compiler in the lol-device code.
So compiler bugs are fixed by updating AMD Device Drivers on the client. Its... horrifying. This is not a way to build libraries. In contrast, CUDA compiler bugs are fixed by updating the programmer's compiler.
> AMD's efforts in this regards have not been very satisfactory IMO. Infact third party work such as CLBLAST are of much higher code quality than libraries like AMD's own CLBLAS (or it was). Sadly, AMD over the past few years has seems to have come under the belief that building a transpiler from CUDA bytecode to AMD's would be the magic bullet. It remains to be seen if this will suffice, but it does seem like a quixotic solution to a straightforward problem.
I happen to agree with it. AMD's CUDA transpiler is built on top of AMD's HCC efforts (a C++ single source environment). The code for HCC is far cleaner than anything I've ever seen in OpenCL, and is mostly compatible with CUDA (thanks to the efforts of HIP).
HCC and HIP seem to be the canonical compute path forward, with compiled ahead-of-time OpenCL being supported as well.
There's some "#pragma openmp target" tests in the Github repos. So AMD is clearly working on that as well. If HCC got OpenMP support, it would be significantly easier for typical programmers to write GPU code.
--------
If I were starting a project today, it'd be OpenCL 1.2 on the AMDGPU-pro drivers (the old proprietary driver is more stable for sure), but with a careful eye on HCC / HIP advancements. HCC and HIP have gotten a huge amount of attention / github commits in the past year, so its clearly where AMD's main effort is going into.
There are also driver issues for sure. ROCm and RadeonGPU-Pro (two different OpenCL implementations) have numerous differences in performance. ROCm 2.1 is still absolutely awful at Blender for example (definitely use RadeonGPU-PRO drivers for that instead).
In some cases, I bet on Ahmdal's law. NVidia has fewer shaders at a higher clock than AMD. AMD's architecture is implicitly more parallel than NVidia's, so Ahmdal's law will hurt it (AMD's 4096 shaders on Vega64 will use more RAM than NVidia's 2304 CUDA shaders on the 2070).
In others, it seems like AMD's drivers are still unoptimized. Something weird is going on with Blender's code and ROCm for example.
--------
EDIT: I've seen some profiler data, and it seems like AMD's GPUs are rarely compute-ALU bound. They are often memory-bound. So AMD has far too strong compute for the graphics problems at hand. Alternatively, AMD's algorithms may be poorly tuned: they probably should be more compute heavy and try to use less RAM Bandwidth.