Added Unit test for nccl send recv (#506)

Added Send Receive test that tests through all pairs

[ROCm/rccl commit: ff54e79799]
This commit is contained in:
akolliasAMD
2022-03-02 15:50:16 -05:00
committed by GitHub
parent a182076a0e
commit 2419a950fe
8 changed files with 135 additions and 9 deletions
+17 -3
View File
@@ -220,21 +220,35 @@ namespace RcclUnitTesting
}
}
void TestBed::ExecuteCollectives()
void TestBed::ExecuteCollectives(std::vector<int> const &currentRanks)
{
int const cmd = TestBedChild::CHILD_EXECUTE_COLL;
++TestBed::NumTestsRun();
std::vector<std::vector<int>> ranksPerChild(this->numActiveChildren);
for (int rank = 0; rank < currentRanks.size(); ++rank)
{
ranksPerChild[rankToChildMap[currentRanks[rank]]].push_back(rank);
}
// Send ExecuteColl command to each active child process
for (int childId = 0; childId < this->numActiveChildren; ++childId)
{
PIPE_WRITE(childId, cmd);
if ((currentRanks.size() == 0) || (ranksPerChild[childId].size() > 0))
{
PIPE_WRITE(childId, cmd);
int tempCurrentRanks = currentRanks.size();
PIPE_WRITE(childId, tempCurrentRanks);
for (int rank = 0; rank < currentRanks.size(); ++rank){
PIPE_WRITE(childId, currentRanks[rank]);
}
}
}
// Wait for child acknowledgement
for (int childId = 0; childId < this->numActiveChildren; ++childId)
{
PIPE_CHECK(childId);
if ((currentRanks.size() == 0) || (ranksPerChild[childId].size() > 0)) PIPE_CHECK(childId);
}
}