Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initializing all ranks to the same value to avoid failure of UT AllR… #1459

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/AllReduceTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace RcclUnitTesting

// Configuration
std::vector<ncclFunc_t> const funcTypes = {ncclCollAllReduce};
std::vector<ncclDataType_t> const dataTypes = {ncclFloat32};
mberenjk marked this conversation as resolved.
Show resolved Hide resolved
std::vector<ncclDataType_t> const dataTypes = {ncclFp8E4M3, ncclFp8E5M2};
std::vector<ncclRedOp_t> const redOps = {ncclSum};
std::vector<int> const roots = {0};
std::vector<int> const numElements = {393216, 384};
Expand Down
4 changes: 3 additions & 1 deletion test/common/PtrUnion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ namespace RcclUnitTesting

for (int i = 0; i < numElements; i++)
{
int valueI = (globalRank + i) % 256;
// Due to floating-point math not being commutative, the ordering in which ranks are added will matter.
// For lower-precision data types, we initialize all ranks to the same value to avoid this
int valueI = (dataType == ncclFp8E4M3 || dataType == ncclFp8E5M2)? (i % 16) :(globalRank + i) % 256;
double valueF = 1.0L/((double)valueI+1.0L);
temp.Set(dataType, i, valueI, valueF);
}
Expand Down
Loading