Skip to content

Commit 92e1b12

Browse files
mlunar-metameta-codesync[bot]
authored andcommitted
Updating commSpec so that it can support v2.28.
Summary: These diff stack, implements the required updates to rebase NCCL 2.28 for NCCLX with CTRAN integration. It incorporates all changes introduced in version 2.27, applying them on top of NCCL’s latest stable release (2.28). The primary objective of this diff is to enable CTRAN support for NCCLX under NCCL 2.28, ensuring compatibility and leveraging the latest enhancements from the upstream release. In addition, it includes necessary checks inside FastInitTest so that it can ensure the ctran enabling as expected. In this specific diff, commspecs and related datatypeconv logics are updated so that it can support both v2_27 and v2_28 of nccl. Reviewed By: dboyda, zhiyongww Differential Revision: D85349491 fbshipit-source-id: c16d924d7e75ae5060b16b97842d2535fd3bd790
1 parent 8478f46 commit 92e1b12

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

comms/ncclx/v2_27/meta/wrapper/DataTypeConv.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ inline CommPattern ncclToCommPattern(ncclPattern_t ncclPattern) {
2828
return static_cast<CommPattern>(ncclPattern);
2929
}
3030

31-
inline CommFunc ncclToCommFunc(ncclFunc_t ncclFunc) {
31+
constexpr CommFunc ncclToCommFunc(ncclFunc_t ncclFunc) {
32+
// NCCLX2.28 adds more functions to ncclFunc_t enum, we need special handling
33+
// when ncclFunc is ncclNumFuncs
34+
if (ncclFunc == ncclNumFuncs) {
35+
return CommFunc::NumFuncs;
36+
}
3237
return static_cast<CommFunc>(ncclFunc);
3338
}
3439

@@ -167,7 +172,7 @@ static_assert(
167172
"CommFunc::Recv must match ncclFuncRecv");
168173

169174
static_assert(
170-
static_cast<int>(CommFunc::NumFuncs) == static_cast<int>(::ncclNumFuncs),
175+
CommFunc::NumFuncs == ncclToCommFunc(::ncclNumFuncs),
171176
"CommFunc::commNumFuncs must match ncclNumFuncs");
172177

173178
/******************************************************************************

comms/utils/commSpecs.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,10 @@ enum class CommFunc : int {
275275
SendRecv = 5,
276276
Send = 6,
277277
Recv = 7,
278-
NumFuncs = 8
278+
AlltoAll = 8,
279+
Scatter = 9,
280+
Gather = 10,
281+
NumFuncs = 11
279282
};
280283

281284
enum class CommAlgo {

0 commit comments

Comments
 (0)