CUDA vs ROCm: Choosing for Modern AI

AMD ROCm vs NVIDIA CUDA for AI in 2026: where measured results show ROCm behind, how PyTorch differs, what HIP porting involves, and how to benchmark…

CUDA vs ROCm: Choosing for Modern AI
Written by TechnoLynx Published on 20 Jan 2026

Choosing between AMD ROCm and NVIDIA CUDA means choosing hardware and a software stack together. Measured results still put ROCm behind CUDA on transformer training, complex attention variants, multi-node collectives and inference setups that combine several optimisations at once. AMD hardware does compete on some workloads: SemiAnalysis’s 2026 inference benchmark finds MI355X competitive on FP8 serving, and AMD reports MI300X leading H100 on memory-bound decoding. So AMD ROCm vs NVIDIA CUDA for AI is decided per workload, and the API side of it belongs to the wider GPU compute API choice between vendor-native and portable models.

Is ROCm Catching up to CUDA for AI Training and Inference?

ROCm is improving, but unevenly across workloads. The clearest recent gains are in inference on the newest AMD parts; the training and scale-out measurements are older. Keep each measurement next to its date: SemiAnalysis notes that AMD runs before about January 2026 used private ROCm images and cannot be compared directly with later ones.

Training on MI300X: The GEMM and Attention Gap

SemiAnalysis’s MI300X training benchmark measured the basic building block of every transformer, dense matrix multiplication (GEMM), on AMD’s public software releases. In BF16, H100 and H200 reached roughly 720 TFLOP/s against a marketed 989.5 TFLOP/s, while MI300X reached about 620 TFLOP/s against a marketed 1,307 TFLOP/s. That makes MI300X 14% slower in practice despite the higher paper figure. FP8 was worse: about 1,280 TFLOP/s on H100/H200 against about 990 TFLOP/s on MI300X, which SemiAnalysis puts at 22% slower than H100.

AMD’s hipBLASLt/rocBLAS heuristics picked the wrong GEMM algorithm for most shapes out of the box, so users had to spend 1-2 hours tuning a modern LLM and repeat that after code changes. On NVIDIA, cuBLASLt picked correctly without tuning. For a time, F.Linear was routed to the less optimised rocBLAS while torch.matmul used hipBLASLt, so two APIs that should perform the same did not.

Attention showed a wider gap than GEMM. On models with non-causal attention such as Mistral 7B v0.1, H100/H200 beat MI300X by more than 2.5x in TFLOP/s, because FlexAttention was not yet fully working on AMD. SemiAnalysis put the gap in PyTorch feature availability between the two platforms at about six months.

In the 2026 arXiv power-aware study, at 700 W, H200 processed ViT-L/16 at 359 images/s and MI300X at 198 images/s, and the authors link the larger gap on attention-heavy models to framework and kernel maturity. That study also saw the AMD framework take up to 15 minutes just to start training.

Scale-Out: RCCL and the Fabric

In SemiAnalysis’s two-node test, H100 was 10-25% faster than MI300X, and the gap grew as more nodes were added. SemiAnalysis attributes this to a weaker RCCL and less vertical integration with networking than NVIDIA has across NCCL, InfiniBand/Spectrum-X and its switches. Inside a node, MI300X’s xGMI is point-to-point, so a single GPU pair gets 64 GB/s, not the headline 448 GB/s. NVLink’s switched topology lets one GPU reach another at the full 450 GB/s. For all-gather, all-to-all and reduce-scatter, MI300X measured 2-4x slower than InfiniBand.

Inference in 2026: Competitive in Isolation, Behind When Optimisations Are Combined

In SGLang, FP8 MI355X disaggregated serving with wide expert parallelism matched NVIDIA’s SGLang results on B200. For single-node aggregated FP8 serving, AMD’s SGLang gave better performance per TCO than NVIDIA’s. The weak point is composability. Disaggregated prefill, wide expert parallelism and FP4 each work on AMD, but with all three enabled at once AMD was not competitive with NVIDIA. Against Dynamo TensorRT-LLM on B200, the more mature NVIDIA implementation pulled ahead.

AMD’s own MI300X guidance claims MI300X often outperforms H100 in memory-bound scenarios, especially long-output generation, because of its higher HBM bandwidth. AMD adds that MI300X’s 192 GB of HBM lets models such as Llama2-70B fit on a single GPU with their KV cache. The 2026 arXiv study also found MI300X ahead of both NVIDIA GPUs on inference only at low power limits, falling behind both at higher limits, though the authors warn that low AMD power limits could not be enforced reliably.

Where ROCm Stands, by Workload

