Skip to main content

Starway UCX P2P communication lib.

Project description

Starway

Starway aims to be an ultra-fast communication library, which features:

  1. Zero Copy, supports sending from pointer and receiving into pre-allocated buffer.
  2. RDMA support, by utilizing OpenMPI/OpenUCX for transportation.
  3. Ease of use, generally should work out of the box, and don't require much configuration efforts.
  4. Full-duplex, asynchronous API.

Current Python alternatives are lacking core features:

  1. ZeroMQ, no support for RDMA.
  2. MPI, hard to use, hard to setup environment properly.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

starway-0.2.3.tar.gz (36.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

starway-0.2.3-cp313-cp313-manylinux_2_34_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

starway-0.2.3-cp312-cp312-manylinux_2_34_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

starway-0.2.3-cp311-cp311-manylinux_2_34_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

starway-0.2.3-cp310-cp310-manylinux_2_34_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

File details

Details for the file starway-0.2.3.tar.gz.

File metadata

  • Download URL: starway-0.2.3.tar.gz
  • Upload date:
  • Size: 36.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for starway-0.2.3.tar.gz
Algorithm Hash digest
SHA256 027c10db20a73830e24a097a33f6bb72ddc6e7ae0831badce4e83dc8335d228d
MD5 b94aa219952a4968af595d8ed0829a61
BLAKE2b-256 3582d9c813b8d5f52c6532c59991f9e73b44048d4ff7acff6e01218fd48a1226

See more details on using hashes here.

Provenance

The following attestation bundles were made for starway-0.2.3.tar.gz:

Publisher: wheels.yml on Clouder0/starway

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file starway-0.2.3-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for starway-0.2.3-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 6cfed38ba8b87d2f16c6fa187c4f2d6ee2653d48b460e839d78b477a66dc15cb
MD5 8d8cb0c9b9489349a68fb7a6a3f7c650
BLAKE2b-256 6a5807ef1ae55435d5ba31492201d78e14b4aae2b621f1c9aca7fe416da22c35

See more details on using hashes here.

Provenance

The following attestation bundles were made for starway-0.2.3-cp313-cp313-manylinux_2_34_x86_64.whl:

Publisher: wheels.yml on Clouder0/starway

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file starway-0.2.3-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for starway-0.2.3-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ba13c4e928e7be16423664fbc937bf8182f94fabfdde6998d8a4427b14a59eaa
MD5 45c008232be419c0b403c6ff33ac5762
BLAKE2b-256 2ea8a018dd3ddb3a1200d3f158282c7af4e4a1bfb82848e12096b32367eb9d04

See more details on using hashes here.

Provenance

The following attestation bundles were made for starway-0.2.3-cp312-cp312-manylinux_2_34_x86_64.whl:

Publisher: wheels.yml on Clouder0/starway

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file starway-0.2.3-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for starway-0.2.3-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 67362cd0657e779c05bbb15d699792a4c5ccb1597bc52284979ed7c66e99faf6
MD5 a4a3ea34925a4c6176888d92a1ba5a0c
BLAKE2b-256 a296bf4f460af6232c47a832d3354e0dcda3b50c82fb903df07f4b079ab18224

See more details on using hashes here.

Provenance

The following attestation bundles were made for starway-0.2.3-cp311-cp311-manylinux_2_34_x86_64.whl:

Publisher: wheels.yml on Clouder0/starway

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file starway-0.2.3-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for starway-0.2.3-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 a7135d77f3a04a4897e313a84c64eee948589e06dbb22ebaa586c6fdb18cb073
MD5 a1d8616c7ecf9b18d823cf685406e13f
BLAKE2b-256 91cbdd8d29c2075ee3463076d0f568253c1829637deb1c49ba4fc6be0773093d

See more details on using hashes here.

Provenance

The following attestation bundles were made for starway-0.2.3-cp310-cp310-manylinux_2_34_x86_64.whl:

Publisher: wheels.yml on Clouder0/starway

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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