Skip to content

Forward-merge branch-0.44 into branch-0.45 #1140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions ucp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,22 @@ def _is_mig_device(handle):
for dev_idx in range(device_count):
handle = pynvml.nvmlDeviceGetHandleByIndex(dev_idx)

# Ignore MIG devices and use rely on UCX's default for now. Increasing
# `UCX_CUDA_COPY_MAX_REG_RATIO` should be thoroughly tested, as it's
# not yet clear whether it would be safe to set `1.0` for those
# instances too.
if _is_mig_device(handle):
try:
total_memory = pynvml.nvmlDeviceGetMemoryInfo(handle).total
except pynvml.NVMLError_NotSupported:
total_memory = None

# Ignore MIG devices and devices with no memory resource (i.e., only
# integrated CPU+GPU memory resource) and rely on UCX's default for
# now. Increasing `UCX_CUDA_COPY_MAX_REG_RATIO` should be thoroughly
# tested, as it's not yet clear whether it would be safe to set `1.0`
# for those instances too.
if _is_mig_device(handle) or total_memory is None:
continue

try:
bar1_total = pynvml.nvmlDeviceGetBAR1MemoryInfo(handle).bar1Total
except pynvml.nvml.NVMLError_NotSupported:
except pynvml.NVMLError_NotSupported:
# Bar1 access not supported on this device, set it to
# zero (always lower than device memory).
bar1_total = 0
Expand Down
Loading