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.2.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.2.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.2.555.40-cp311-cp311-manylinux_2_17_x86_64.whl (60.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

hip_python-7.0.2.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.2.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.2.555.40-cp313-cp313-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for hip_python-7.0.2.555.40-cp313-cp313-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 e0bfc78ace22de65983f906d7d1d8a3d1a8554486d149c2f2df0bf0cca8f181e
MD5 91a646f2f1ff3831282c2f1b3cc236ba
BLAKE2b-256 81118d2c6b4da7ab5eac920d4d89340d36db7af1f8777194ca97d3749c87b179

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-7.0.2.555.40-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 917b1472f9e3c2d003aa427eea763e9fff2960765fc37f036cd3dc45d839fa14
MD5 392d505b892e22ddaa0259dff7902b85
BLAKE2b-256 5c62c1f9452bc8cf777f027cf11afabef83dd2b4d0e9e2afdaf56c9e808e42b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-7.0.2.555.40-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 fea8929de4e26b8a772d2ee4c136119f28d09a4934a0ffbb21d3262cf13e0f35
MD5 c6e8a4882f6e70c0f8335e633b225fd3
BLAKE2b-256 971dfe9378af65d32be165e52d90a0e88d274d403c246efc37b2d849b4d8572a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-7.0.2.555.40-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 2b8e72d26ea3384808b12e0c0ca656bce8f50d1b2f64ed3eabfe72c7e6beedb0
MD5 14df1dd6e14f858e001a8b5fe90ec043
BLAKE2b-256 bafd4ade74b9a5c6de0e1be77389d5825a508fb4c25154ba13d7fb89920db7fe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-7.0.2.555.40-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 454a2fdaa9380af43326feeb3e2805f7ec66823c3d61c7f60029282fa2071b6d
MD5 d00f0f208c71d6f57be99e357303bc52
BLAKE2b-256 bfe11ebebe03b9d3ebb4ab7994061c3f1d679e1546c260d6ee4216d0c1976a35

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