Files
TheRock/rocm-systems/projects/rccl/bindings/nccl4py/nccl/__init__.py
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

52 lines
1.9 KiB
Python

#
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Modifications Copyright (c) 2025-2026, Advanced Micro Devices, Inc. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# See LICENSE.txt for more license information
#
"""
nccl4py: Python bindings for RCCL on ROCm (AMD fork of NVIDIA nccl4py).
nccl4py provides Pythonic access to RCCL (the ROCm Communication Collectives
Library, AMD's drop-in replacement for NVIDIA NCCL) for efficient multi-GPU
and multi-node communication. It supports all NCCL/RCCL collective operations,
point-to-point communication, and advanced features like buffer registration
and custom reduction operators.
"""
from nccl._version import __version__
# Register the local HIP-backed cuda.core shim under the `cuda.core`
# namespace via sys.modules. Idempotent and gated on
# `"cuda.core" not in sys.modules`, so it is a no-op if a real
# cuda-core / cuda-bindings package has already populated the
# namespace. After this runs, `from cuda.core import ...` resolves
# to the HIP shim. The shim is **not** shipped as a regular
# top-level `cuda` package on disk (a regular non-PEP-420
# `cuda/__init__.py` would shadow co-installed distributions that
# legitimately contribute to `cuda.*`), so users must `import nccl`
# before reaching `cuda.core`.
from nccl._hip_compat.cuda_core_shim import _register_as_cuda_core as _register_cuda_core_shim
_register_cuda_core_shim()
del _register_cuda_core_shim
# Re-export get_version() lazily. Importing nccl alone does not load
# librccl.so — that happens only on first access of ``nccl.get_version``
# or any ``nccl.bindings.*`` symbol. Keeps `import nccl` cheap.
def __getattr__(name):
if name == "get_version":
from nccl.bindings import get_version
return get_version
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
__all__ = [
"__version__",
"get_version",
]