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>
Este commit está contenido en:
isaki001
2025-02-04 09:11:32 -06:00
cometido por GitHub
padre 19105206f6
commit 3398fa78fe
Se han modificado 7 ficheros con 339 adiciones y 68 borrados
+31
Ver fichero
@@ -4,6 +4,7 @@
* See LICENSE.txt for license information
************************************************************************/
#include "TestBed.hpp"
#include "CallCollectiveForked.hpp"
namespace RcclUnitTesting
{
@@ -242,4 +243,34 @@ namespace RcclUnitTesting
}
testBed.Finalize();
}
TEST(AllReduce, 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(count, 0);
for (int i = 0; i < count; ++i){
sendBuff[i] = i;
expected[i] = i * nranks;
}
callCollectiveForked(nranks, ncclCollAllReduce, sendBuff, recvBuff, expected);
}
TEST(AllReduce, 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(count, 0);
const bool use_managed_mem = true;
for (int i = 0; i < count; ++i){
sendBuff[i] = i;
expected[i] = i * nranks;
}
callCollectiveForked(nranks, ncclCollAllReduce, sendBuff, recvBuff, expected, use_managed_mem);
}
}