From cc2a66c586569fc7b4f83b15f83929658f58b182 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 00:32:58 +0000 Subject: [PATCH 1/3] Initial plan From 7a5087090995be8d59e859f54488a32fef3819d0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 00:36:42 +0000 Subject: [PATCH 2/3] fix: remove NVLS support check from isCuMemMapAllocated and fix isNvlsSupported caching Agent-Logs-Url: https://github.com/microsoft/mscclpp/sessions/f8417c19-e697-4a32-a298-9a958b9a16a1 Co-authored-by: Binyang2014 <9415966+Binyang2014@users.noreply.github.com> --- src/core/gpu_utils.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/core/gpu_utils.cc b/src/core/gpu_utils.cc index 628d2dcbf..4efe96d45 100644 --- a/src/core/gpu_utils.cc +++ b/src/core/gpu_utils.cc @@ -273,8 +273,8 @@ bool isNvlsSupported() { if (env()->forceDisableNvls) { return false; } - [[maybe_unused]] static bool result = false; - [[maybe_unused]] static bool isChecked = false; + static bool result = false; + static bool isChecked = false; #if (CUDA_NVLS_API_AVAILABLE) if (!isChecked) { int deviceId; @@ -283,7 +283,9 @@ bool isNvlsSupported() { MSCCLPP_CUDATHROW(cudaGetDevice(&deviceId)); MSCCLPP_CUTHROW(cuDeviceGet(&dev, deviceId)); MSCCLPP_CUTHROW(cuDeviceGetAttribute(&isMulticastSupported, CU_DEVICE_ATTRIBUTE_MULTICAST_SUPPORTED, dev)); - return isMulticastSupported == 1; + result = (isMulticastSupported == 1); + isChecked = true; + return result; } return result; #endif @@ -300,9 +302,6 @@ bool isCuMemMapAllocated([[maybe_unused]] void* ptr) { return false; } MSCCLPP_CUTHROW(cuMemRelease(handle)); - if (!isNvlsSupported()) { - throw Error("cuMemMap is used in env without NVLS support", ErrorCode::InvalidUsage); - } return true; #endif } From 6d64528defcf0959fa10bdd74cdcf2daef204fc4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 00:44:30 +0000 Subject: [PATCH 3/3] fix: restore [[maybe_unused]] on static vars in isNvlsSupported for HIP env Agent-Logs-Url: https://github.com/microsoft/mscclpp/sessions/dc2eb9a6-b5e4-4daf-8c7d-c6eac8223dff Co-authored-by: Binyang2014 <9415966+Binyang2014@users.noreply.github.com> --- src/core/gpu_utils.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/gpu_utils.cc b/src/core/gpu_utils.cc index 4efe96d45..09d5025d6 100644 --- a/src/core/gpu_utils.cc +++ b/src/core/gpu_utils.cc @@ -273,8 +273,8 @@ bool isNvlsSupported() { if (env()->forceDisableNvls) { return false; } - static bool result = false; - static bool isChecked = false; + [[maybe_unused]] static bool result = false; + [[maybe_unused]] static bool isChecked = false; #if (CUDA_NVLS_API_AVAILABLE) if (!isChecked) { int deviceId;