From 18c86fb2fb209c0dfcc785c253457cf0ed4790b8 Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Fri, 30 Oct 2020 06:03:11 -0500 Subject: [PATCH] hide some logs of p2p (#28307) --- paddle/fluid/platform/init.cc | 5 +++-- python/paddle/fluid/__init__.py | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/platform/init.cc b/paddle/fluid/platform/init.cc index 2e708e44fd0..ba4520b1388 100644 --- a/paddle/fluid/platform/init.cc +++ b/paddle/fluid/platform/init.cc @@ -12,6 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include // for strdup + #include #include #include @@ -105,8 +106,8 @@ void InitP2P(std::vector devices) { PADDLE_ENFORCE_CUDA_SUCCESS( cudaDeviceCanAccessPeer(&can_acess, devices[i], devices[j])); if (can_acess != 1) { - LOG(WARNING) << "Cannot enable P2P access from " << devices[i] - << " to " << devices[j]; + VLOG(2) << "Cannot enable P2P access from " << devices[i] << " to " + << devices[j]; } else { platform::CUDADeviceGuard guard(devices[i]); cudaDeviceEnablePeerAccess(devices[j], 0); diff --git a/python/paddle/fluid/__init__.py b/python/paddle/fluid/__init__.py index c8ba7e829e9..74b56b842cf 100644 --- a/python/paddle/fluid/__init__.py +++ b/python/paddle/fluid/__init__.py @@ -152,6 +152,9 @@ def __bootstrap__(): import platform from . import core + # NOTE(zhiqiu): When (1)numpy < 1.19; (2) python < 3.7, + # unittest is always imported in numpy (maybe some versions not). + # so is_test is True and p2p is not inited. in_test = 'unittest' in sys.modules try: -- GitLab