forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New TORCH_UCC_BLOCKING_WAIT env variable (pytorch#81791)
Cherry-pick of facebookresearch/torch_ucc#95. I recommend waiting until pytorch#81583 is merged first, so the CI is checking if this PR compiles correctly. Marking this as a draft for now, will change to "ready for review" once pytorch#81583 merged. Pull Request resolved: pytorch#81791 Approved by: https://github.com/kwen2501
- Loading branch information
1 parent
85f82f7
commit a4a55f5
Showing
8 changed files
with
153 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include <gtest/gtest.h> | ||
#include <torch/csrc/distributed/c10d/UCCUtils.hpp> | ||
|
||
#include <utility> | ||
#include <vector> | ||
|
||
using namespace c10d; | ||
|
||
TEST(ProcessGroupUCCTest, testTrim) { | ||
std::vector<std::pair<std::string, std::string>> tests = { | ||
{" allreduce ", "allreduce"}, | ||
{"\tallgather", "allgather"}, | ||
{"send\n", "send"}, | ||
}; | ||
for (auto entry : tests) { | ||
ASSERT_EQ(trim(entry.first), entry.second); | ||
} | ||
} | ||
|
||
TEST(ProcessGroupUCCTest, testToLower) { | ||
std::vector<std::pair<std::string, std::string>> tests = { | ||
{"AllReduce", "allreduce"}, | ||
{"ALLGATHER", "allgather"}, | ||
{"send", "send"}, | ||
}; | ||
for (auto entry : tests) { | ||
ASSERT_EQ(tolower(entry.first), entry.second); | ||
} | ||
} | ||
|
||
TEST(ProcessGroupUCCTest, testParseList) { | ||
std::string input = "\tAllReduce, ALLGATHER, send\n"; | ||
std::vector<std::string> expect{"allreduce", "allgather", "send"}; | ||
ASSERT_EQ(parse_list(input), expect); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters