Skip to content

Commit

Permalink
fix(tuner): avoid gotos
Browse files Browse the repository at this point in the history
stack-info: PR: #569, branch: aws-nslick/stack/16
  • Loading branch information
aws-nslick committed Sep 4, 2024
1 parent 743e062 commit a432ad7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/tuner/nccl_ofi_tuner.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ ncclResult_t nccl_ofi_tuner_get_coll_info(void *context,

if (nccl_ofi_tuner_ctx == NULL || nccl_ofi_tuner_ctx->regions == NULL || collType != ncclFuncAllReduce) {
/* Fall back to NCCL's tuner */
goto exit;
return ncclSuccess;
}

float(*table)[NCCL_NUM_PROTOCOLS] = (float(*)[NCCL_NUM_PROTOCOLS])collCostTable;
Expand Down Expand Up @@ -373,7 +373,6 @@ ncclResult_t nccl_ofi_tuner_get_coll_info(void *context,
NCCL_OFI_INFO(NCCL_TUNING, "Falling back to NCCL's tuner for coll %d size %ld.", collType, nBytes);
}

exit:
return ncclSuccess;
}

Expand Down Expand Up @@ -406,7 +405,7 @@ ncclResult_t nccl_ofi_tuner_get_coll_info_v2(

if (nccl_ofi_tuner_ctx == NULL || nccl_ofi_tuner_ctx->regions == NULL || collType != ncclFuncAllReduce) {
/* Fall back to NCCL's tuner */
goto exit;
return ncclSuccess;
}

int in_out = -1;
Expand Down Expand Up @@ -437,7 +436,6 @@ ncclResult_t nccl_ofi_tuner_get_coll_info_v2(
NCCL_OFI_INFO(NCCL_TUNING, "Falling back to NCCL's tuner for coll %d size %ld.", collType, nBytes);
}

exit:
return ncclSuccess;
}

Expand Down

0 comments on commit a432ad7

Please sign in to comment.