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.2.555.40-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.2.555.40-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.2.555.40-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.2.555.40-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.2.555.40-cp39-cp39-manylinux_2_17_x86_64.whl (67.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

File details

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

File metadata

File hashes

Hashes for hip_python-6.4.2.555.40-cp313-cp313-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 a8a3891264dd87dac89601ddaa87c89e134c1e34bb5669abe268769657e2a04b
MD5 b00678668abb14a7f144b0634796620f
BLAKE2b-256 b9db23d3ab78cb183fc11c8438fe647afa5a7523ddf2a7fbcc4575da7e14c9eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.4.2.555.40-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 a004aeaad52f2ec50dc642732e4312cf4d95b03ed5ddbcb3c13a6a9cd053f7d0
MD5 9efa50b6fe8dae9e06471f56c3685789
BLAKE2b-256 27ecf7d4b5cd7e9966c8af6a87238ff6039c87ebb18263d971efe25c319ba7e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.4.2.555.40-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 4d407287c1e6852ec9a94be4910298bfdbc1050159ef0871d2196fdff44366d3
MD5 fddda981d065749ef9c78aee9385e4cf
BLAKE2b-256 adea8ebc442a2d572586f3e95b6af93e79528c453ce91cc95ee57d28ef507c39

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.4.2.555.40-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 203148bc92c3731a71a1e5db6c348ad294e56fba29d1ec835305299fb8c0176f
MD5 662ce714af2bbe6b8d207a1734e07e2a
BLAKE2b-256 7a40e4f16e55738c9ac50ca2f707e5cb3bac013c35622e5f1a3fba3b461bcb75

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.4.2.555.40-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 fc6292a9730eecbcba04e00818b9bf113bdfde1480d83fdff3ecbd8a34e9edeb
MD5 a2254a9ad3dd852a4e12c11e34f71900
BLAKE2b-256 7740c90943493b2a4799d3259d3f3338511dbe009e6d33c6ec41fb44bfb6e06a

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