Files
TheRock/rocm-systems/projects/rccl/test/DdaAlltoAllThresholdTests.cpp
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

122 lines
4.0 KiB
C++

/*************************************************************************
* Copyright (c) 2026 Advanced Micro Devices, Inc. All rights reserved.
*
* See LICENSE.txt for license information
************************************************************************/
#include "common/DdaAlltoAllTestHelpers.hpp"
#include "common/ProcessIsolatedTestRunner.hpp"
#include "gtest/gtest.h"
namespace RcclUnitTesting
{
class DdaAlltoAllThresholdTest : public ::testing::Test
{
protected:
DdaAlltoAllMockComm mockComm_;
};
TEST_F(DdaAlltoAllThresholdTest, Gfx942_ExactlyAt4MbThreshold_Enabled)
{
mockComm_.reset("gfx942:sramecc+:xnack-");
const size_t totalBytes = kDdaAlltoAllGfx942ThresholdBytes;
EXPECT_TRUE(testRcclDdaEnabled(
mockComm_.get(),
totalBytes,
kDdaAlltoAllGfx942ThresholdBytes,
kDdaAlltoAllGfx950ThresholdBytes));
EXPECT_TRUE(testRcclDdaAlltoAllThresholdEnabled(
mockComm_.get(), kAlltoAllFloat32CountAt4MbThreshold, ncclFloat32));
}
TEST_F(DdaAlltoAllThresholdTest, Gfx942_OneByteOverThreshold_Disabled)
{
mockComm_.reset("gfx942:sramecc+:xnack-");
const size_t totalBytes = kDdaAlltoAllGfx942ThresholdBytes + 1;
EXPECT_FALSE(testRcclDdaEnabled(
mockComm_.get(),
totalBytes,
kDdaAlltoAllGfx942ThresholdBytes,
kDdaAlltoAllGfx950ThresholdBytes));
EXPECT_FALSE(testRcclDdaAlltoAllThresholdEnabled(
mockComm_.get(), kAlltoAllFloat32CountAt4MbThreshold + 1, ncclFloat32));
}
TEST_F(DdaAlltoAllThresholdTest, Gfx950_ExactlyAt4MbThreshold_Enabled)
{
mockComm_.reset("gfx950:sramecc+:xnack-");
const size_t totalBytes = kDdaAlltoAllGfx950ThresholdBytes;
EXPECT_TRUE(testRcclDdaEnabled(
mockComm_.get(),
totalBytes,
kDdaAlltoAllGfx942ThresholdBytes,
kDdaAlltoAllGfx950ThresholdBytes));
EXPECT_TRUE(testRcclDdaAlltoAllThresholdEnabled(
mockComm_.get(), kAlltoAllFloat32CountAt4MbThreshold, ncclFloat32));
}
TEST_F(DdaAlltoAllThresholdTest, Gfx950_AlltoAllIgnoresHighUserThreshold)
{
mockComm_.reset("gfx950:sramecc+:xnack-");
const size_t overCap = kDdaAlltoAllGfx950ThresholdBytes + 1;
EXPECT_FALSE(testRcclDdaEnabled(
mockComm_.get(),
overCap,
kDdaAlltoAllGfx942ThresholdBytes,
kDdaAlltoAllGfx950ThresholdBytes));
// Other collectives on gfx950 still honor the user threshold when gfx950Default is 0.
const size_t eightMb = 8 * 1024 * 1024;
EXPECT_TRUE(testRcclDdaEnabled(mockComm_.get(), eightMb, 8388608, 0));
}
TEST_F(DdaAlltoAllThresholdTest, UnsupportedArch_Disabled)
{
mockComm_.reset("gfx1100");
EXPECT_FALSE(testRcclDdaAlltoAllThresholdEnabled(
mockComm_.get(), kAlltoAllFloat32CountAt4MbThreshold, ncclFloat32));
}
TEST_F(DdaAlltoAllThresholdTest, FewerThanEightRanks_Disabled)
{
mockComm_.reset("gfx950:sramecc+:xnack-");
mockComm_.comm.nRanks = 4;
EXPECT_FALSE(testRcclDdaAlltoAllThresholdEnabled(
mockComm_.get(), kAlltoAllFloat32CountAt4MbThreshold, ncclFloat32));
}
TEST_F(DdaAlltoAllThresholdTest, SymmetricSupport_Disabled)
{
mockComm_.reset("gfx950:sramecc+:xnack-");
mockComm_.comm.symmetricSupport = 1;
EXPECT_FALSE(testRcclDdaAlltoAllThresholdEnabled(
mockComm_.get(), kAlltoAllFloat32CountAt4MbThreshold, ncclFloat32));
}
TEST_F(DdaAlltoAllThresholdTest, StagingBytesAtThresholdMatches4Mb)
{
const size_t stagingBytes = testAlltoAllDdaIpcStagingBytes(
kAlltoAllFloat32CountAt4MbThreshold,
nccl_dda_detail::kDdaNranks,
sizeof(float));
EXPECT_EQ(stagingBytes, kDdaAlltoAllGfx950ThresholdBytes);
}
TEST(DdaAlltoAllThreshold, DdaEnableOff_Disabled)
{
RUN_ISOLATED_TEST_WITH_ENV(
"DdaAlltoAllThreshold_DdaEnableOff",
[]()
{
DdaAlltoAllMockComm mockComm;
mockComm.reset("gfx950:sramecc+:xnack-");
EXPECT_FALSE(testRcclDdaAlltoAllThresholdEnabled(
mockComm.get(), kAlltoAllFloat32CountAt4MbThreshold, ncclFloat32));
},
{{"RCCL_DDA_ENABLE", "0"}});
}
} // namespace RcclUnitTesting