From 8665a51bafb62c2fbff9acd4163757b283c3293f Mon Sep 17 00:00:00 2001 From: Nikita Shulga <2453524+malfet@users.noreply.github.com> Date: Fri, 3 Nov 2023 02:26:09 +0000 Subject: [PATCH] Initialize logging facility when running ProcessGroupNCCLTest (#112809) If code is compiled without `glog`, there are no way to control log levels other than explicitly calling `c10::initLogging()` Test plan: Run `TORCH_CPP_LOG_LEVEL=0 ./bin/ProcessGroupNCCLTest` and observe extra log messages Pull Request resolved: https://github.com/pytorch/pytorch/pull/112809 Approved by: https://github.com/fduwjj --- test/cpp/c10d/ProcessGroupNCCLTest.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/test/cpp/c10d/ProcessGroupNCCLTest.cpp b/test/cpp/c10d/ProcessGroupNCCLTest.cpp index f7b17766ddf6c..0c2d9253cbac5 100644 --- a/test/cpp/c10d/ProcessGroupNCCLTest.cpp +++ b/test/cpp/c10d/ProcessGroupNCCLTest.cpp @@ -734,6 +734,7 @@ void testSequenceNumInit( class ProcessGroupNCCLTest : public ::testing::Test { protected: void SetUp() override { + c10::initLogging(); // Use WORLD_SIZE and RANK environmental variables to do multi-node // distributed testing auto sizeEnv = std::getenv("WORLD_SIZE");