Skip to content

Commit

Permalink
fix(tree): avoid sign comparison issues
Browse files Browse the repository at this point in the history
stack-info: PR: #575, branch: aws-nslick/stack/22
  • Loading branch information
aws-nslick committed Sep 5, 2024
1 parent 26d29fd commit 55a9339
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/nccl_ofi_rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -4384,7 +4384,7 @@ static int send_progress(nccl_net_ofi_rdma_req_t *req)

ret = post_rdma_eager_send(req, comm_rail, xfer_info);
} else {
for (int rail_it = send_data->xferred_rail_id;
for (size_t rail_it = send_data->xferred_rail_id;
rail_it < schedule->num_xfer_infos; rail_it++) {
/* Get xfer information from the schedule */
nccl_net_ofi_xfer_info_t *xfer_info = &xfers[rail_it];
Expand Down Expand Up @@ -4693,7 +4693,7 @@ static int send(nccl_net_ofi_send_comm_t *send_comm, void *data, int size, int t

/* Determine if this should be sent eagerly. */
eager = false;
if ((!have_ctrl && size <= eager_max_size) ||
if ((!have_ctrl && (size_t)size <= eager_max_size) ||
(size == 0)) {
eager = true;
}
Expand Down Expand Up @@ -5100,7 +5100,7 @@ static inline int create_send_comm(nccl_net_ofi_conn_handle_t *handle,


error:
if (ret_s_comm && ~0 != ret_s_comm->local_comm_id) {
if (ret_s_comm && COMM_ID_MASK != ret_s_comm->local_comm_id) {
if (0 != nccl_ofi_idpool_free_id(device->comm_idpool, ret_s_comm->local_comm_id)) {
NCCL_OFI_WARN("Error freeing communicator ID %" PRIu32, ret_s_comm->local_comm_id);
}
Expand Down
2 changes: 1 addition & 1 deletion src/nccl_ofi_scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void nccl_net_ofi_set_multiplexing_schedule(size_t size, int num_rails,
*/
static inline int set_round_robin_schedule(nccl_net_ofi_threshold_scheduler_t *scheduler,
size_t size,
int num_rails,
size_t num_rails,
nccl_net_ofi_schedule_t *schedule)
{
int rail_id;
Expand Down
2 changes: 1 addition & 1 deletion src/nccl_ofi_sendrecv.c
Original file line number Diff line number Diff line change
Expand Up @@ -2567,7 +2567,7 @@ int nccl_net_ofi_sendrecv_init(const char *provider_filter,
nccl_net_ofi_plugin_t **plugin_p)
{
int ret = 0;
int dev_id = 0;
size_t dev_id = 0;
struct fi_info *provider_list = NULL, *info;
unsigned int num_providers;
nccl_net_ofi_plugin_t *plugin = NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/platform-aws.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ int platform_init(const char **provider_filter)

ret = snprintf(topology_path, sizeof(topology_path), "%s/%s",
XML_DIR, platform_data->topology);
if (ret < 0 || ret >= sizeof(topology_path)) {
if (ret < 0 || (size_t)ret >= sizeof(topology_path)) {
NCCL_OFI_WARN("Error occurred while forming the complete topology XML file path. RC: %d, Buffer Size: %d, XML dir: %s, Topology file: %s",
ret, PATH_MAX, XML_DIR, platform_data->topology);
ret = -ENOMEM;
Expand Down
2 changes: 1 addition & 1 deletion src/tuner/nccl_ofi_regions.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ int is_inside_region(nccl_ofi_tuner_point_t point, nccl_ofi_tuner_region_t *regi
{
assert(region->num_vertices > 1);

int i, k;
size_t i, k;
nccl_ofi_tuner_point_t *pv;
double min_x, max_x, min_y, max_y;
const double eps = 1e-10;
Expand Down
4 changes: 2 additions & 2 deletions src/tuner/nccl_ofi_tuner.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ ncclResult_t nccl_ofi_tuner_get_coll_info(void *context,
nccl_ofi_tuner_point_t p = {.x = (double)nBytes, .y = (double)nccl_ofi_tuner_ctx->dims.num_ranks};

/* Check all regions */
for (int i = 0; i < nccl_ofi_tuner_ctx->num_regions && in_out < 0; i++) {
for (size_t i = 0; i < nccl_ofi_tuner_ctx->num_regions && in_out < 0; i++) {
algorithm = nccl_ofi_tuner_ctx->regions[i].algorithm;
protocol = nccl_ofi_tuner_ctx->regions[i].protocol;
if (table[algorithm][protocol] == NCCL_ALGO_PROTO_IGNORE || algorithm >= numAlgo ||
Expand Down Expand Up @@ -412,7 +412,7 @@ ncclResult_t nccl_ofi_tuner_get_coll_info_v2(
nccl_ofi_tuner_point_t p = {.x = (double)nBytes, .y = (double)nccl_ofi_tuner_ctx->dims.num_ranks};

/* Check all regions */
for (int i = 0; i < nccl_ofi_tuner_ctx->num_regions && in_out < 0; i++) {
for (size_t i = 0; i < nccl_ofi_tuner_ctx->num_regions && in_out < 0; i++) {
if (nccl_ofi_tuner_ctx->regions[i].algorithm == NCCL_ALGO_NVLS_TREE && nvlsSupport == 0) {
continue;
}
Expand Down

0 comments on commit 55a9339

Please sign in to comment.