Starway UCX P2P communication lib.
Project description
Starway
Starway aims to be an ultra-fast communication library, which features:
- Zero Copy, supports sending from pointer and receiving into pre-allocated buffer.
- RDMA support, by utilizing OpenMPI/OpenUCX for transportation.
- Ease of use, generally should work out of the box, and don't require much configuration efforts.
- Full-duplex, asynchronous API.
Current Python alternatives are lacking core features:
- ZeroMQ, no support for RDMA.
- MPI, hard to use, hard to setup environment properly.
Installation
Starway depends on OpenUCX, which must be linked dynamically. There are two options:
- Install OpenUCX system-wide, or whatever method you like as long as it can be found dynamically.
- Install
libucx-cu12wheel package, which containslibucx.sofiles that can be loaded by Starway during initialization.
We don't add libucx-cu12 as Starway Python dependency by default, but generally you can install it on your cluster machines as a fallback option: when libucx cannot be found in system, it would look for wheel installation.
You can use environment variable to control System/Wheel preference:
import os
os.environ["STARWAY_USE_SYSTEM_UCX"] = "false" # defaults to true
import starway # now we will use libucx-cu12 pypi wheel package, while falling back to system if not found
Full-Duplex Communication
Starway now supports full-duplex communication, allowing for simultaneous, two-way data exchange between the client and server. This feature significantly improves the library's responsiveness and efficiency in handling real-time data streams.
Usage
Here's an example of how to use the full-duplex communication feature:
import asyncio
import time
import numpy as np
from starway import Client, Server
async def tester():
server = Server("127.0.0.1", 19198)
client = Client("127.0.0.1", 19198)
# Client to Server
send_buf_c2s = np.arange(10, dtype=np.uint8)
recv_buf_c2s = np.empty(10, dtype=np.uint8)
# Server to Client
send_buf_s2c = np.arange(20, dtype=np.uint8)
recv_buf_s2c = np.empty(10, dtype=np.uint8)
# Wait for client to connect
while not (clients := server.list_clients()):
time.sleep(0.1)
client_ep = clients[0]
# Perform concurrent send and receive
client_send_future = client.asend(send_buf_c2s, tag=1)
server_recv_future = server.arecv(recv_buf_c2s, tag=1, tag_mask=0xFFFF)
server_send_future = server.asend(client_ep, send_buf_s2c, tag=2)
client_recv_future = client.arecv(recv_buf_s2c, tag=2, tag_mask=0xFFFF)
await asyncio.gather(
client_send_future,
server_recv_future,
server_send_future,
client_recv_future
)
assert np.allclose(send_buf_c2s, recv_buf_c2s)
assert np.allclose(send_buf_s2c, recv_buf_s2c)
asyncio.run(tester())
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 starway-0.4.0.tar.gz.
File metadata
- Download URL: starway-0.4.0.tar.gz
- Upload date:
- Size: 45.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
151daf18dd1d447fa47df6032da3e67cec2f0148def5ff65c198c1a3da96705b
|
|
| MD5 |
5bbbde5dd9bf1578d684bba5f8b8b5e9
|
|
| BLAKE2b-256 |
74da018b68d27428b2637efac98e960bcb0cab11249f98eb71b20e70f5adb351
|
Provenance
The following attestation bundles were made for starway-0.4.0.tar.gz:
Publisher:
wheels.yml on Clouder0/starway
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
starway-0.4.0.tar.gz -
Subject digest:
151daf18dd1d447fa47df6032da3e67cec2f0148def5ff65c198c1a3da96705b - Sigstore transparency entry: 497656156
- Sigstore integration time:
-
Permalink:
Clouder0/starway@556ab1be0f6011a7e501da954750ccdaf75730b1 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/Clouder0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@556ab1be0f6011a7e501da954750ccdaf75730b1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file starway-0.4.0-cp313-cp313-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: starway-0.4.0-cp313-cp313-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 190.8 kB
- Tags: CPython 3.13, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3aab9782a814417f1bc4c454c012cdda5ef3920da065d0f26aa9b4de16cbdb34
|
|
| MD5 |
a31d48bac6b7da7f8718464c62c5f41c
|
|
| BLAKE2b-256 |
7cf7b4c4a714f3b3c84f8256cc7f71da02a4a1dcdfcd965fbfc08b27cd1601fe
|
Provenance
The following attestation bundles were made for starway-0.4.0-cp313-cp313-manylinux_2_34_x86_64.whl:
Publisher:
wheels.yml on Clouder0/starway
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
starway-0.4.0-cp313-cp313-manylinux_2_34_x86_64.whl -
Subject digest:
3aab9782a814417f1bc4c454c012cdda5ef3920da065d0f26aa9b4de16cbdb34 - Sigstore transparency entry: 497656183
- Sigstore integration time:
-
Permalink:
Clouder0/starway@556ab1be0f6011a7e501da954750ccdaf75730b1 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/Clouder0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@556ab1be0f6011a7e501da954750ccdaf75730b1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file starway-0.4.0-cp312-cp312-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: starway-0.4.0-cp312-cp312-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 190.8 kB
- Tags: CPython 3.12, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db3acdd65c41de2acf60ca37b5b0b4f1fe0d4a74acf76d375a84b4562c6354d0
|
|
| MD5 |
4af7b3de03872a492c6e51ee131a8a29
|
|
| BLAKE2b-256 |
6104e613ebb093d25f5348a5f9ab8342a132ddf9d3c835b9ac882e096463c3da
|
Provenance
The following attestation bundles were made for starway-0.4.0-cp312-cp312-manylinux_2_34_x86_64.whl:
Publisher:
wheels.yml on Clouder0/starway
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
starway-0.4.0-cp312-cp312-manylinux_2_34_x86_64.whl -
Subject digest:
db3acdd65c41de2acf60ca37b5b0b4f1fe0d4a74acf76d375a84b4562c6354d0 - Sigstore transparency entry: 497656251
- Sigstore integration time:
-
Permalink:
Clouder0/starway@556ab1be0f6011a7e501da954750ccdaf75730b1 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/Clouder0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@556ab1be0f6011a7e501da954750ccdaf75730b1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file starway-0.4.0-cp311-cp311-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: starway-0.4.0-cp311-cp311-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 191.0 kB
- Tags: CPython 3.11, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ed6341c2bdd6bc8a5127b8e0cc44a9c2c01bf6c496760f6ce9bbc3bc8e93942
|
|
| MD5 |
567e91587350adb5d3bcbde8f91ce1b8
|
|
| BLAKE2b-256 |
2e6d29016dc8d54c29f2ae922855f5deb98e185d18dd9ed449ad367f4f770f9d
|
Provenance
The following attestation bundles were made for starway-0.4.0-cp311-cp311-manylinux_2_34_x86_64.whl:
Publisher:
wheels.yml on Clouder0/starway
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
starway-0.4.0-cp311-cp311-manylinux_2_34_x86_64.whl -
Subject digest:
5ed6341c2bdd6bc8a5127b8e0cc44a9c2c01bf6c496760f6ce9bbc3bc8e93942 - Sigstore transparency entry: 497656211
- Sigstore integration time:
-
Permalink:
Clouder0/starway@556ab1be0f6011a7e501da954750ccdaf75730b1 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/Clouder0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@556ab1be0f6011a7e501da954750ccdaf75730b1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file starway-0.4.0-cp310-cp310-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: starway-0.4.0-cp310-cp310-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 191.3 kB
- Tags: CPython 3.10, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed75d221ff4af847180e92e2739b3f921c04092bd816ae3749def0be80816c09
|
|
| MD5 |
b28fcc45db5953fc65f1c4bbe8cf25b3
|
|
| BLAKE2b-256 |
dd7ab0fe94624885a5891d08086d3773017dc053fe5aee6178047d4e9ecbf62f
|
Provenance
The following attestation bundles were made for starway-0.4.0-cp310-cp310-manylinux_2_34_x86_64.whl:
Publisher:
wheels.yml on Clouder0/starway
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
starway-0.4.0-cp310-cp310-manylinux_2_34_x86_64.whl -
Subject digest:
ed75d221ff4af847180e92e2739b3f921c04092bd816ae3749def0be80816c09 - Sigstore transparency entry: 497656280
- Sigstore integration time:
-
Permalink:
Clouder0/starway@556ab1be0f6011a7e501da954750ccdaf75730b1 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/Clouder0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@556ab1be0f6011a7e501da954750ccdaf75730b1 -
Trigger Event:
release
-
Statement type: