ROCm

Last updated

ROCm
Developer(s) AMD
Initial releaseNovember 14, 2016;7 years ago (2016-11-14)
Stable release
6.2.2 / September 27, 2024;19 days ago (2024-09-27) [1]
Repository Meta-repository
github.com/ROCm/ROCm
Written in C, C++, Python, Fortran, Julia
Middleware HIP
Engine AMDgpu kernel driver, HIPCC, a LLVM-based compiler
Operating system Linux, Windows [2]
Platform Supported GPUs
Predecessor Close to metal, Stream, HSA
Size <2 GiB
Type GPGPU libraries and APIs
License MIT License
Website www.amd.com/en/products/software/rocm.html

ROCm [3] is an Advanced Micro Devices (AMD) software stack for graphics processing unit (GPU) programming. ROCm spans several domains: general-purpose computing on graphics processing units (GPGPU), high performance computing (HPC), heterogeneous computing. It offers several programming models: HIP (GPU-kernel-based programming), OpenMP (directive-based programming), and OpenCL.

Contents

ROCm is free, libre and open-source software (except the GPU firmware blobs [4] ), and it is distributed under various licenses. ROCm initially stood for Radeon Open Compute platform; however, due to Open Compute being a registered trademark, ROCm is no longer an acronym — it is simply AMD's open-source stack designed for GPU compute.

Background

The first GPGPU software stack from ATI/AMD was Close to Metal, which became Stream.

ROCm was launched around 2016 [5] with the Boltzmann Initiative. [6] ROCm stack builds upon previous AMD GPU stacks; some tools trace back to GPUOpen and others to the Heterogeneous System Architecture (HSA).

Heterogeneous System Architecture Intermediate Language

HSAIL [7] was aimed at producing a middle-level, hardware-agnostic intermediate representation that could be JIT-compiled to the eventual hardware (GPU, FPGA...) using the appropriate finalizer. This approach was dropped for ROCm: now it builds only GPU code, using LLVM, and its AMDGPU backend that was upstreamed, [8] although there is still research on such enhanced modularity with LLVM MLIR. [9]

Programming abilities

ROCm as a stack ranges from the kernel driver to the end-user applications. AMD has introductory videos about AMD GCN hardware, [10] and ROCm programming [11] via its learning portal. [12]

One of the best technical introductions about the stack and ROCm/HIP programming, remains, to date, to be found on Reddit. [13]

Hardware support

ROCm is primarily targeted at discrete professional GPUs, [14] but unofficial support includes the Vega family and RDNA 2 consumer GPUs.

Accelerated Processor Units (APU) are "enabled", but not officially supported. Having ROCm functional there is involved. [15]

Professional-grade GPUs

AMD Instinct accelerators are the first-class ROCm citizens, alongside the prosumer Radeon Pro GPU series: they mostly see full support.

The only consumer-grade GPU that has relatively equal support is, as of January 2022, the Radeon VII (GCN 5 - Vega).

Consumer-grade GPUs

Name of GPU series Southern
Islands
Sea
Islands
Volcanic
Islands
Arctic
Islands/Polaris
Vega Navi 1X Navi 2X
ReleasedJan 2012Sep 2013Jun 2015Jun 2016Jun 2017Jul 2019Nov 2020
Marketing NameRadeon HD 7000Radeon Rx 200Radeon Rx 300Radeon RX 400/500Radeon RX Vega/Radeon VII(7 nm)Radeon RX 5000Radeon RX 6000
AMD supportDark Red x.svgYes check.svg
Instruction set GCN instruction set RDNA instruction set
Microarchitecture GCN 1st gen GCN 2nd gen GCN 3rd gen GCN 4th gen GCN 5th gen RDNA RDNA 2
Type Unified shader model
ROCm [16] Dark Red x.svgYes check.svg [17] Yes check.svgYes check.svg [18] Yes check.svg
OpenCL 1.2 (on Linux: 1.1 (no Image support) with Mesa 3D)2.0 (Adrenalin driver on Win7+)
(on Linux: 1.1 (no Image support) with Mesa 3D, 2.0 with AMD drivers or AMD ROCm)
2.02.1 [19]
Vulkan 1.0
(Win 7+ or Mesa 17+)
1.2 (Adrenalin 20.1, Linux Mesa 3D 20.0)
Shader model 5.15.1
6.3
6.46.5
OpenGL 4.6 (on Linux: 4.6 (Mesa 3D 20.0))
Direct3D 11 (11_1)
12 (11_1)
11 (12_0)
12 (12_0)
11 (12_1)
12 (12_1)
11 (12_1)
12 (12_2)
/drm/amdgpu [lower-alpha 1] Experimental [20] Yes check.svg
  1. DRM (Direct Rendering Manager) is a component of the Linux kernel.

