Skip to main content

Python and Cython bindings for HIP

Project description

HIP Python

This repository provides low-level Python and Cython bindings for HIP. Currently, only bindings for the AMD GPU backend of HIP are provided.

Known Issues

The hiprand Cython Module Causes Compiler Error

With all ROCm™ versions before and including version 5.6.0, compiling/using HIP Python's hiprand Cython module results in a compiler error.

The error is caused by the following statement in the C compilation path of <path_to_rocm>/hiprand/hiprand_hcc.h, which is not legal in C for aliasing a struct type:

typedef rocrand_generator_base_type hiprandGenerator_st;

Workaround (Requires Access to Header File): Edit Header File

For this fix, you need write access to the ROCm™ header files. Then, modify file <path_to_rocm>/hiprand/hiprand_hcc.h such that

typedef rocrand_generator_base_type hiprandGenerator_st;

becomes

typedef struct rocrand_generator_base_type hiprandGenerator_st;

ROCm™ 5.5.0 and ROCm™ 5.5.1

On systems with ROCm™ HIP SDK 5.5.0 or 5.5.1, the examples

  • hip-python/examples/0_Basic_Usage/hiprtc_launch_kernel_args.py
  • hip-python/examples/0_Basic_Usage/hiprtc_launch_kernel_no_args.py

abort with errors.

An upgrade to version HIP SDK 5.6 or later (or a downgrade to version 5.4) is advised if the showcased functionality is needed.

Unspecific

On certain Ubuntu 20 systems, we encountered issues when running the examples:

  • hip-python/examples/0_Basic_Usage/hiprtc_launch_kernel_args.py
  • hip-python/examples/0_Basic_Usage/rccl_comminitall_bcast.py

We could not identify the cause yet.

Documentation

For examples, guides and API reference, please take a look at the official HIP Python documentation pages:

https://rocm.docs.amd.com/projects/hip-python/en/latest/index.html

LICENSE

MIT License

Copyright (c) 2023-2025 Advanced Micro Devices, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

hip_python-6.3.2.540.31-cp313-cp313-manylinux_2_17_x86_64.whl (67.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

hip_python-6.3.2.540.31-cp312-cp312-manylinux_2_17_x86_64.whl (66.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

hip_python-6.3.2.540.31-cp311-cp311-manylinux_2_17_x86_64.whl (69.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

hip_python-6.3.2.540.31-cp310-cp310-manylinux_2_17_x86_64.whl (66.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

hip_python-6.3.2.540.31-cp39-cp39-manylinux_2_17_x86_64.whl (66.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

hip_python-6.3.2.540.31-cp38-cp38-manylinux_2_17_x86_64.whl (67.3 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

Details for the file hip_python-6.3.2.540.31-cp313-cp313-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for hip_python-6.3.2.540.31-cp313-cp313-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 60596b1a6c805d9c3e3d722b1552174b30028dfb7599b091eb869f221e409294
MD5 3c2850d33725fc5e612b5d856168e66f
BLAKE2b-256 cec766c96601327e53445a9494bfb2b03c75a8dec5e0f4326b3dc701bb339b91

See more details on using hashes here.

File details

Details for the file hip_python-6.3.2.540.31-cp312-cp312-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for hip_python-6.3.2.540.31-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 85ad621152ab8613049c3a7d1102b210b41dd14271ec16455424899bf97a710c
MD5 9169a15ac8505c35c8c65232df63b76a
BLAKE2b-256 5ec23a9a45f4eef5b2b28f6af7bc39d2326aad9955055e46f4dfdad2f0396c42

See more details on using hashes here.

File details

Details for the file hip_python-6.3.2.540.31-cp311-cp311-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for hip_python-6.3.2.540.31-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 d7aeba696faab23a210c5da73291e37110b472c79bc3dfb7274bd44a981a944c
MD5 4078323daaee837d9feea3971cf15410
BLAKE2b-256 55770964114309e1121f62c4aaff7efcbbb57240e031934eb832f20c7b6d6e74

See more details on using hashes here.

File details

Details for the file hip_python-6.3.2.540.31-cp310-cp310-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for hip_python-6.3.2.540.31-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 da3745fef3bfc2e072c9ab43808f2fa76b0d9fcb193e81e0b8e2af2217c7dc78
MD5 ae4bb759b3645578ed5dad59d47b2d2f
BLAKE2b-256 a71ec1f4ca2c8cb418429135b4b6f6b94e7968953e34f7f6309b3ae7088d160f

See more details on using hashes here.

File details

Details for the file hip_python-6.3.2.540.31-cp39-cp39-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for hip_python-6.3.2.540.31-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 e8dfd72e14b02153bcc89bdc08582ac081ae1a39687c7f7a9dd84799448f45c9
MD5 2cb32d05bd6f633a2e81fb02d9cbfe41
BLAKE2b-256 155f16fc17acc50f87e0d4c5a430ebc8eb85d216a0e7fd209c22c8bbb291713c

See more details on using hashes here.

File details

Details for the file hip_python-6.3.2.540.31-cp38-cp38-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for hip_python-6.3.2.540.31-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 6001076928ff93b5964f6fd924717906bf0c4978b529b6197dc613893119611c
MD5 4e669d4dc638b031b711070eaaf595f0
BLAKE2b-256 fafc587b938cd9c0bcb0defe3ad16d68e2e9ee6b582f068ba4fd981bba888e9e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page