Skip to content

Commit 68a9391

Browse files
arttianezhumeta-codesync[bot]
authored andcommitted
UT reduce AllReduce duplicate test cases
Summary: 1. `commInt32` and `commFloat` has same width (for nranks, we in fact don't care about width, just leaving int8 is sufficient to verify different width here.) 2. `4/6 rank` test cases v.s. `2` is not quite different, we have `8` vs `2` already. 3. `SufficientElements_LargeMessage` is duplicate with the base CtranAllReduce positive test case `CtranAllReduceTest::BasicRunAbortEnabled` 4. `InsufficientElements_1Element` test case is not different from `InsufficientElements_NRanksMinus1` for the purpose of these tests. Before: (< 7 min) https://www.internalfb.com/intern/testinfra/testrun/14073748959875707 After: (< 3 min) https://www.internalfb.com/intern/testinfra/testrun/1125900364950557 Reviewed By: saifhhasan Differential Revision: D86159506 fbshipit-source-id: 5c26ddc822f2e30a64540e5eb36efd78dc07704b
1 parent 615798d commit 68a9391

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

comms/ctran/tests/CtranAllReduceTest.cc

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -363,16 +363,9 @@ class CtranAllReduceRingMinSizeTest
363363
}
364364
};
365365

366-
TEST_P(CtranAllReduceRingMinSizeTest, InsufficientElements_1Element) {
367-
auto [numRanks, dt] = GetParam();
368-
ASSERT_FALSE(numRanks <= 1) << "Need at least 2 ranks for this test";
369-
runTest(
370-
1, dt, CtranAllReduceRingMinSizeTestOpt::expect_insufficient, numRanks);
371-
}
372-
373366
TEST_P(CtranAllReduceRingMinSizeTest, InsufficientElements_NRanksMinus1) {
374367
auto [numRanks, dt] = GetParam();
375-
ASSERT_FALSE(numRanks <= 1) << "Need at least 2 ranks for this test";
368+
ASSERT_GT(numRanks, 1) << "Need at least 2 ranks for this test";
376369
runTest(
377370
numRanks - 1,
378371
dt,
@@ -382,8 +375,6 @@ TEST_P(CtranAllReduceRingMinSizeTest, InsufficientElements_NRanksMinus1) {
382375

383376
TEST_P(CtranAllReduceRingMinSizeTest, SufficientElements_ExactlyNRanks) {
384377
auto [numRanks, dt] = GetParam();
385-
XLOG(INFO) << "SufficientElements_ExactlyNRanks: numRanks: " << numRanks
386-
<< ", dt: " << dt;
387378
runTest(
388379
numRanks,
389380
dt,
@@ -400,27 +391,13 @@ TEST_P(CtranAllReduceRingMinSizeTest, SufficientElements_NRanksPlus1) {
400391
numRanks);
401392
}
402393

403-
TEST_P(CtranAllReduceRingMinSizeTest, SufficientElements_LargeMessage) {
404-
auto [numRanks, dt] = GetParam();
405-
runTest(
406-
1024, dt, CtranAllReduceRingMinSizeTestOpt::expect_sufficient, numRanks);
407-
}
408-
409394
INSTANTIATE_TEST_SUITE_P(
410395
AllDataTypes,
411396
CtranAllReduceRingMinSizeTest,
412397
::testing::Values(
413398
std::make_tuple<>(2, commFloat),
414-
std::make_tuple<>(2, commInt32),
415399
std::make_tuple<>(2, commInt8),
416-
std::make_tuple<>(4, commFloat),
417-
std::make_tuple<>(4, commInt32),
418-
std::make_tuple<>(4, commInt8),
419-
std::make_tuple<>(6, commFloat),
420-
std::make_tuple<>(6, commInt32),
421-
std::make_tuple<>(6, commInt8),
422400
std::make_tuple<>(8, commFloat),
423-
std::make_tuple<>(8, commInt32),
424401
std::make_tuple<>(8, commInt8)));
425402

426403
class CtranAllReduceRingOneRankTest : public CtranStandaloneMultiRankBaseTest {

0 commit comments

Comments
 (0)