Software ecosystem

Learning resources

AMD ROCm product manager Terry Deem gave a tour of the stack. [21]

Third-party integration

The main consumers of the stack are machine learning and high-performance computing/GPGPU applications.

Machine learning

Various deep learning frameworks have a ROCm backend: [22]

Supercomputing

ROCm is gaining significant traction in the top 500. [24] ROCm is used with the Exascale supercomputers El Capitan [25] [26] and Frontier.

Some related software is to be found at AMD Infinity hub.

Other acceleration & graphics interoperation

As of version 3.0, Blender can now use HIP compute kernels for its renderer cycles. [27]

Other Languages

Julia

Julia has the AMDGPU.jl package, [28] which integrates with LLVM and selects components of the ROCm stack. Instead of compiling code through HIP, AMDGPU.jl uses Julia's compiler to generate LLVM IR directly, which is later consumed by LLVM to generate native device code. AMDGPU.jl uses ROCr's HSA implementation to upload native code onto the device and execute it, similar to how HIP loads its own generated device code.

AMDGPU.jl also supports integration with ROCm's rocBLAS (for BLAS), rocRAND (for random number generation), and rocFFT (for FFTs). Future integration with rocALUTION, rocSOLVER, MIOpen, and certain other ROCm libraries is planned.

Software distribution

Official

Installation instructions are provided for Linux and Windows in the official AMD ROCm documentation. ROCm software is currently spread across several public GitHub repositories. Within the main public meta-repository, there is an XML manifest for each official release: using git-repo, a version control tool built on top of Git, is the recommended way to synchronize with the stack locally. [29]

AMD starts distributing containerized applications for ROCm, notably scientific research applications gathered under AMD Infinity Hub. [30]

AMD distributes itself packages tailored to various Linux distributions.

Third-party

There is a growing third-party ecosystem packaging ROCm.

Linux distributions are officially packaging (natively) ROCm, with various degrees of advancement: Arch Linux, [31] Gentoo, [32] Debian, Fedora , [33] GNU Guix, and NixOS.

There are spack packages. [34]

Components

There is one kernel-space component, ROCk, and the rest - there is roughly a hundred components in the stack - is made of user-space modules.

The unofficial typographic policy is to use: uppercase ROC lowercase following for low-level libraries, i.e. ROCt, and the contrary for user-facing libraries, i.e. rocBLAS. [35]

AMD is active developing with the LLVM community, but upstreaming is not instantaneous, and as of January 2022, is still lagging. [36] AMD still officially packages various LLVM forks [37] [38] [9] for parts that are not yet upstreamed compiler optimizations destined to remain proprietary, debug support, OpenMP offloading, etc.

Low-level

ROCk Kernel driver

ROCm Device libraries

Support libraries implemented as LLVM bitcode. These provide various utilities and functions for math operations, atomics, queries for launch parameters, on-device kernel launch, etc.

ROCt Thunk

The thunk is responsible for all the thinking and queuing that goes into the stack.

ROCr Runtime

The ROC runtime is a set of APIs/libraries that allows the launch of compute kernels by host applications. It is AMD's implementation of the HSA runtime API. [39] It is different from the ROC Common Language Runtime.

