Skip to content

Commit

Permalink
Initialize logging facility when running ProcessGroupNCCLTest (pytorc…
Browse files Browse the repository at this point in the history
…h#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: pytorch#112809
Approved by: https://github.com/fduwjj
  • Loading branch information
malfet authored and pytorchmergebot committed Nov 3, 2023
1 parent 0d95378 commit 8665a51
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/cpp/c10d/ProcessGroupNCCLTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 8665a51

Please sign in to comment.