Skip to main content

Python and Cython bindings for HIP

Project description

NOTICE

This is a fork of `hip-python. It will be removed when the hip-python team uploads to PyPI.

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_fork-6.3.3.540.31.1-cp313-cp313-manylinux_2_17_x86_64.whl (67.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

hip_python_fork-6.3.3.540.31.1-cp312-cp312-manylinux_2_17_x86_64.whl (66.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

hip_python_fork-6.3.3.540.31.1-cp311-cp311-manylinux_2_17_x86_64.whl (69.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

hip_python_fork-6.3.3.540.31.1-cp310-cp310-manylinux_2_17_x86_64.whl (66.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

hip_python_fork-6.3.3.540.31.1-cp39-cp39-manylinux_2_17_x86_64.whl (66.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

hip_python_fork-6.3.3.540.31.1-cp38-cp38-manylinux_2_17_x86_64.whl (67.4 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

Details for the file hip_python_fork-6.3.3.540.31.1-cp313-cp313-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for hip_python_fork-6.3.3.540.31.1-cp313-cp313-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 f42f82d551f79ce661ef428ce3db1fc3e466f62db4ad365e0474a38f8b68386f
MD5 9f8b0bf6b06330463dea08399fa9d54d
BLAKE2b-256 f5bdfafbbc637ad13ffb278296a2cb0df00f88bab6ae22ca828ef43d5b1b5176

See more details on using hashes here.

File details

Details for the file hip_python_fork-6.3.3.540.31.1-cp312-cp312-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for hip_python_fork-6.3.3.540.31.1-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 f7cd1e7992fa16c9d749bebfec7df7cd66f899a7e997605630c1d2af0be913c3
MD5 30ac204535ae00e5e00e1bb096b82163
BLAKE2b-256 c2d3dbdbc3bc182ca73361ff6ee946d60ed1639a0bce08f680e4745bb2af8cb6

See more details on using hashes here.

File details

Details for the file hip_python_fork-6.3.3.540.31.1-cp311-cp311-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for hip_python_fork-6.3.3.540.31.1-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 90972bd47589d99b004b3c6c268ceb9b7a2040978e89d6eff51c8b0b93f7e103
MD5 38530604d3c337fb3598dd7192d5898d
BLAKE2b-256 a944ef5b2bb994f09644ed3b94d59cdefc3e2220b097f690d54809f654e7e4fa

See more details on using hashes here.

File details

Details for the file hip_python_fork-6.3.3.540.31.1-cp310-cp310-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for hip_python_fork-6.3.3.540.31.1-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 455bc733d0726a122801ba200f0b98ce358bfd0fb17557b3a57deee70af14da0
MD5 8d10c60c108723889ab06c506cd03562
BLAKE2b-256 9ed8080f84c6dbbe41ac913e86bde794e87e2c386dad213e4aa23d7ae00d6d17

See more details on using hashes here.

File details

Details for the file hip_python_fork-6.3.3.540.31.1-cp39-cp39-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for hip_python_fork-6.3.3.540.31.1-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 b685eacd09635fa6dbb167b547b65195ae7c48de4fd635f19392a2661215e028
MD5 a80277f5e727f7e960fee4c95fcf277b
BLAKE2b-256 c51efde92360453c6f4902dabce498b94575005a356b2ebea8c771a3b110c9dc

See more details on using hashes here.

File details

Details for the file hip_python_fork-6.3.3.540.31.1-cp38-cp38-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for hip_python_fork-6.3.3.540.31.1-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 b7ca6ee0597f58305af823d0778723072b07aa3fb251450e078c9b9ed3f32946
MD5 0c1ccab7ee4c57b275d484b3b4bd7479
BLAKE2b-256 f8064bb351b7795932b45fb37f23d202613ecee36c022583d28eccfdccdb576d

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