ROCm CompilerSupport

ROCm code object manager is in charge of interacting with LLVM intermediate representation.

Mid-level

ROCclr Common Language Runtime

The common language runtime is an indirection layer adapting calls to ROCr on Linux and PAL on windows. It used to be able to route between different compilers, like the HSAIL-compiler. It is now being absorbed by the upper indirection layers (HIP and OpenCL).

OpenCL

ROCm ships its installable client driver (ICD) loader and an OpenCL [40] implementation bundled together. As of January 2022, ROCm 4.5.2 ships OpenCL 2.2, and is lagging behind competition. [41]

HIP Heterogeneous Interface for Portability

The AMD implementation for its GPUs is called HIPAMD. There is also a CPU implementation mostly for demonstration purposes.

HIPCC

HIP builds a `HIPCC` compiler that either wraps Clang and compiles with LLVM open AMDGPU backend, or redirects to the NVIDIA compiler. [42]

HIPIFY

HIPIFY is a source-to-source compiling tool. It translates CUDA to HIP and reverse, either using a Clang-based tool, or a sed-like Perl script.

GPUFORT

Like HIPIFY, GPUFORT is a tool compiling source code into other third-generation-language sources, allowing users to migrate from CUDA Fortran to HIP Fortran. It is also in the repertoire of research projects, even more so. [43]

High-level

ROCm high-level libraries are usually consumed directly by application software, such as machine learning frameworks. Most of the following libraries are in the General Matrix Multiply (GEMM) category, which GPU architecture excels at.

The majority of these user-facing libraries comes in dual-form: hip for the indirection layer that can route to Nvidia hardware, and roc for the AMD implementation. [44]

rocBLAS / hipBLAS

rocBLAS and hipBLAS are central in high-level libraries, it is the AMD implementation for Basic Linear Algebra Subprograms. It uses the library Tensile privately.

rocSOLVER / hipSOLVER

This pair of libraries constitutes the LAPACK implementation for ROCm and is strongly coupled to rocBLAS.

Utilities

Comparison with competitors

ROCm competes with other GPU computing stacks: Nvidia CUDA and Intel OneAPI.

Nvidia CUDA

Nvidia's CUDA is closed-source, whereas AMD ROCm is open source. There is open-source software built on top of the closed-source CUDA, for instance RAPIDS.

CUDA is able run on consumer GPUs, whereas ROCm support is mostly offered for professional hardware such as AMD Instinct and AMD Radeon Pro.

Nvidia provides a C/C++-centered frontend and its Parallel Thread Execution (PTX) LLVM GPU backend as the Nvidia CUDA Compiler (NVCC).

Intel OneAPI

Like ROCm, oneAPI is open source, and all the corresponding libraries are published on its GitHub Page.

Unified Acceleration Foundation (UXL)

Unified Acceleration Foundation (UXL) is a new technology consortium that are working on the contiuation of the OneAPI initiative, with the goal to create a new open standard accelerator software ecosystem, related open standards and specification projects through Working Groups and Special Interest Groups (SIGs). The goal will compete with Nvidia's CUDA. The main companies behind it are Intel, Google, ARM, Qualcomm, Samsung, Imagination, and VMware. [45]

See also

Related Research Articles

<span class="mw-page-title-main">Mesa (computer graphics)</span> Free and open-source library for 3D graphics rendering

Mesa, also called Mesa3D and The Mesa 3D Graphics Library, is an open source implementation of OpenGL, Vulkan, and other graphics API specifications. Mesa translates these specifications to vendor-specific graphics hardware drivers.

<span class="mw-page-title-main">Free and open-source graphics device driver</span> Software that controls computer-graphics hardware

A free and open-source graphics device driver is a software stack which controls computer-graphics hardware and supports graphics-rendering application programming interfaces (APIs) and is released under a free and open-source software license. Graphics device drivers are written for specific hardware to work within a specific operating system kernel and to support a range of APIs used by applications to access the graphics hardware. They may also control output to the display if the display driver is part of the graphics hardware. Most free and open-source graphics device drivers are developed by the Mesa project. The driver is made up of a compiler, a rendering API, and software which manages access to the graphics hardware.

