Expose production tuning table in topo_explorer using internal RCCL/NCCL logic (#1628)

* Internal RCCL/NCCL functionality exposed when RCCL_EXPOSE_STATIC is enabled
* Algo/protocol/max channels can be obtained with the new RCCL API
* Introduce rccl_static and rccl_static_inline macros to work around invisible functions in core source files like enqueue.cc
* Add usage example in topo-explorer tool
This commit is contained in:
Mustafa Abduljabbar
2025-04-23 15:44:56 -04:00
committed by GitHub
parent 45e1c3f3e2
commit 82afb2bcfe
8 changed files with 110 additions and 12 deletions
+19 -1
View File
@@ -22,7 +22,7 @@ THE SOFTWARE.
#ifndef RCCL_COMMON_H_
#define RCCL_COMMON_H_
#include "nccl_common.h"
#include "nccl.h"
typedef enum RcclTunableColls {
RCCL_UNSUPPORTED_TUNABLE = -1,
RCCL_RS_TUNABLE = 0, // reduce_scatter index
@@ -38,6 +38,16 @@ typedef enum RcclTunableColls {
#define RCCL_PROTOCOL_MAX_IDX 1
#define RCCL_PROTOCOL_FACTOR_IDX 2
#ifdef RCCL_EXPOSE_STATIC
#define RCCL_STATIC_EXPOSE_CHECK()
#else
#define RCCL_STATIC_EXPOSE_CHECK() \
do { \
WARN("Attempting to use internal logic while required static functions are not exposed. Rebuild with RCCL_EXPOSE_STATIC enabled"); \
return ncclInvalidUsage; \
} while (0)
#endif
inline rcclTunableIndex_t rcclGetTunableIndex(ncclFunc_t const& func) {
switch (func) {
case ncclFuncReduceScatter:
@@ -61,4 +71,12 @@ inline size_t rcclGetSizePerRank(ncclFunc_t const& func, size_t const& nBytes, i
return (func == ncclFuncReduceScatter || func == ncclFuncAllGather) ? nBytes / nRanks : nBytes;
}
void rcclUpdateCollectiveProtocol(struct ncclComm* comm, size_t const& nBytes, struct ncclTaskColl* info);
ncclResult_t rcclGetAlgoInfo(struct ncclComm* comm, ncclFunc_t coll, uint64_t count, ncclDataType_t dataType,
int collNetSupport, int nvlsSupport, int numPipeOps,
int* algo, int* protocol, int* maxChannels);
ncclResult_t rcclFuncMaxSendRecvCount(ncclFunc_t func, int nRanks, size_t count, size_t& maxCount);
#endif
+8
View File
@@ -27,4 +27,12 @@ THE SOFTWARE.
RCCL_PARAM_DECLARE(EnableHipGraph); // Opt-in environment variable for enabling hipGraph
#ifdef RCCL_EXPOSE_STATIC
#define rccl_static
#define rccl_static_inline
#else
#define rccl_static static
#define rccl_static_inline static inline
#endif
#endif