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.1.tar.gz (35.8 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.1-cp313-cp313-manylinux_2_34_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

starway-0.2.1-cp312-cp312-manylinux_2_34_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

starway-0.2.1-cp311-cp311-manylinux_2_34_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

starway-0.2.1-cp310-cp310-manylinux_2_34_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

File details

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

File metadata

  • Download URL: starway-0.2.1.tar.gz
  • Upload date:
  • Size: 35.8 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.1.tar.gz
Algorithm Hash digest
SHA256 2cebd9954a79d21e455219d48645a1c20d3f60313150cf148eba5d249f058352
MD5 4408ac8d6b029dc978fce535aa93f2ba
BLAKE2b-256 70358b2671d40071edd3cda3e75f885efc2aa2db169bb5623589581c4a8bbd87

See more details on using hashes here.

Provenance

The following attestation bundles were made for starway-0.2.1.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.1-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for starway-0.2.1-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 187d8690c70113527effae5e82989e9474384c096373e297ed1bb52730198928
MD5 d4692c774acdb7d2eba102b47aaebfd3
BLAKE2b-256 236cd6593cf6c154b3cc601849f542819819c621001fd2142f27190b28f9ab39

See more details on using hashes here.

Provenance

The following attestation bundles were made for starway-0.2.1-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.1-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for starway-0.2.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8decc0416827e7f234cb17d568c3349f9a5b4726e8b4991978a12e6d8c497772
MD5 1f99162aca80b1743c946ad31d3fc1b3
BLAKE2b-256 ba19b51513522aa4055778b909ab4f382052629dc04164a4dade1669c316e273

See more details on using hashes here.

Provenance

The following attestation bundles were made for starway-0.2.1-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.1-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for starway-0.2.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 bd7a5e8683296ae17f6157219287ce2160ff9d6644de154a4f61264fe05cb57a
MD5 66d68068f32805e9e9d4624cfbacc781
BLAKE2b-256 27e35652abc4e262ceef3103a93d9dd5f3a2314a726742158fa23d8bb253c91d

See more details on using hashes here.

Provenance

The following attestation bundles were made for starway-0.2.1-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.1-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for starway-0.2.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 72d951083aa13f250c5a99a8b3643357df97c406f9e67bffe59b43fdbd6c358c
MD5 959d2586ca31c4be5e428e12ee941f51
BLAKE2b-256 76ca87c282761b312349b6b9192824c985c23196fbded7f00cb845e342e06304

See more details on using hashes here.

Provenance

The following attestation bundles were made for starway-0.2.1-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