Skip to main content

CuTe-comm

NCCL device-initiated API bindings for the CuTe Python DSL.

Exposes NCCL's GIN (GPU-initiated networking) and LSA (local symmetric access) APIs via cute.ffi, with a thin host-side layer for communicator setup.

Requirements

  • Python >= 3.10, CUDA 13, NCCL >= 2.29.7
  • GPU with deviceApiSupport (check via query_properties)

Installation

pip install cute-comm
# or from source
uv sync

Usage

import cute_comm.nccl as cn

# Host: bootstrap communicator, register memory
uid = cn.get_unique_id()          # broadcast from rank 0
comm = cn.init_rank(nranks, rank, uid)
dev_comm = cn.create_dev_comm(comm, gin_contexts=1, gin_signals=1, lsa_barriers=1)
win = cn.register_window(comm, buf.data_ptr(), buf.nbytes)

# Device: use inside @cute.jit kernels
@cute.jit
def my_kernel(dev_comm, ctx, win, peer):
    ptr = cn.lsa_ptr(win, offset, peer)
    cn.gin_put_siginc(dev_comm, ctx, peer, dst_win, dst_off, src_win, src_off, nbytes, signal_idx)
    cn.gin_wait_signal(dev_comm, ctx, signal_idx, threshold=1)

# Pass link_options to bundle the bridge PTX (compiled lazily, cached in ~/.cache/cute_comm/)
my_kernel[grid, block, cn.link_options("sm_90a")](dev_comm, ctx, win, peer)

# Cleanup
cn.deregister_window(comm, win)
cn.destroy_dev_comm(comm, dev_comm)
cn.finalize(comm)
cn.destroy(comm)

API

Host — get_unique_id, init_rank, query_properties, create_dev_comm, destroy_dev_comm, register_window, deregister_window, finalize, destroy

Device (inside @cute.jit) — local_ptr, lsa_ptr, lsa_barrier, gin_put, gin_put_siginc, gin_put_sigadd, gin_read_signal, gin_wait_signal

License

BSD 3-Clause. See LICENSE.

Metadata

Release files for cute-comm 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cute-comm 0.1.0
File Size Uploaded
cute_comm-0.1.0.tar.gz 65.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cute-comm 0.1.0
File Interpreter ABI Platform
cute_comm-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 74.6 kB

Release files / cute_comm-0.1.0.tar.gz

Download URL cute_comm-0.1.0.tar.gz
Size 65.1 kB
Tags Source
SHA-256 checksum
How to use checksums
62188030516ebb288c31e7b7da42871aa3fa02523b305ab8d47f1b76cfd4ef98
BLAKE2b-256 checksum
How to use checksums
581a1e7ff2e65ea554b26daa905d25acab4cba20b49f34c279af579241d0f355
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.12 {"installer":{"name":"uv","version":"0.9.12"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / cute_comm-0.1.0-py3-none-any.whl

Download URL cute_comm-0.1.0-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
25dc967f6094e9cf02bd741770ac1ee07ac1f22099425ff38646bbffe2506dc2
BLAKE2b-256 checksum
How to use checksums
fba9b8859e96c608433fd5adc94abe7a0257ef1d78f127ef11574d8d6fecc080
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.12 {"installer":{"name":"uv","version":"0.9.12"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page