<span class="mw-page-title-main">CUDA</span> Parallel computing platform and programming model

In computing, CUDA is a proprietary parallel computing platform and application programming interface (API) that allows software to use certain types of graphics processing units (GPUs) for accelerated general-purpose processing, an approach called general-purpose computing on GPUs (GPGPU). CUDA API and its runtime: The CUDA API is an extension of the C programming language that adds the ability to specify thread-level parallelism in C and also to specify GPU device specific operations. CUDA is a software layer that gives direct access to the GPU's virtual instruction set and parallel computational elements for the execution of compute kernels. In addition to drivers and runtime kernels, the CUDA platform includes compilers, libraries and developer tools to help programmers accelerate their applications.

nouveau (software) Open source software driver for Nvidia GPU

nouveau is a free and open-source graphics device driver for Nvidia video cards and the Tegra family of SoCs written by independent software engineers, with minor help from Nvidia employees.

<span class="mw-page-title-main">AMD Software</span> Device driver and utility software package for AMD GPUs and APUs

AMD Software is a device driver and utility software package for AMD's Radeon graphics cards and APUs. Its graphical user interface is built with Qt and is compatible with 64-bit Windows and Linux distributions.

<span class="mw-page-title-main">OpenCL</span> Open standard for programming heterogenous computing systems, such as CPUs or GPUs

OpenCL is a framework for writing programs that execute across heterogeneous platforms consisting of central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), field-programmable gate arrays (FPGAs) and other processors or hardware accelerators. OpenCL specifies a programming language for programming these devices and application programming interfaces (APIs) to control the platform and execute programs on the compute devices. OpenCL provides a standard interface for parallel computing using task- and data-based parallelism.

<span class="mw-page-title-main">Radeon HD 7000 series</span> Series of video cards

The Radeon HD 7000 series, codenamed "Southern Islands", is a family of GPUs developed by AMD, and manufactured on TSMC's 28 nm process.

Graphics Core Next (GCN) is the codename for a series of microarchitectures and an instruction set architecture that were developed by AMD for its GPUs as the successor to its TeraScale microarchitecture. The first product featuring GCN was launched on January 9, 2012.

C++ Accelerated Massive Parallelism is a native programming model that contains elements that span the C++ programming language and its runtime library. It provides an easy way to write programs that compile and execute on data-parallel hardware, such as graphics cards (GPUs).

Heterogeneous System Architecture (HSA) is a cross-vendor set of specifications that allow for the integration of central processing units and graphics processors on the same bus, with shared memory and tasks. The HSA is being developed by the HSA Foundation, which includes AMD and ARM. The platform's stated aim is to reduce communication latency between CPUs, GPUs and other compute devices, and make these various devices more compatible from a programmer's perspective, relieving the programmer of the task of planning the moving of data between devices' disjoint memories.

<span class="mw-page-title-main">Numba</span> Open-source JIT compiler

Numba is an open-source JIT compiler that translates a subset of Python and NumPy into fast machine code using LLVM, via the llvmlite Python package. It offers a range of options for parallelising Python code for CPUs and GPUs, often with only minor code changes.

Video Code Engine is AMD's video encoding application-specific integrated circuit implementing the video codec H.264/MPEG-4 AVC. Since 2012 it was integrated into all of their GPUs and APUs except Oland.

<span class="mw-page-title-main">AMD PowerTune</span> Brand name by AMD

AMD PowerTune is a series of dynamic frequency scaling technologies built into some AMD GPUs and APUs that allow the clock speed of the processor to be dynamically changed by software. This allows the processor to meet the instantaneous performance needs of the operation being performed, while minimizing power draw, heat generation and noise avoidance. AMD PowerTune aims to solve thermal design power and performance constraints.

