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.1.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.1.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.1.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.1.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.1.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.1.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.1.540.31-cp313-cp313-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for hip_python-6.3.1.540.31-cp313-cp313-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 8d345cdb0b616ade8dfd23e23ffcfb022ab6e16d02a3a1f7ccf1009f6ac90939
MD5 0cae6eda7543afdeba9d5b51cdcfec57
BLAKE2b-256 53019c73995929db77157be527d6891716ea26df2112baa7ca518ff3a8f39f58

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.3.1.540.31-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 0b47647958ebe9b5d8b6b9ff68402b4c13ff8a6a5ff1a9ece988e4c421b2f7a3
MD5 acc9e3505545788db4b8ae4ab0a1d136
BLAKE2b-256 e4b83422fde42966d29082af89c1467d41739572ce3717d01c4fba979de74547

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.3.1.540.31-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 e7e17d68538bc16c7cf7eea07d90cdb485daf8b4e306354308a4dfa703737355
MD5 f1bff2cd1c6c9dfcbcfad05c8abae6ca
BLAKE2b-256 c09584badd96b33f1e38b8b5872880acef43dc690b7ea7f3523cd23c97491a41

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.3.1.540.31-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 6eed10be953309528216cd5fbd8f89cd092f10fc6c493125ad9294765bf7b0ac
MD5 779ec7248af9be2f34b6f97d42bcce49
BLAKE2b-256 61c63c827d3b8ac81685867dc0f6ae5cc0e9256be80b1a9eede4081f5637d605

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.3.1.540.31-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 586dc33d195ed36c2c4b37e9a6995cb2911b55b70bf7917ee7b4c76a53bea3e6
MD5 c7eb59758b4e1ae32c4347eb07a90d18
BLAKE2b-256 d31e567a366270ce36925e6dc1653c1d6c29e1d90a40d3d2d0ed5d5bc8c00402

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.3.1.540.31-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 1f60e5265b233f895e4952fdb627249dd0da5a330414adfbdcb5ff0a86aeed9b
MD5 f559a88fc77abe6ef25e3ce1e846e748
BLAKE2b-256 579d6a265c85c242a87881e01ce458dc72a25d8408f39a900564b8d17eefc1a1

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