Skip to content

Commit

Permalink
CL/HIER: Allgatherv tune string
Browse files Browse the repository at this point in the history
  • Loading branch information
nsarkauskas authored and nsarka committed Feb 26, 2025
1 parent 9484044 commit 5c3cc25
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
2 changes: 2 additions & 0 deletions src/components/cl/hier/allgatherv/allgatherv.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ enum
extern ucc_base_coll_alg_info_t
ucc_cl_hier_allgatherv_algs[UCC_CL_HIER_ALLGATHERV_ALG_LAST + 1];

#define UCC_CL_HIER_ALLGATHERV_DEFAULT_ALG_SELECT_STR "allgatherv:0-2k:host:@gab"

ucc_status_t ucc_cl_hier_allgatherv_init(ucc_base_coll_args_t *coll_args,
ucc_base_team_t *team,
ucc_coll_task_t **task);
Expand Down
15 changes: 14 additions & 1 deletion src/components/cl/hier/cl_hier_coll.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const char *
ucc_cl_hier_default_alg_select_str[UCC_CL_HIER_N_DEFAULT_ALG_SELECT_STR] = {
UCC_CL_HIER_ALLREDUCE_DEFAULT_ALG_SELECT_STR,
UCC_CL_HIER_BCAST_DEFAULT_ALG_SELECT_STR,
UCC_CL_HIER_REDUCE_DEFAULT_ALG_SELECT_STR};
UCC_CL_HIER_REDUCE_DEFAULT_ALG_SELECT_STR,
UCC_CL_HIER_ALLGATHERV_DEFAULT_ALG_SELECT_STR};

ucc_status_t ucc_cl_hier_coll_init(ucc_base_coll_args_t *coll_args,
ucc_base_team_t *team,
Expand Down Expand Up @@ -54,6 +55,8 @@ static inline int alg_id_from_str(ucc_coll_type_t coll_type, const char *str)
return ucc_cl_hier_bcast_alg_from_str(str);
case UCC_COLL_TYPE_REDUCE:
return ucc_cl_hier_reduce_alg_from_str(str);
case UCC_COLL_TYPE_ALLGATHERV:
return ucc_cl_hier_allgatherv_alg_from_str(str);
default:
break;
}
Expand Down Expand Up @@ -124,6 +127,16 @@ ucc_status_t ucc_cl_hier_alg_id_to_init(int alg_id, const char *alg_id_str,
break;
}
break;
case UCC_COLL_TYPE_ALLGATHERV:
switch(alg_id) {
case UCC_CL_HIER_ALLGATHERV_ALG_GAB:
*init = ucc_cl_hier_allgatherv_init;
break;
default:
status = UCC_ERR_INVALID_PARAM;
break;
}
break;
default:
status = UCC_ERR_NOT_SUPPORTED;
break;
Expand Down
2 changes: 1 addition & 1 deletion src/components/cl/hier/cl_hier_coll.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "reduce/reduce.h"
#include "allgatherv/allgatherv.h"

#define UCC_CL_HIER_N_DEFAULT_ALG_SELECT_STR 3
#define UCC_CL_HIER_N_DEFAULT_ALG_SELECT_STR 4

extern const char
*ucc_cl_hier_default_alg_select_str[UCC_CL_HIER_N_DEFAULT_ALG_SELECT_STR];
Expand Down
9 changes: 0 additions & 9 deletions src/components/cl/hier/cl_hier_team.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,15 +411,6 @@ ucc_status_t ucc_cl_hier_team_get_scores(ucc_base_team_t *cl_team,

}

status = ucc_coll_score_add_range(
score, UCC_COLL_TYPE_ALLGATHERV, UCC_MEMORY_TYPE_HOST,
0, 2048, UCC_CL_HIER_DEFAULT_SCORE,
ucc_cl_hier_allgatherv_init, cl_team);
if (UCC_OK != status) {
cl_error(lib, "failed to add range to score_t");
return status;
}

for (i = 0; i < UCC_CL_HIER_N_DEFAULT_ALG_SELECT_STR; i++) {
status = ucc_coll_score_update_from_str(
ucc_cl_hier_default_alg_select_str[i], &team_info,
Expand Down

0 comments on commit 5c3cc25

Please sign in to comment.