HIP Python

Contents

HIP Python#

2026-06-02

1 min read

Applies to Linux and Windows

Advanced Micro Devices, Inc.

Welcome to the documentation pages for HIP Python!

HIP Python provides low-level Cython and Python® bindings for the HIP runtime, HIPRTC, multiple math libraries and the communication library RCCL, and further a CUDA® Python Interoperability layer that aims to simplify the porting of CUDA Python and Cython programs.

Note

This documentation was generated on 2026-09-24T21:13:15+00:00 from ROCm™ version 10.0.0 headers by interfacegen 0.5 from hip-python 0.1.2 (183b6a80).

Source trees always consulted during codegen:

  • ROCm/rocm-systems: 6b0e43f341195e203754e08f850e437ff2fc09f9 — supplies the HIP, HIPRTC and AMD COMGR headers the bindings are generated from.

  • ROCm/llvm-project: 8f497e0992fb7513f7f78a6f6b6f1056c375e961 — supplies clang Python bindings compatible with ROCm Clang.

Optional source trees consulted during codegen:

  • ROCm/rocm-libraries: 8d1ae90eff7d022f26019ec55b2ec6a7674b3112

Spotlight#

How to Install HIP Python

Learn how to identify the correct HIP Python packages to install for your ROCm™ installation, where to retrieve the packages and what options you have to install them.

_images/pip_install.PNG
How to Use HIP Python

Learn how to use HIP Python’s interfaces in your Python or Cython program. We present a large number of examples that cover HIP and HIPRTC as well as multiple math libraries (HIPBLAS, HIPRAND, HIPFFT) and the communication library RCCL. Learn how to launch your own kernels and how the different libraries interact.

_images/hip_usage.PNG
How to Port CUDA Python Applications

Learn how you can use HIP Python’s CUDA Python interoperability layer to port or even directly run CUDA Python applications on AMD GPUs. The chapter covers Python and Cython programs.

_images/cuda_interop.PNG
JIT Compilation and LLVM IR

Learn how to JIT-compile, link, and inspect HIP kernels at runtime — from the high-level hiprtc API (compile, link, launch) down to the lower-level rocm.comgr pipeline (HIP source –> LLVM bitcode –> HSA assembly –> code object) — and how to work on the IR itself with the LLVM-C bindings in rocm.bindings.llvm.c: parse bitcode, build a module with the IR builder, run pass pipelines, and query targets.

Adapter Types

Learn about the datatypes that HIP Python uses to translate between C and Python and that are designed to ease interoperability with other packages such as NumPy and Numba.

GPU Programming with Numba HIP

Learn how to write GPU kernels in Python with Numba HIP, the ROCm™ HIP backend for Numba. Covers vector addition, shared-memory reductions, matrix multiplication, ufuncs, CPU/GPU code reuse, and linking external HIP/CUDA C++ device functions via the Foreign Function Interface.

HIP Python’s Python API

The full list of HIP Python Python variables, classes and functions. A few entry points:

The CUDA Python Interoperability Layer’s Python API

The full list of the CUDA Python interoperability layer’s Python variables, classes and functions.

Note

Contributions are welcome. Most of this API is generated from the ROCm™ C headers, so a fix belongs in the code generator rather than in the emitted bindings. The contributing guide in the source repository explains where each kind of change belongs and how to validate it, and Building from Source covers building the wheels and these documentation pages yourself.