Workload Current reading Evidence and date
Dense BF16/FP8 GEMM, MI300X vs H100/H200 MI300X 14% (BF16) and 22% (FP8, vs H100) slower on public releases SemiAnalysis, late 2024
Training with non-causal attention (e.g. Mistral 7B) H100/H200 more than 2.5x ahead of MI300X SemiAnalysis, late 2024
Transformer vision workload at 700 W H200 359 vs MI300X 198 images/s (ViT-L/16) arXiv power-aware study, 2026
Multi-node training H100 10-25% faster on two nodes; collectives 2-4x slower than InfiniBand SemiAnalysis, late 2024
Memory-bound, long-output decoding on MI300X Often ahead of H100 AMD vendor guidance
FP8 disaggregated serving, MI355X vs B200 (SGLang) Competitive SemiAnalysis InferenceX v2, 2026
FP4 + disaggregated prefill + wide EP Not competitive with NVIDIA SemiAnalysis InferenceX v2, 2026

How these gaps turn into cost per inference, and when TensorRT shifts the result back towards NVIDIA, is covered in AMD vs NVIDIA for AI inference cost.

How PyTorch on ROCm Differs from PyTorch on CUDA in Practice

Model code carries over with few changes, if any, but the environment around it differs. PyTorch on ROCm intentionally reuses the torch.cuda interfaces. The ROCm backend is built by generating HIP source from PyTorch’s CUDA backend, not by maintaining a separate hand-written port. The differences are in release cycles, missing libraries, attention kernels, numerics and distributed support.

  • Release cycles. The ROCm 6.4 documentation describes two release lines. AMD’s ROCm PyTorch release ships the latest ROCm but not always the latest stable PyTorch, and the official PyTorch release ships the latest PyTorch but not always the latest ROCm. By the ROCm 7.1 documentation, ROCm development is aligned with stable PyTorch releases, and upstream PyTorch testing uses stable ROCm. In late 2024, SemiAnalysis found AMD’s Docker images still on PyTorch 2.3 after 2.4 and 2.5 had shipped.
  • No TensorRT equivalent. AMD’s PyTorch compatibility page states that ROCm has no library equivalent to TensorRT, so torch-tensorrt deployments have no direct counterpart. The CUDA vs TensorRT distinction explains what that layer does on the NVIDIA side.
  • Attention kernels. In ROCm 7.1, scaled_dot_product_attention calls an optimised flash attention kernel automatically, and FlashAttention v3 is integrated for AMD GPUs.
  • Numerics. TF32 works on MI300 through hipBLASLt using the same PyTorch controls, but the MI300 TF32 path has hardware-level numerical differences from NVIDIA’s. The “bf16x9” precision mode is NVIDIA-only and raises an error on ROCm. FP16 and BF16 reduced-precision reductions in matmul are not available on ROCm 7.1. The 2026 arXiv study also notes that frameworks such as PyTorch Lightning often default to more conservative precisions on AMD.
  • Distributed and debugging. Only the nccl (backed by RCCL) and gloo backends of torch.distributed are supported on ROCm. Kernel asserts are disabled by default for performance reasons and need a PyTorch rebuild from source to enable.

The practical rule is to pin a validated combination and treat any upgrade as a re-test. ROCm depends on aligned firmware, driver and user-space versions, and AMD publishes a compatibility matrix of the framework versions it has validated.

Can Existing CUDA Code Run on AMD GPUs Through HIP, ZLUDA or SCALE?

Existing CUDA code can run on AMD GPUs through three routes. Each has its own limits, and only HIP comes from AMD itself.

HIP is AMD’s C++ runtime API and kernel language. Its runtime API closely mirrors CUDA, and HIPIFY tools translate CUDA source into HIP. AMD’s own documentation says HIP is not intended as a drop-in replacement for CUDA, and that developers should expect some manual coding and performance tuning. The manual work concentrates in a few places:

  • warp size, since GCN/CDNA uses 64-wide warps and 32-bit lane masks break when shifted by values above 31;
  • __launch_bounds__, where CUDA’s minimum blocks per multiprocessor becomes minimum warps per execution unit;
  • register control, because amdclang++ does not support --maxregcount;
  • memory-type enums, whose values differ between HIP and CUDA.

HIPIFY’s mechanics, and how the two models compare kernel by kernel, are covered in CUDA vs AMD HIP.

Two studies show what to expect from performance. The Ginkgo team’s 2020 port compared HIP code compiled for NVIDIA V100 against native CUDA on the same GPU. Half the test cases differed by under 3%, 90% by under 10%, and the worst case was 15% slower. That measures the cost of HIP as an abstraction, not AMD hardware. In our view, the same code performs essentially the same through a vendor API or a standard one, and vendor-specific gains only come from deliberate low-level work. A portability study found HIP gave the best performance on AMD systems in most cases. The same study’s hipified XSBench kernel, identical to its CUDA original apart from syntax, suggests that unoptimised translation does not guarantee good performance on AMD GPUs, with their smaller cache per workgroup. Translation gets the code running. Tuning it for AMD GPUs is separate work.

ZLUDA takes a different approach. It runs unmodified CUDA binaries on ROCm, which also covers closed-source applications that cannot be hipified. Phoronix’s testing found it capable but not fail-safe: NVIDIA OptiX was not fully supported, and software not using PTX was not handled. AMD quietly stopped funding the project and then asked its developer to take the code down after NVIDIA banned translation layers for CUDA-based software. The author’s own speed-ups are reported as Geekbench-specific and not generalisable. Our judgement is that ZLUDA is fine for evaluating software you cannot recompile, but it is no foundation for a production training or serving stack.

