ROCm

Also known as: AMD ROCm

On this page 7

ROCm (also called AMD ROCm) is the open-source software stack from AMD for general-purpose GPU computing, combining a kernel driver, a runtime, an LLVM-based compiler, the HIP programming interface and a family of tuned math and communication libraries. Among AI frameworks & tools, it plays the role that the CUDA platform plays on NVIDIA hardware: it is the layer beneath PyTorch, JAX, TensorFlow and inference engines that turns tensor operations into work on AMD Instinct accelerators and selected Radeon GPUs.

For teams in artificial intelligence, ROCm matters because it determines whether an existing model pipeline can move to AMD hardware without a rewrite. Most users never call ROCm directly; they install a ROCm build of their framework, and the quality of that build, the supported GPU list and the maturity of the kernels decide real-world performance and stability.

How the ROCm stack is organized

ROCm is organized as layers that each hide the one below: a Linux kernel driver manages the device, a user-space runtime schedules work, a compiler produces GPU machine code, and libraries expose fast routines for linear algebra, convolutions and collective communication. Frameworks sit at the top and call those libraries through backends that mirror their CUDA counterparts.

The runtime follows the Heterogeneous System Architecture (HSA) model, in which the host places work packets into user-mode queues that the GPU consumes directly. Code is compiled ahead of time for a specific GPU architecture target, named with identifiers such as gfx90a for the MI200 series, gfx942 for the MI300 series and gfx1100 for the Radeon RX 7900 family. A binary built without the right target simply fails to load on that GPU.

The table below maps the main ROCm components to their function and to the closest equivalent in the NVIDIA ecosystem, which helps engineers who already know CUDA.

ComponentFunctionClosest CUDA equivalent
amdgpu driver and ROCrDevice management and HSA runtimeNVIDIA driver and CUDA driver API
HIP runtime and hipccProgramming interface and compiler wrapperCUDA runtime and nvcc
rocBLAS and hipBLASLtDense matrix multiplicationcuBLAS and cuBLASLt
MIOpenConvolutions, normalization, attention primitivescuDNN
RCCLMulti-GPU collective communicationNCCL
rocprof and amd-smiProfiling and device monitoringNsight tools and nvidia-smi
Core ROCm components and their roles

HIP and the path from CUDA code

HIP (Heterogeneous-computing Interface for Portability) is a C++ dialect whose API is deliberately close to CUDA, so that calls such as cudaMalloc correspond to hipMalloc almost one to one. AMD provides hipify tools that translate CUDA source automatically, and the translated code can still be compiled for NVIDIA GPUs through a thin HIP layer.

Source compatibility is not the same as performance portability. AMD data center GPUs of the CDNA family execute threads in wavefronts of 64, while NVIDIA warps contain 32 threads, so kernels that hard-code warp size, rely on warp-level intrinsics or assume a particular shared-memory layout need manual review after translation. Inline PTX assembly has no automatic translation at all.

The following table summarizes the usual porting routes and what each one costs in effort.

Starting pointTypical routeMain remaining effort
Framework-level Python codeInstall the ROCm build of the frameworkUsually none beyond testing
Custom CUDA C++ kernelsRun hipify, then compile with hipccWarp-size and intrinsic fixes
Triton kernelsUse the AMD backend of TritonRetuning block sizes
Inline PTX or vendor binariesRewrite the affected partsFull reimplementation
Routes for moving GPU code to ROCm

How AI frameworks run on ROCm

In practice, PyTorch is the most mature entry point to ROCm. Its ROCm wheels reuse the familiar torch.cuda interface and the cuda device string, so most training scripts run without code changes; the framework routes calls to rocBLAS, hipBLASLt, MIOpen and RCCL behind the scenes. JAX and TensorFlow also ship ROCm builds, generally with a narrower set of tested configurations.

