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.

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-6.3.3.540.31-cp313-cp313-manylinux_2_17_x86_64.whl (67.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

hip_python-6.3.3.540.31-cp312-cp312-manylinux_2_17_x86_64.whl (66.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

hip_python-6.3.3.540.31-cp311-cp311-manylinux_2_17_x86_64.whl (69.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

hip_python-6.3.3.540.31-cp310-cp310-manylinux_2_17_x86_64.whl (66.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

hip_python-6.3.3.540.31-cp39-cp39-manylinux_2_17_x86_64.whl (66.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

hip_python-6.3.3.540.31-cp38-cp38-manylinux_2_17_x86_64.whl (67.3 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

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

File metadata

File hashes

Hashes for hip_python-6.3.3.540.31-cp313-cp313-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 5c0da34b3872d31f8bf2f857bcdedfb84f9740c3fd3e1ace026fde65219815d8
MD5 e6fc2fd0ba18e26ec2688505cf7d87d1
BLAKE2b-256 a8c46362742fc5b354bc3669f80d9ca36523a3e41a1cc7a1f1796579e102e5bc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.3.3.540.31-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 7f9dbfbda4baf7e11a3eb3ddf728622880c79f3c525c68161566c9e471da4f4b
MD5 eb90550ae75a7a4fed30c76a32450182
BLAKE2b-256 7c48c8b6db57b381642da8d4d2b67026dd7cdd9990c5fb998e5c8b9274b51af3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.3.3.540.31-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 6ce1b96f63f3427b4433428505c3c2d7b3959a253751decfe1ccdc05407d8c0d
MD5 3fc8a116072a92c3632355c676be3c86
BLAKE2b-256 3de2a529cb8af546b152b31b3d5c1ceb997624e0c27188ed55d25330cbb87041

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.3.3.540.31-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 77b54fa241ddd565ad4d39f927633c75a69708762987f77392657692b247b24d
MD5 152781be51515a6b02938d6134aabf7d
BLAKE2b-256 c61a65c773c9ff621b8c1cc99090f8f05c5ca3ab6c1cb9c271d9f52f23d659a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.3.3.540.31-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 254aba3a63a5f8910606539e59de710845515e0c2fb2bdcbbc2dc4c18754dfbc
MD5 2585b025da5a37963170ffe5bc9cf9b2
BLAKE2b-256 cafc7abc067c96373779ca6277c8e2174d7bf90216409315921ea45a3b1639fb

See more details on using hashes here.

File details

Details for the file hip_python-6.3.3.540.31-cp38-cp38-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for hip_python-6.3.3.540.31-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 994ef7f5b04be6c9544ef943eeac7cc282fc9583f621bfd615d18b7a812ef9ce
MD5 73a58b29640dcb80e630f2554b36281c
BLAKE2b-256 591124b43853bdfce86659b69b55e8afbe7bc2ef155bcce044dd2c5ad70c79d3

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