Python Binding for HPX C++ library
Project description
HPyX: Python Bindings for HPX C++ Parallelism Library
Project Overview
HPyX provides Python bindings for the HPX C++ Parallelism Library using Nanobind and leveraging Python 3.13's free-threading capabilities. This project aims to make HPX's powerful parallel processing features accessible to Python developers while achieving optimal performance through true multi-threading.
Status: HPyX is currently in active development as part of a research project at the University of Washington's Scientific Software Engineering Center (SSEC). The project is experimental and APIs may change as we explore optimal integration patterns between Python's free-threading mode and HPX's parallel execution model.
What is HPX?
HPX (High Performance ParalleX) is a C++ Standard Library for Concurrency and Parallelism that implements modern C++ parallelism features defined by the C++ Standard. It provides:
- A unified API for local and remote parallel operations
- Asynchronous execution through futures and dataflow
- Fine-grained task parallelism
- Support for distributed computing
- Performance counter frameworks for runtime adaptivity
Features
- Python Interface: Clean Python API for HPX's parallel algorithms and components
- True Parallel Execution: Leverages Python 3.13's experimental free-threading mode
- High-Performance Bindings: Uses Nanobind for minimal-overhead C++ integration
- Pythonic Design: APIs that follow Python conventions while exposing HPX capabilities
- Comprehensive Testing: Automated testing and benchmarking framework
- Cross-Platform Support: Builds consistently on Linux, macOS, and Windows
Current Development Focus
- Core HPX binding infrastructure
- Python 3.13 free-threading compatibility
- Parallel algorithm implementations
- Performance optimization and benchmarking
- API design and developer experience
Installation and Building
Note: HPyX is currently in active development. Pre-built packages are not yet available. Installation requires building from source using the provided build system.
HPyX uses pixi for environment and dependency management, which provides reproducible builds and handles complex C++ dependencies automatically.
Prerequisites
- Install pixi following the instructions on the pixi documentation
- Python 3.13 built with
--disable-giloption for optimal performance - Modern C++ compiler with C++17 support (GCC 8+, Clang 8+, MSVC 2019+)
Setting up the environment
Clone the repository and navigate to the project directory:
git clone https://github.com/uw-ssec/HPyX.git
cd HPyX
HPyX provides predefined pixi environments (see also docs/CONTRIBUTING.md):
| Environment | Purpose |
|---|---|
py313t |
Default development (Python 3.13 free-threading) + editable HPyX install |
test-py313t |
Run test suite (pytest + test deps) |
build-py313t |
Build distributions (sdist / wheel + verification) |
benchmark-py313t |
Performance benchmarking (pytest-benchmark etc.) |
docs |
Documentation authoring (MkDocs + plugins) |
linting |
Lint / formatting (pre-commit) |
py313t-src |
Advanced: build HPX from source & test against it |
To create and activate an environment:
pixi shell -e py313t
Note: Environments that include the hpyx feature (e.g. py313t) automatically install HPyX in editable mode.
Available Tasks (High-Level)
pixi run get-python-version # Show Python version
pixi run test # Run full test suite
pixi run benchmark # Run benchmarks
pixi run lint # Lint & format (pre-commit hooks)
pixi run build # Build sdist + wheel
Underlying / environment-scoped examples:
pixi run -e build-py313t build-sdist
pixi run -e build-py313t build-wheel
pixi run -e build-py313t build-wheel-and-test # build wheel, install, print versions
pixi run -e benchmark-py313t run-benchmark keyword_expression=for_loop
pixi run -e benchmark-py313t run-benchmark keyword_expression=hpx_linalg
Building the Package
High-level aggregated build:
pixi run build # Builds sdist (dist/) + wheel (wheelhouse/)
Granular control:
pixi run -e build-py313t build-sdist
pixi run -e build-py313t build-wheel
pixi run -e build-py313t build-wheel-and-test
Running tests
To run the test suite:
pixi run test
Performance Benchmarking
Run all benchmarks:
pixi run benchmark
Filter by keyword (raw task):
pixi run -e benchmark-py313t run-benchmark keyword_expression=for_loop
pixi run -e benchmark-py313t run-benchmark keyword_expression=hpx_linalg
Benchmark configuration highlights: group-by function, warmup enabled, minimum 3 rounds, time unit milliseconds.
Troubleshooting Test Issues
If you encounter errors related to duplicate library paths on macOS/Unix systems, such as:
duplicate LC_RPATH '@loader_path'
Run the library path fix task (Unix):
pixi run -e py313t fix-lib-paths
This script will automatically detect and remove duplicate RPATH entries from dynamic libraries in your conda environment, which can occur due to dependency conflicts between conda packages.
Code quality and linting
To run code quality checks and formatting:
pixi run lint
Additional utilities
Check the Python version in your current environment:
pixi run get-python-version
Documentation Development
Live docs server:
pixi run -e docs start
Simulate Read the Docs build (maintainers):
pixi run -e docs rtd-publish
Development
HPyX uses pixi for reproducible development environments and dependency management. This approach ensures consistent builds across different platforms and simplifies the complex build process for HPX and its dependencies.
Development Environment
See the environment table above (duplicated list removed for brevity).
Build Process
The build system integrates several complex components:
- HPX C++ Library: Conda package or optional source build via
py313t-srcenvironment - Nanobind Integration: Efficient Python–C++ bindings with minimal overhead
- Free-Threading Support: Optimizations for Python 3.13's experimental free-threading mode
- Cross-Platform Support: Consistent builds on Linux, macOS, and Windows
Technical Approach
Our development approach consists of:
- Core Binding Layer: Low-level bindings for HPX C++ core functionality using Nanobind
- High-Level Python API: A Pythonic interface that wraps the core bindings
- Free-Threading Integration: Mechanisms to ensure the bindings work optimally with Python's free-threading mode
- Comprehensive Testing: Benchmarks + functionality tests to verify behavior
Advanced: Building HPX From Source
For testing unreleased HPX versions or allocator variants use the py313t-src environment:
pixi shell -e py313t-src
Key tasks:
# Build specific HPX (defaults: tag=v1.11.0-rc1 malloc=system build_dir=build)
pixi run build-hpx tag=v1.11.0-rc1 malloc=system
# Install latest RC HPX + reinstall HPyX (all extras)
pixi run install-latest-lib
# Install stable HPX + reinstall HPyX (all extras)
pixi run install-stable-lib
Arguments:
- tag – HPX git tag
- malloc – allocator (system default)
- build_dir – build directory name
Helper tasks (implicit): _fetch-hpx-source, _pip-install-all, _restore-submodule.
Contributing
We welcome contributions to HPyX! Whether you're interested in fixing bugs, adding new features, improving documentation, or helping with testing, your contributions are valuable.
Please see our Contributing Guide for detailed information on:
- Setting up the development environment with pixi
- Understanding the build system and HPX integration
- Running tests and benchmarks
- Code quality standards and linting
- Pull request process
For a quick start:
-
Install pixi for environment management
-
Clone the repository and activate the development environment:
git clone https://github.com/uw-ssec/HPyX.git cd HPyX pixi shell -e py313t
-
(Optional) Reinstall in editable mode (already done in
py313t):pip install -e '.[all]'
-
Run tests to verify your setup:
pixi run test
You can also explore other development tasks:
pixi run benchmark # Run performance benchmarks
pixi run lint # Check code quality and formatting
pixi run build # Build distribution packages
Thanks to our contributors so far!
License
HPyX is licensed under the BSD 3-Clause License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hpyx-2025.8.28.tar.gz.
File metadata
- Download URL: hpyx-2025.8.28.tar.gz
- Upload date:
- Size: 244.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce582d60d0ad50256fc8f6666d5c30be9f15af8936a8711c5f2f03404caf2958
|
|
| MD5 |
99e9481e38ced059550cd8c482f7ec39
|
|
| BLAKE2b-256 |
4e20c4ac767b4394de2240d49a7214899585a2faa030bbe024d130633992663c
|
Provenance
The following attestation bundles were made for hpyx-2025.8.28.tar.gz:
Publisher:
cd.yml on uw-ssec/HPyX
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hpyx-2025.8.28.tar.gz -
Subject digest:
ce582d60d0ad50256fc8f6666d5c30be9f15af8936a8711c5f2f03404caf2958 - Sigstore transparency entry: 446630055
- Sigstore integration time:
-
Permalink:
uw-ssec/HPyX@7b736d40dd9fa05e2804f2030c331b2927e44a0c -
Branch / Tag:
refs/tags/v2025.8.28 - Owner: https://github.com/uw-ssec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@7b736d40dd9fa05e2804f2030c331b2927e44a0c -
Trigger Event:
release
-
Statement type:
File details
Details for the file hpyx-2025.8.28-cp313-cp313t-win_amd64.whl.
File metadata
- Download URL: hpyx-2025.8.28-cp313-cp313t-win_amd64.whl
- Upload date:
- Size: 137.4 kB
- Tags: CPython 3.13t, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a5e018e841f3a65c9f42baed0973d69904aea5c3f83583079839cb655af54b1
|
|
| MD5 |
35fbd905ecd1fe51ebfb7c47ee67a7d1
|
|
| BLAKE2b-256 |
8c8bf3573ce0892f0c93d67362c3adf79d990cddede95ae60b5978260428db3f
|
Provenance
The following attestation bundles were made for hpyx-2025.8.28-cp313-cp313t-win_amd64.whl:
Publisher:
cd.yml on uw-ssec/HPyX
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hpyx-2025.8.28-cp313-cp313t-win_amd64.whl -
Subject digest:
8a5e018e841f3a65c9f42baed0973d69904aea5c3f83583079839cb655af54b1 - Sigstore transparency entry: 446630105
- Sigstore integration time:
-
Permalink:
uw-ssec/HPyX@7b736d40dd9fa05e2804f2030c331b2927e44a0c -
Branch / Tag:
refs/tags/v2025.8.28 - Owner: https://github.com/uw-ssec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@7b736d40dd9fa05e2804f2030c331b2927e44a0c -
Trigger Event:
release
-
Statement type:
File details
Details for the file hpyx-2025.8.28-cp313-cp313t-manylinux_2_39_x86_64.whl.
File metadata
- Download URL: hpyx-2025.8.28-cp313-cp313t-manylinux_2_39_x86_64.whl
- Upload date:
- Size: 5.1 MB
- Tags: CPython 3.13t, manylinux: glibc 2.39+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a4fc131cfcdf531e5a2a7d41a83774cec607195975c3cc31f2489f23c55acef
|
|
| MD5 |
605049e1aaf65ab5eb5bcf6ce909008f
|
|
| BLAKE2b-256 |
63291d7b2992c99f7fc47aa8121689aa1232ede18482bffc2b26759de206e1ab
|
Provenance
The following attestation bundles were made for hpyx-2025.8.28-cp313-cp313t-manylinux_2_39_x86_64.whl:
Publisher:
cd.yml on uw-ssec/HPyX
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hpyx-2025.8.28-cp313-cp313t-manylinux_2_39_x86_64.whl -
Subject digest:
9a4fc131cfcdf531e5a2a7d41a83774cec607195975c3cc31f2489f23c55acef - Sigstore transparency entry: 446630087
- Sigstore integration time:
-
Permalink:
uw-ssec/HPyX@7b736d40dd9fa05e2804f2030c331b2927e44a0c -
Branch / Tag:
refs/tags/v2025.8.28 - Owner: https://github.com/uw-ssec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@7b736d40dd9fa05e2804f2030c331b2927e44a0c -
Trigger Event:
release
-
Statement type:
File details
Details for the file hpyx-2025.8.28-cp313-cp313t-macosx_15_0_arm64.whl.
File metadata
- Download URL: hpyx-2025.8.28-cp313-cp313t-macosx_15_0_arm64.whl
- Upload date:
- Size: 105.5 kB
- Tags: CPython 3.13t, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d9b16e029d787d0f31f4f59fdbec2b5111da2ecd70b7cf8489e6f2c8a75f21d
|
|
| MD5 |
3623f3fb228092906903ff40a0a9e9ba
|
|
| BLAKE2b-256 |
01b12626cec908c9332ff6a65272739eb1e5e9c209f34925e10584dd84e1cf48
|
Provenance
The following attestation bundles were made for hpyx-2025.8.28-cp313-cp313t-macosx_15_0_arm64.whl:
Publisher:
cd.yml on uw-ssec/HPyX
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hpyx-2025.8.28-cp313-cp313t-macosx_15_0_arm64.whl -
Subject digest:
4d9b16e029d787d0f31f4f59fdbec2b5111da2ecd70b7cf8489e6f2c8a75f21d - Sigstore transparency entry: 446630129
- Sigstore integration time:
-
Permalink:
uw-ssec/HPyX@7b736d40dd9fa05e2804f2030c331b2927e44a0c -
Branch / Tag:
refs/tags/v2025.8.28 - Owner: https://github.com/uw-ssec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@7b736d40dd9fa05e2804f2030c331b2927e44a0c -
Trigger Event:
release
-
Statement type:
File details
Details for the file hpyx-2025.8.28-cp313-cp313t-macosx_14_0_arm64.whl.
File metadata
- Download URL: hpyx-2025.8.28-cp313-cp313t-macosx_14_0_arm64.whl
- Upload date:
- Size: 105.5 kB
- Tags: CPython 3.13t, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
215387583ba4864f8a87281b7b9c1970464ac1dff45161e7acf36c91aab443ab
|
|
| MD5 |
184221c1800e0d7327932eb57984513e
|
|
| BLAKE2b-256 |
cfd28142df39bc52f04f1dc6ab0f4c54e5b88d41240c01dc2aff5482c93930f5
|
Provenance
The following attestation bundles were made for hpyx-2025.8.28-cp313-cp313t-macosx_14_0_arm64.whl:
Publisher:
cd.yml on uw-ssec/HPyX
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hpyx-2025.8.28-cp313-cp313t-macosx_14_0_arm64.whl -
Subject digest:
215387583ba4864f8a87281b7b9c1970464ac1dff45161e7acf36c91aab443ab - Sigstore transparency entry: 446630067
- Sigstore integration time:
-
Permalink:
uw-ssec/HPyX@7b736d40dd9fa05e2804f2030c331b2927e44a0c -
Branch / Tag:
refs/tags/v2025.8.28 - Owner: https://github.com/uw-ssec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@7b736d40dd9fa05e2804f2030c331b2927e44a0c -
Trigger Event:
release
-
Statement type:
File details
Details for the file hpyx-2025.8.28-cp313-cp313t-macosx_13_0_x86_64.whl.
File metadata
- Download URL: hpyx-2025.8.28-cp313-cp313t-macosx_13_0_x86_64.whl
- Upload date:
- Size: 109.9 kB
- Tags: CPython 3.13t, macOS 13.0+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c8e8c6774addd9c2c61853d7b5c9948f9a96e0b857bba874bdde9d99bbbb3bb
|
|
| MD5 |
8382885b75dc123f84b0ff6762b9040b
|
|
| BLAKE2b-256 |
0694a4a504a889ba5566d9f5f8e286b7bf0275cc479bdc6d65cd6a6303c43c2b
|
Provenance
The following attestation bundles were made for hpyx-2025.8.28-cp313-cp313t-macosx_13_0_x86_64.whl:
Publisher:
cd.yml on uw-ssec/HPyX
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hpyx-2025.8.28-cp313-cp313t-macosx_13_0_x86_64.whl -
Subject digest:
6c8e8c6774addd9c2c61853d7b5c9948f9a96e0b857bba874bdde9d99bbbb3bb - Sigstore transparency entry: 446630147
- Sigstore integration time:
-
Permalink:
uw-ssec/HPyX@7b736d40dd9fa05e2804f2030c331b2927e44a0c -
Branch / Tag:
refs/tags/v2025.8.28 - Owner: https://github.com/uw-ssec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@7b736d40dd9fa05e2804f2030c331b2927e44a0c -
Trigger Event:
release
-
Statement type: