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

File metadata

File hashes

Hashes for hip_python-6.3.0.540.30-cp313-cp313-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 9d11d86c10c438af468c22fd808b1fde6e5bc53707a73e48e15af435bd6762a0
MD5 f88d862cb28e10b96ba106b194f4293c
BLAKE2b-256 4705d3cd0780995b10beefd5f3177ad7bf156be4a0a40a631ef05fae82cc69bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.3.0.540.30-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 2167df4bb63e19c736cc2f70c2c2163f84a6607558bfaba79af885a9ffcb73f6
MD5 b446988f17622c6b553d1b2b9c7dbb1d
BLAKE2b-256 035728af7e7c2209c227d0caa965a225f2879601d23314d6b6d6b5a1008091b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.3.0.540.30-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 48f7b19e88df5043095597bdfaf915c614c2c1c7b5f3b9394f28dfe95fe0638d
MD5 5ec36daf4729a7fed5644de4f9c0d0c1
BLAKE2b-256 8c3b8a79891e33ec4131bed83b61b60f052fe930281a95afb8c087f99b53d12f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.3.0.540.30-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 40c0f4ea37b8894a07e289232ee7318c58b41de26faac0f683addc019beadb71
MD5 f9ed7954f4403dc1539fd51e2e55f97e
BLAKE2b-256 e2db37a9640d391fa2f1f430c5a447a3a821f2cc210e9cb3f71e8409707b1a13

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.3.0.540.30-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 820662354cda9870153552d6bd62e9bc784979b60627344e9aff66f9159957df
MD5 fca6ae1f6beb9777b7662bf339908c6f
BLAKE2b-256 9da8485178419c0bb0a4ff2de33f5f0f80c22086715a973b6ec082cc6daf1f3c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hip_python-6.3.0.540.30-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 b76d23268c35de82d46cbf5464410eb0517ec0be1552881264dfb74802de3259
MD5 2c312b157e03e9ed6d6b68e5411a43d2
BLAKE2b-256 719c17a73e85188261c05cb7ed65f6ec4e1c1490fed9a46b857a86c04d30e0ff

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