For large language model serving, inference engines such as vLLM and SGLang support ROCm, and AMD contributes kernels for attention and quantized matrix multiplication through its Composable Kernel library and AITER project. The large high-bandwidth memory on Instinct accelerators, such as 192 GB of HBM3 on the MI300X, is a key reason teams choose ROCm for serving models that would otherwise need to be split across more GPUs.

The next table compares ROCm with neighboring layers in the AI toolchain so that its position is clear.

LayerScopeRelationship to ROCm
CUDANVIDIA GPU platformDirect counterpart on other hardware
PyTorchModel definition and training frameworkRuns on top of ROCm as a backend
TritonPython language for GPU kernelsCompiles to AMD GPUs through ROCm
ONNX RuntimeCross-platform inference engineUses ROCm or MIGraphX as an execution provider
OpenVINOIntel inference toolkitAlternative stack for different hardware
ROCm compared with related layers

Choosing hardware and a ROCm configuration

A working setup depends on matching four versions that must agree: the GPU architecture, the Linux distribution and kernel, the ROCm release and the framework build. AMD publishes a compatibility matrix for each release, and staying inside it is the single most effective way to avoid obscure runtime errors. Container images with a preinstalled ROCm and framework remove much of this risk.

Support is strongest for Instinct data center accelerators and narrower for consumer Radeon cards, while Windows support through the HIP SDK covers fewer libraries than Linux. The decision table below gives sensible defaults.

SituationRecommended choiceReason
Production training clusterInstinct GPUs with official ROCm containersFull library and RCCL support
Single-node LLM inferenceInstinct GPU with vLLM ROCm imageLarge memory, tuned kernels
Developer workstationOfficially listed Radeon GPU on LinuxLower cost with supported target
Unlisted consumer GPUAvoid for production workUnsupported targets may break silently
Typical ROCm deployment choices

Limitations and common mistakes

The main limitation of ROCm is ecosystem depth rather than raw hardware capability. Many third-party libraries, research repositories and custom kernels are written for CUDA first, and some arrive on ROCm later or not at all. Teams should budget time for validation instead of assuming parity.

  • Forcing an unsupported architecture: overriding the reported GPU target may run, but can produce crashes or wrong results.
  • Mixing package sources: combining distribution packages with AMD repositories often causes library version conflicts.
  • Ignoring kernel tuning: default GEMM and attention kernels may underperform until tuned for the specific model shapes.
  • Assuming warp size 32: translated kernels with hard-coded assumptions can silently compute incorrect reductions.
  • Benchmarking too early: performance changes noticeably between ROCm releases, so comparisons should name the exact versions.

A final caution concerns multi-node scaling: RCCL performance depends on the network fabric, its drivers and topology settings, so collective bandwidth should be measured before a long training run is scheduled.

A plain-language summary

A graphics card is a powerful engine. It still needs software that tells it what to do. ROCm is that software for AMD graphics cards. It sits between AI programs and the chip.

Think of it as a translator and a toolbox. AI programs like PyTorch speak in big math tasks. ROCm turns those tasks into instructions the AMD chip understands. It also supplies ready-made tools for the most common calculations.

The main point is simple. With ROCm, many AI programs can run on AMD hardware instead of only on NVIDIA hardware. The result depends on picking supported parts and matching versions.

An example from practice

A research group at a university wants to serve a 70-billion-parameter language model for internal use. On their previous hardware, the model in 16-bit precision needed several GPUs because each card had too little memory. They rent a server with eight AMD Instinct MI300X accelerators and use the official vLLM container built on ROCm.

The engineers keep their existing Python serving code, since the ROCm build of PyTorch exposes the same device interface. They spend two days on validation and kernel tuning: they confirm that outputs match their reference results, enable the tuned attention kernels and run a tuning pass for the matrix shapes of their model.

The outcome is a working service in which the full model fits on a single GPU, while the remaining accelerators serve additional replicas. The group notes one lesson for the future: pinning exact ROCm and framework versions in the container made later upgrades predictable and easy to test.