<span class="mw-page-title-main">Radeon 300 series</span> Series of video cards

The Radeon 300 series is a series of graphics processors developed by AMD. All of the GPUs of the series are produced in 28 nm format and use the Graphics Core Next (GCN) micro-architecture.

Vulkan is a low-level, low-overhead cross-platform API and open standard for 3D graphics and computing. It was intended to address the shortcomings of OpenGL, and allow developers more control over the GPU. It is designed to support a wide variety of GPUs, CPUs and operating systems, and it is also designed to work with modern multi-core CPUs.

<span class="mw-page-title-main">GPUOpen</span> Middleware software suite

GPUOpen is a middleware software suite originally developed by AMD's Radeon Technologies Group that offers advanced visual effects for computer games. It was released in 2016. GPUOpen serves as an alternative to, and a direct competitor of Nvidia GameWorks. GPUOpen is similar to GameWorks in that it encompasses several different graphics technologies as its main components that were previously independent and separate from one another. However, GPUOpen is partially open source software, unlike GameWorks which is proprietary and closed.

<span class="mw-page-title-main">AMDgpu (Linux kernel module)</span> AMD GPU driver for Linux

AMDgpu is an open source device driver for the Linux operating system developed by AMD to support its Radeon lineup of graphics cards (GPUs). It was announced in 2014 as the successor to the previous radeon device driver as part of AMD's new "unified" driver strategy, and was released on April 20, 2015.

<span class="mw-page-title-main">SYCL</span> Higher-level programming standard for heterogeneous computing

SYCL is a higher-level programming model to improve programming productivity on various hardware accelerators. It is a single-source embedded domain-specific language (eDSL) based on pure C++17. It is a standard developed by Khronos Group, announced in March 2014.

oneAPI (compute acceleration) Open standard for parallel computing

oneAPI is an open standard, adopted by Intel, for a unified application programming interface (API) intended to be used across different computing accelerator (coprocessor) architectures, including GPUs, AI accelerators and field-programmable gate arrays. It is intended to eliminate the need for developers to maintain separate code bases, multiple programming languages, tools, and workflows for each architecture.

