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.0.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.0.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.0.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.0.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.0.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.0.555.40-cp313-cp313-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for hip_python-7.0.0.555.40-cp313-cp313-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 2e0394b83635265694bb26868d361a005d088a8eaab0759687700ad441ac2c7b
MD5 9a265b880ec1470184ffacb47283c683
BLAKE2b-256 595b350533a26999bab9ccc9b2b2bc41cd268a350d1ef573a27efbd073e1e7b0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-7.0.0.555.40-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 741ace2ef199fbb264b168970eaecdedfc02bbd1556d7c65210e892c908270c6
MD5 73b94071d76d277fd9b38669a34ebba9
BLAKE2b-256 381c898a90880a8559dbf4fc52c56bade1f17bc6fbfa769af7faf6acc7398b3b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-7.0.0.555.40-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 ff46965b60d7516a903ee51dba159b826f2920afaffbcb8c2086555decce6958
MD5 2b3b8e80134f04dc4e04232dc2b1379f
BLAKE2b-256 c111953a2be826ba4c9dc49ef72095eaa3db929e1aae444459cfd459c2bfb106

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-7.0.0.555.40-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 5090d2036ed66281aba0be07e9370c9b5d10ff5ca5344e18ae000fab2bcf725c
MD5 a60aa0274b02eeeb4d0ebdca5ba8c215
BLAKE2b-256 466428c9523a86f5b0d3895e38147df13ca7109037447630196d872624b2f003

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-7.0.0.555.40-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 0fb53ce673a03bec3592e2a069ade94d7bf99bfbebca3183a2951bad5ac416b9
MD5 d6c9f5462c8cd04b6802de7cc54bc0f2
BLAKE2b-256 7333890241287789a589efe73bcad01624365516a612518856d18796c82340fa

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