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

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

hip_python-7.0.1.555.40-cp312-cp312-manylinux_2_17_x86_64.whl (57.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

hip_python-7.0.1.555.40-cp311-cp311-manylinux_2_17_x86_64.whl (60.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

hip_python-7.0.1.555.40-cp310-cp310-manylinux_2_17_x86_64.whl (57.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

hip_python-7.0.1.555.40-cp39-cp39-manylinux_2_17_x86_64.whl (57.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

File details

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

File metadata

File hashes

Hashes for hip_python-7.0.1.555.40-cp313-cp313-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 1278bc2985ee302c42b44b9cea13e73f69c2b89e80388b11b450f68d04f99d9f
MD5 4844b95691afd70fc56995b17baa05cf
BLAKE2b-256 481b9d892335251b5c5658b8fea13739298d7e33df2834f34958f147aba402ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-7.0.1.555.40-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 3a92e9ddbb7e572f4ac1a12a45bfcb2faac962405d82fed5a6ab4f6de57bdcbe
MD5 0519fcf40030f88fe01ca830476d86f8
BLAKE2b-256 9583314808184c723c63433aa1ba9e8017d31e41cd03496499660792fc24de6e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-7.0.1.555.40-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 3dc7c709f235c2554a1267589a4182403b41e302a250f0b2239ab45a3ed83ff3
MD5 7c646e0cf24e84001d5b40608b77d07d
BLAKE2b-256 b8a7c883f734a0ea13ac33f7e0a02bb916cbfb21cc038a8693a483ed8c5a7e8a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-7.0.1.555.40-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 6e5436ad1706445cbcf85419a316a9ed18d9907b2014c2862121ac1fcb428963
MD5 d5eb38f346d45dcc8f6830dbc695a7e1
BLAKE2b-256 392dd025a8ab3e00ac36dbd12306e07162c0fa70f37fe1adbc988e4e61bdfb90

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-7.0.1.555.40-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 1a82c1b362576ef9d2eac562a81ea3dd5392e732aa522c5568cc438a1ff40693
MD5 aa239ab0686cc3b69ea930be5a8fab61
BLAKE2b-256 30d17ac5fdb2b0ebef36aa12f2c94933d0245865977924418a9f0714b4ff4f4d

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