References

  1. "ROCm 6.1.2 Release". GitHub . Retrieved October 16, 2024.
  2. "New HIP SDK helps democratize GPU Computing". July 27, 2023.
  3. "Question: What does ROCm stand for? · Issue #1628 · RadeonOpenCompute/ROCm". Github.com. Retrieved January 18, 2022.
  4. "Debian -- Details of package firmware-amd-graphics in buster". Packages.debian.org. Retrieved January 18, 2022.
  5. "AMD @ SC16: Radeon Open Compute Platform (ROCm) 1.3 Released, Boltzmann Comes to Fruition". anandtech.com. Retrieved January 19, 2022.
  6. "AMD @ SC15: Boltzmann Initiative Announced - C++ and CUDA Compilers for AMD GPUs". anandtech.com. Retrieved January 19, 2022.
  7. "HSA Programmer's Reference Manual: HSAIL Virtual ISA and Programming Model, Compiler Writer, and Object Format (BRIG)" (PDF). HSA Foundation. May 2, 2018. Retrieved August 1, 2023.
  8. "User Guide for AMDGPU Backend — LLVM 13 documentation". Llvm.org. Retrieved January 18, 2022.
  9. 1 2 "The LLVM Compiler Infrastructure". GitHub . January 19, 2022.
  10. "Introduction to AMD GPU Hardware" via www.youtube.com.
  11. "Fundamentals of HIP Programming". Archived from the original on February 7, 2023.
  12. "ROCm™ Learning Center". AMD.
  13. "AMD ROCm / HCC programming: Introduction". December 26, 2018.
  14. "AMD Documentation - Portal".
  15. "Here's something you don't see every day: PyTorch running on top of ROCm on a 6800M (6700XT) laptop! Took a ton of minor config tweaks and a few patches but it actually functionally works. HUGE!". December 10, 2021.
  16. "ROCm Getting Started Guide v5.2.3".
  17. "HOW-TO: Stable Diffusion on an AMD GPU". September 23, 2022.
  18. "Any update on 5700 Xt support?". GitHub .
  19. "AMD Radeon RX 6800 XT Specs". TechPowerUp. Retrieved January 1, 2021.
  20. Larabel, Michael (December 7, 2016). "The Best Features of the Linux 4.9 Kernel". Phoronix . Retrieved December 7, 2016.
  21. "ROCm presentation". HPCwire.com. July 6, 2020. Retrieved January 18, 2022.
  22. "AMD Introduces Its Deep-Learning Accelerator Instinct MI200 Series GPUs". Infoq.com. Retrieved January 18, 2022.
  23. "Using CuPy on AMD GPU (experimental)".
  24. "AMD Chips Away at Intel in World's Top 500 Supercomputers as GPU War Looms". November 16, 2020.
  25. "El Capitan Supercomputer Detailed: AMD CPUs & GPUs to Drive 2 Exaflops of Compute".
  26. "Livermore's el Capitan Supercomputer to Debut HPE 'Rabbit' Near Node Local Storage". February 18, 2021.
  27. "Blender 3.0 takes support for AMD GPUs to the next level. Beta support available now!". Gpuopen.com. November 15, 2021. Retrieved January 18, 2022.
  28. "AMD ROCm ⋅ JuliaGPU". juliagpu.org.
  29. "ROCm Installation v4.3 — ROCm 4.5.0 documentation". Rocmdocs.amd.com. Retrieved January 18, 2022.
  30. "Running Scientific Applications on AMD Instinct Accelerators Just Got Easier". HPCwire.com. October 18, 2021. Retrieved January 25, 2022.
  31. "ROCm for Arch Linux". Github.com. January 17, 2022. Retrieved January 18, 2022.
  32. "Gentoo Linux Packages Up AMD ROCm, Makes Progress On RISC-V, LTO+PGO Python". Phoronix.com. Retrieved January 18, 2022.
  33. "Fedora & Debian Developers Look At Packaging ROCm For Easier Radeon GPU Computing Experience". Phoronix.com. Retrieved January 18, 2022.
  34. Gamblin, Todd; LeGendre, Matthew; Collette, Michael R.; Lee, Gregory L.; Moody, Adam; de Supinski, Bronis R.; Futral, Scott (November 15, 2015). "The Spack Package Manager: Bringing Order to HPC Software Chaos" via GitHub.
  35. Bloor, Cordell. "20211221 Packaging session notes and small update". debian-ai@lists.debian.org (Mailing list). Retrieved January 18, 2022.
  36. "[Debian official packaging] How is ROCm LLVM fork still needed? · Issue #2449 · ROCm-Developer-Tools/HIP". GitHub .
  37. "Aomp - V 14.0-1". GitHub . January 22, 2022.
  38. "The LLVM Compiler Infrastructure". GitHub . January 10, 2022.
  39. "HSA Runtime Programmer's Reference Manual" (PDF). HSA Foundation. May 2, 2018. Retrieved August 1, 2023.
  40. "Khronos OpenCL Registry - The Khronos Group Inc". www.khronos.org.
  41. "List of OpenCL Conformant Products - The Khronos Group Inc". www.khronos.org. February 3, 2022.
  42. "Figure 3. HIPCC compilation process illustration. The clang compiler".
  43. "AMD Publishes Open-Source "GPUFORT" as Newest Effort to Help Transition Away from CUDA".
  44. Maia, Julio; Chalmers, Noel; T. Bauman, Paul; Curtis, Nicholas; Malaya, Nicholas; McDougall, Damon; van Oostrum, Rene; Wolfe, Noah (May 2021). ROCm Library Support & Profiling Tools (PDF). AMD.
  45. "Exclusive: Behind the plot to break Nvidia's grip on AI by targeting software". Reuters . Retrieved April 5, 2024.