Skip to content
Open
Changes from all commits
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
8 changes: 5 additions & 3 deletions ext-tuner/example/plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@ __hidden ncclResult_t pluginGetCollInfo(void* context, ncclFunc_t collType, size
TunerContext* ctx = (TunerContext*)context;
if (!ctx) return ncclInternalError;

float (*table)[NCCL_NUM_PROTOCOLS] = (float (*)[NCCL_NUM_PROTOCOLS])collCostTable;

// Default channels
*nChannels = 1;

Expand Down Expand Up @@ -392,14 +394,14 @@ __hidden ncclResult_t pluginGetCollInfo(void* context, ncclFunc_t collType, size

// Check bounds
if (config->algorithm < numAlgo && config->protocol < numProto) {
if (collCostTable[config->algorithm][config->protocol] != NCCL_ALGO_PROTO_IGNORE) {
if (table[config->algorithm][config->protocol] != NCCL_ALGO_PROTO_IGNORE) {
if (ctx->logFunction) {
ctx->logFunction(NCCL_LOG_TRACE, NCCL_TUNING, __FILE__, __LINE__,
"TUNER/ExamplePlugin: Setting cost table[%s][%s] (%p) = 0.0 (was %.1f)",
algorithmToString(config->algorithm), protocolToString(config->protocol),
&collCostTable[config->algorithm][config->protocol], collCostTable[config->algorithm][config->protocol]);
&table[config->algorithm][config->protocol], table[config->algorithm][config->protocol]);
}
collCostTable[config->algorithm][config->protocol] = 0.0; // Set low cost to prefer this configuration
table[config->algorithm][config->protocol] = 0.0; // Set low cost to prefer this configuration

// Only override channels if not set to -1 (keep default)
if (config->nChannels != -1) {
Expand Down