SCALE, from Spectral Compute, is a CUDA-compatible toolkit that compiles existing CUDA codebases for AMD GPUs, MI300X and MI355X among them, and maps CUDA-X library calls onto ROCm libraries. Spectral Compute says its implementations are often faster than HIP and match CUDA API behaviour more precisely. That is the vendor’s claim, not an independent result, so test it on your own kernels.

Scoping a CUDA-to-ROCm Port Before You Commit

Scope the port from an inventory of what your codebase depends on, not from a line count. Work through the steps below in order. Each step can end the project early, before money is spent.

  1. Confirm the hardware and OS are supported. AMD treats any GPU missing from its system-requirements table as unsupported, and ROCm needs a CPU with PCIe atomics, which means 1st-generation Zen or Intel Haswell and later. On workstations, ROCm 7.2.1 supports Radeon 9000 and select 7000 GPUs with PyTorch, TensorFlow, JAX and ONNX on Linux, and PyTorch on Windows and on select Ryzen APUs. AMD cites up to 48 GB of VRAM on Radeon and up to 128 GB of shared memory on Ryzen APUs.
  2. Run HIPIFY in examine mode. The --examine option scans the source without changing it and reports which files contain CUDA code and how much of it converts automatically. hipify-clang needs a working CUDA install and code that compiles. hipify-perl uses pattern matching and is easier to set up but less powerful.
  3. Map every library call. HIPIFY’s supported-API tables map cuBLAS, cuSPARSE, cuFFT, cuRAND, CUB and others to HIP and ROC equivalents, and cuDNN to MIOpen. Where both a hip and a roc version exist, AMD recommends the roc version on AMD GPUs. TensorRT has no ROCm equivalent, so a TensorRT dependency has no direct mapping.
  4. Flag the hand-tuned kernels. Warp-size assumptions, launch bounds and __CUDA_ARCH__ checks are porting issues AMD’s guide names. Ginkgo had to implement sub-warp shuffle and vote cooperative groups itself because HIP lacked them at the time.
  5. Decide on single-source or dual backends. Ginkgo kept native CUDA alongside HIP and shared about a third of its code through a common folder, setting warp size and launch bounds per backend.
  6. Pin the stack and measure. Choose one validated ROCm and framework combination from AMD’s compatibility matrix, then profile the port before trusting any number.

How to Benchmark ROCm Against CUDA on Your Own Workload

Benchmark the workload you will actually run, on the software you will actually ship. The authors of the 2026 arXiv study conclude that procurement should rest on workload-specific throughput, energy efficiency and stack maturity rather than peak spec sheet numbers. The checklist below follows from the gaps measured above:

  • Use public, stable images. To get MI300X to a usable state, SemiAnalysis needed a roughly 60-command Dockerfile, hand-crafted by an AMD engineer, which took about 5 hours to build.
  • Keep your real attention variant. On Mistral 7B, non-causal attention left MI300X at roughly half H100 speed even on AMD’s tuned November build.
  • Count setup and tuning time, including GEMM tuning and startup overhead.
  • Fix precision explicitly on both platforms, since defaults and TF32 numerics differ.
  • Test at your real node count and with the inference optimisations you will combine.

Who Can Port or Benchmark Our CUDA Workload on AMD?

TechnoLynx scopes, ports and profiles CUDA workloads on ROCm through its GPU Performance Engineering work, so a team can learn what AMD hardware would really cost and deliver before it buys. TechnoLynx can take on the inventory described above: supported hardware, HIPIFY coverage, library mapping and the hand-tuned kernels at risk. TechnoLynx can also run a profiled comparison of your workload on both stacks. Where your kernels need AMD-specific tuning to close a gap, TechnoLynx does that tuning as GPU performance engineering.

This is not the right engagement for every team. If your stack is plain PyTorch on supported Instinct hardware with standard attention, AMD’s validated images and its compatibility matrix may be all you need. If you depend on TensorRT-based serving, the honest first step is to price staying on NVIDIA, because ROCm has no equivalent library. Teams that want vendor neutrality as a long-term design goal should also weigh portable models: SYCL was the most consistently performance-portable model in the 2024 supercomputer study, and SYCL vs CUDA covers that trade-off.

Most of the Evidence Predates MI355X and ROCm 7

Most measured comparisons here are MI300X against H100/H200, and AMD’s software has improved since then. SemiAnalysis measured MI355X at up to 10x MI300X performance. It also found that AMD software for DeepSeek R1 FP4 on SGLang improved by up to 2x between December 2025 and January 2026. As of InferenceX v2, upstream vLLM had zero MI355X tests and too few MI300X CI machines, and its maintainers said day-0 ROCm support was not possible. For any MI355X or ROCm 7 decision, re-run your own workload instead of carrying over the old gap.