Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TL/UCP: add reduce srg knomial #1058

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
11 changes: 6 additions & 5 deletions src/components/tl/ucp/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@ gatherv = \
gatherv/gatherv.c \
gatherv/gatherv_linear.c

reduce = \
reduce/reduce.h \
reduce/reduce.c \
reduce/reduce_knomial.c \
reduce/reduce_dbt.c
reduce = \
reduce/reduce.h \
reduce/reduce.c \
reduce/reduce_knomial.c \
reduce/reduce_dbt.c \
reduce/reduce_srg_knomial.c
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alignment


reduce_scatter = \
reduce_scatter/reduce_scatter.h \
Expand Down
7 changes: 6 additions & 1 deletion src/components/tl/ucp/reduce/reduce.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2021-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* Copyright (c) 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*
* See file LICENSE for terms.
*/
Expand All @@ -18,6 +18,11 @@ ucc_base_coll_alg_info_t
.name = "dbt",
.desc = "reduce over double binary tree where a leaf in one tree "
"will be intermediate in other (optimized for BW)"},
[UCC_TL_UCP_REDUCE_ALG_SRG] =
{.id = UCC_TL_UCP_REDUCE_ALG_SRG,
.name = "srg",
.desc = "recursive knomial scatter-reduce followed by knomial "
"gather"},
[UCC_TL_UCP_REDUCE_ALG_LAST] = {
.id = 0, .name = NULL, .desc = NULL}};

Expand Down
17 changes: 11 additions & 6 deletions src/components/tl/ucp/reduce/reduce.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2021-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* Copyright (c) 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*
* See file LICENSE for terms.
*/
Expand All @@ -10,14 +10,15 @@
enum {
UCC_TL_UCP_REDUCE_ALG_KNOMIAL,
UCC_TL_UCP_REDUCE_ALG_DBT,
UCC_TL_UCP_REDUCE_ALG_SRG,
UCC_TL_UCP_REDUCE_ALG_LAST
};

extern ucc_base_coll_alg_info_t
ucc_tl_ucp_reduce_algs[UCC_TL_UCP_REDUCE_ALG_LAST + 1];

#define UCC_TL_UCP_REDUCE_DEFAULT_ALG_SELECT_STR \
"reduce:0-inf:@0"
"reduce:0-32K:@0#reduce:32K-inf:@2"

/* A set of convenience macros used to implement sw based progress
of the reduce algorithm that uses kn pattern */
Expand Down Expand Up @@ -55,8 +56,8 @@ static inline int ucc_tl_ucp_reduce_alg_from_str(const char *str)
ucc_status_t ucc_tl_ucp_reduce_init(ucc_tl_ucp_task_t *task);

ucc_status_t ucc_tl_ucp_reduce_knomial_init(ucc_base_coll_args_t *coll_args,
ucc_base_team_t *team,
ucc_coll_task_t **task_h);
ucc_base_team_t *team,
ucc_coll_task_t **task_h);

ucc_status_t ucc_tl_ucp_reduce_knomial_start(ucc_coll_task_t *task);

Expand All @@ -65,7 +66,11 @@ void ucc_tl_ucp_reduce_knomial_progress(ucc_coll_task_t *task);
ucc_status_t ucc_tl_ucp_reduce_knomial_finalize(ucc_coll_task_t *task);

ucc_status_t ucc_tl_ucp_reduce_dbt_init(ucc_base_coll_args_t *coll_args,
ucc_base_team_t *team,
ucc_coll_task_t **task_h);
ucc_base_team_t *team,
ucc_coll_task_t **task_h);

ucc_status_t ucc_tl_ucp_reduce_srg_knomial_init(ucc_base_coll_args_t *coll_args,
ucc_base_team_t *team,
ucc_coll_task_t **task_h);

#endif
Loading
Loading