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.3.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.3.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.3.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.3.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.3.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.3.555.40-cp313-cp313-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for hip_python-6.4.3.555.40-cp313-cp313-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 aadd3de42eb2be37b30ebd6b0cde45b59692d93768ae74a1773dafaea5d54f84
MD5 c87e7590c4844a29df7992e05659918b
BLAKE2b-256 bfa4fa6ce61ccee3391683e271461b3b384083466150d7a51407497dbe264454

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.4.3.555.40-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 59dbba18783579a1200eb4ef689a35e3ee85dd766eebd6cf551f5acc0fe5be6c
MD5 91650dc84609c30d8361a5a08e84aa94
BLAKE2b-256 d1e71e07352332bffc4c5f867ec51a6c4f251d91fb6a521a31b47844d171ec5e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.4.3.555.40-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 c1b16893565e730db46d305f10ee74eaa25d49d105f4d065fa09ee4e14d83058
MD5 f7f26cfaa8b935a876d123ce5b3dd807
BLAKE2b-256 2855838272a61a5f3cdd7f4c04473d0d9428acd447cb138e1a9bcbebeef4ad27

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.4.3.555.40-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 34b7e5ccf8fdfd177309370e84726491145097b3a7cbb4d7837965fcea83f64c
MD5 3f263afba8a826c14acf0824008e100a
BLAKE2b-256 d0440a0c62b384f9d636c7c81dbb0cfe98433ca6ef45fab6f962e690bb3d4a7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.4.3.555.40-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 e057639bd4bafadd0ecfe35d101e87b0399cad8b6dfb1a13bd814135fd574b45
MD5 c0708a46888a648ea8b2d1cbf14657ff
BLAKE2b-256 57abc81115c472db3f0d66ec62efd1f736f4c59d3c011283d57ed5fb63180d10

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