Added Unit test for nccl send recv (#506)

Added Send Receive test that tests through all pairs
此提交包含在:
akolliasAMD
2022-03-02 15:50:16 -05:00
提交者 GitHub
父節點 29ad0f5fbe
當前提交 ff54e79799
共有 8 個檔案被更改,包括 135 行新增 和 9 行删除
+17 -3
查看文件
@@ -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);
}
}