Skip to content

Commit d605628

Browse files
[RCCL] [UT] Add ROCTX test
Adds ROCTX test to the RCCL UT suite. Signed-off-by: ravaidya <ravaidya@amd.com> [rocm-systems] ROCm/rocm-systems#3625 (commit b0efc7c)
1 parent 2388edd commit d605628

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/AllReduceTests.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,27 @@ namespace RcclUnitTesting
250250
callCollectiveForked(nranks, ncclCollAllReduce, sendBuff, recvBuff, expected, use_managed_mem);
251251
}
252252

253+
TEST(AllReduce, ROCTX)
254+
{
255+
// Set RCCL_LOG_ROCTX=1 to enable ROCTX logging
256+
// Verify that ROCTX logging doesn't break functionality when enabled
257+
setenv("RCCL_LOG_ROCTX", "1", 1);
258+
259+
const int nranks = 8;
260+
size_t count = 2048;
261+
std::vector<int> sendBuff(count, 0);
262+
std::vector<int> recvBuff(count, 0);
263+
std::vector<int> expected(count, 0);
264+
265+
for (int i = 0; i < count; ++i) {
266+
sendBuff[i] = i;
267+
expected[i] = i * nranks;
268+
}
269+
callCollectiveForked(nranks, ncclCollAllReduce, sendBuff, recvBuff, expected);
270+
271+
unsetenv("RCCL_LOG_ROCTX");
272+
}
273+
253274
#ifdef RCCL_ALLREDUCE_WITH_BIAS
254275
// Note: All bias tests require:
255276
// nRanks >= 2 (bias NOT supported for single rank)

0 commit comments

Comments
 (0)