non-hipGraph MSCCL++ tests for allReduce and allGather (#1503)

* working tests for a single message size

* move call_RCCL routine StandaloneUtils, create .cpp file for StandaloneUtils so that it can be included in several tests

* simplify test invocation

* remove unecessary logs and exit from ncclCommRegister

* set expected results for allGather

* skip test if nranks doesn't match number of gpus, call getAndDistributeNCCLid only from parent process

* fix improper size of expected-results vector

* Removing unused changes.

* Refactored to create a new file for the forked collectives call, as StandaloneUtils is for the Standalone tests. Renamed the functions to be slightly more accurate and follow existing naming conventions.

* Apply suggestions from code review

Co-authored-by: corey-derochie-amd <161367113+corey-derochie-amd@users.noreply.github.com>

---------

Co-authored-by: isaki001 <isakioti@banff-pla-r27-38.pla.dcgpu>
Co-authored-by: corey-derochie-amd <161367113+corey-derochie-amd@users.noreply.github.com>
Co-authored-by: Corey Derochie <corey.derochie@amd.com>
This commit is contained in:
isaki001
2025-02-04 09:11:32 -06:00
committed by GitHub
parent 19105206f6
commit 3398fa78fe
7 changed files with 339 additions and 68 deletions
+39
View File
@@ -4,6 +4,7 @@
* See LICENSE.txt for license information
************************************************************************/
#include "TestBed.hpp"
#include "CallCollectiveForked.hpp"
namespace RcclUnitTesting
{
@@ -120,4 +121,42 @@ namespace RcclUnitTesting
inPlaceList, managedMemList, useHipGraphList);
testBed.Finalize();
}
TEST(AllGather, UserBufferRegistration)
{
const int nranks = 8;
size_t count = 2048;
std::vector<int> sendBuff(count, 0);
std::vector<int> recvBuff(count, 0);
std::vector<int> expected(nranks*count, 0);
for (int i = 0; i < count; ++i){
sendBuff[i] = i;
}
for(int r = 0; r < nranks; ++r)
for (int i = 0; i < count; ++i)
expected[r*count + i] = sendBuff[i];
callCollectiveForked(nranks, ncclCollAllGather, sendBuff, recvBuff, expected);
}
TEST(AllGather, ManagedMemUserBufferRegistration)
{
const int nranks = 8;
size_t count = 2048;
std::vector<int> sendBuff(count, 0);
std::vector<int> recvBuff(count, 0);
std::vector<int> expected(nranks*count, 0);
const bool use_managed_mem = true;
for (int i = 0; i < count; ++i){
sendBuff[i] = i;
}
for(int r = 0; r < nranks; ++r)
for (int i = 0; i < count; ++i)
expected[r*count + i] = sendBuff[i];
callCollectiveForked(nranks, ncclCollAllGather, sendBuff, recvBuff, expected, use_managed_mem);
}
}