Khronos
Read post

SPIR-V on ROCm: A Portable IR for AMD GPUs #

ROCm now supports SPIR-V as a portable intermediate representation for AMD GPUs, enabling a compile-once, specialize-on-device model. Instead of building separate native code objects for each GPU architecture (which causes linear growth in build time and binary size), developers can target the abstract `amdgcnspirv` target and let the runtime JIT-compile to the actual device ISA on first launch. A key innovation is Zero-Cost Feature Selection (ZCFS): late-resolved feature predicates like `__builtin_amdgcn_processor_is` and `__builtin_amdgcn_is_invocable` are folded during SPIR-V→native lowering so exactly one branch survives per architecture with no runtime overhead. Benchmarks on MI350X (CDNA4) show flat compile time and binary size regardless of target count, forward compatibility with GPUs not yet released at build time, and steady-state performance matching native code after a one-time ~70–100ms JIT cost on first launch. The main current limitation is partial SPIR-V support in ROCm's per-arch device libraries (rocBLAS, Composable Kernel, rocFFT in progress).

    #general-programming#gpu#rocm
Jul 28•32m read time•From rocm.blogs.amd.com
Post cover image
Table of contents
The Problem: AOT-per-Target Does Not Scale #What SPIR-V Is, and What AMD’s Flavor Adds #Compilation Model #Late-Resolved Predicates in Practice #What You Get #What It Costs #Quick Start #Deep Dive: Benchmarking SPIR-V vs Fat #FAQ #Where Things Stand and What Is Next #Summary #Additional Resources #Disclaimers #
93 Impressions
Khronos's image
Khronos

The Khronos Group is a consortium of technology companies and industry experts that develops open st...

56 Followers

•

145 Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard