Skip to content

Commit a94c6bd

Browse files
authored
Enable protov2 by default on UCX >= 1.18.0 (#384)
With protov1 not being actively developed anymore and protov2 now being more stable, it's time to switch permanently. See rapidsai/ucx-py#1121 for more details. Closes rapidsai/ucx-py#1121 . Authors: - Peter Andreas Entschev (https://github.com/pentschev) Approvers: - Mads R. B. Kristensen (https://github.com/madsbk) URL: #384
1 parent 28603dd commit a94c6bd

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

python/ucxx/ucxx/__init__.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES.
1+
# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION & AFFILIATES.
22
# SPDX-License-Identifier: BSD-3-Clause
33

44
"""UCXX: Python bindings for the Unified Communication X library (UCX <www.openucx.org>)"""
@@ -37,6 +37,18 @@
3737
except ImportError:
3838
pynvml = None
3939

40+
_ucx_version = get_ucx_version()
41+
__ucx_min_version__ = "1.15.0"
42+
__ucx_version__ = "%d.%d.%d" % _ucx_version
43+
44+
if _ucx_version < tuple(int(i) for i in __ucx_min_version__.split(".")):
45+
raise ImportError(
46+
f"Support for UCX {__ucx_version__} has ended. Please upgrade to "
47+
f"{__ucx_min_version__} or newer. If you believe the wrong version "
48+
"is being loaded, please check the path from where UCX is loaded "
49+
"by rerunning with the environment variable `UCX_LOG_LEVEL=debug`."
50+
)
51+
4052
# Setup UCX-Py logger
4153
logger = get_ucxpy_logger()
4254

@@ -51,7 +63,7 @@
5163
if (
5264
pynvml is not None
5365
and "UCX_CUDA_COPY_MAX_REG_RATIO" not in os.environ
54-
and get_ucx_version() >= (1, 12, 0)
66+
and _ucx_version >= (1, 12, 0)
5567
):
5668
try:
5769
pynvml.nvmlInit()
@@ -91,25 +103,14 @@ def _is_mig_device(handle):
91103
):
92104
pass
93105

94-
if "UCX_MAX_RNDV_RAILS" not in os.environ and get_ucx_version() >= (1, 12, 0):
106+
if "UCX_MAX_RNDV_RAILS" not in os.environ and _ucx_version >= (1, 12, 0):
95107
logger.info("Setting UCX_MAX_RNDV_RAILS=1")
96108
os.environ["UCX_MAX_RNDV_RAILS"] = "1"
97109

98-
if "UCX_PROTO_ENABLE" not in os.environ:
110+
if "UCX_PROTO_ENABLE" not in os.environ and (1, 12, 0) <= _ucx_version < (1, 18, 0):
99111
# UCX protov2 still doesn't support CUDA async/managed memory
100112
logger.info("Setting UCX_PROTO_ENABLE=n")
101113
os.environ["UCX_PROTO_ENABLE"] = "n"
102114

103115

104116
from ._version import __git_commit__, __version__
105-
106-
__ucx_min_version__ = "1.15.0"
107-
__ucx_version__ = "%d.%d.%d" % get_ucx_version()
108-
109-
if get_ucx_version() < tuple(int(i) for i in __ucx_min_version__.split(".")):
110-
raise ImportError(
111-
f"Support for UCX {__ucx_version__} has ended. Please upgrade to "
112-
f"{__ucx_min_version__} or newer. If you believe the wrong version "
113-
"is being loaded, please check the path from where UCX is loaded "
114-
"by rerunning with the environment variable `UCX_LOG_LEVEL=debug`."
115-
)

0 commit comments

Comments
 (0)