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.

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.4.1.552.39-cp313-cp313-manylinux_2_17_x86_64.whl (68.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

hip_python-6.4.1.552.39-cp312-cp312-manylinux_2_17_x86_64.whl (67.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

hip_python-6.4.1.552.39-cp311-cp311-manylinux_2_17_x86_64.whl (70.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

hip_python-6.4.1.552.39-cp310-cp310-manylinux_2_17_x86_64.whl (67.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

hip_python-6.4.1.552.39-cp39-cp39-manylinux_2_17_x86_64.whl (67.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

hip_python-6.4.1.552.39-cp38-cp38-manylinux_2_17_x86_64.whl (68.2 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

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

File metadata

File hashes

Hashes for hip_python-6.4.1.552.39-cp313-cp313-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 746226812753e8c585e4f2725b6129f77d7827c68047e029666864656da830a9
MD5 97ba09c401ca6a6ac9c5dd41be9212e3
BLAKE2b-256 84d8a8675a9a1639c06acee664598a27427250c7b6f93d71009f8896869a6d68

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.4.1.552.39-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 bec02b732083c88dc4165e2ce8c48126304d7f473c74dc0f04d73f681b87d513
MD5 500b45b0560dbf72688deb2cb459c0a3
BLAKE2b-256 378ea37388ef7de093d417849b25f1eed4f9efa6ee3b8f52e65977d86df707a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.4.1.552.39-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 e8b77a316a3870df53664438188b260a5785240851ecfbf90a38c52e621256f0
MD5 7a6b75d9b065b07bfaf8fda1855e41fa
BLAKE2b-256 8eddcda8ad95409cec89eb419b579215f371002e50fb510cfb12ff5b1b682cad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.4.1.552.39-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 78e46fc0f2e60d23e6b5de4f734fbdf773daa6a8dff10bba08769c3554f1e3ec
MD5 48ca549ba3fdb99064078985fc5716bd
BLAKE2b-256 b426becbdd7589271efb8ebfe285cd31b4c40c78e29b940ef30bc5df86cf5195

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.4.1.552.39-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 8c3145ffe7457f414e8e2e955c886fbe47a63770c534f0303cf094303112ce33
MD5 dc288eeeb00c524801d2538f4ca7e626
BLAKE2b-256 37ed3c93876a4c4c882526e67a89de18f534fa39d2cade5f562682a6f000fe27

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.4.1.552.39-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 f554abfd30330678fc55caca976fa30c677cab4b2a4ce27f9268a68b992a7796
MD5 f57dfbd9440b262a6c653c32a88c3b97
BLAKE2b-256 383fa35a550f5de9b3385d23c80ba673d5f3eb0f73d0081894f42bcabdb5be24

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