Skip to content

Commit 8f0e1da

Browse files
committed
add the flag to use lightweight executor
1 parent a28e274 commit 8f0e1da

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

src/components/tl/ucp/allgather/allgather_knomial.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ ucc_status_t ucc_tl_ucp_allgather_knomial_init_r(
422422
ucc_tl_ucp_task_t *task;
423423
ucc_sbgp_t *sbgp;
424424
ucc_status_t status;
425+
int use_loopback = UCC_TL_UCP_TEAM_LIB(team)->cfg.allgather_use_loopback;
425426
task = ucc_tl_ucp_init_task(coll_args, team);
426427
status = ucc_mpool_init(&task->allgather_kn.etask_node_mpool, 0, sizeof(node_ucc_ee_executor_task_t),
427428
0, UCC_CACHE_LINE_SIZE, 16, UINT_MAX, NULL,
@@ -440,7 +441,12 @@ ucc_status_t ucc_tl_ucp_allgather_knomial_init_r(
440441
}
441442
task->allgather_kn.etask_linked_list_head = NULL;
442443
task->allgather_kn.p.radix = radix;
443-
task->super.flags |= UCC_EE_EXECUTOR_PARAM_FIELD_TASK_TYPES ;
444+
if (use_loopback){
445+
task->super.flags |= UCC_EE_EXECUTOR_PARAM_FIELD_TASK_TYPES;
446+
}
447+
else{
448+
task->super.flags |= UCC_COLL_TASK_FLAG_EXECUTOR;
449+
}
444450
task->super.post = ucc_tl_ucp_allgather_knomial_start;
445451
task->super.progress = ucc_tl_ucp_allgather_knomial_progress;
446452
task->super.finalize = ucc_tl_ucp_allgather_knomial_finalize;

src/components/tl/ucp/tl_ucp.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ ucc_config_field_t ucc_tl_ucp_lib_config_table[] = {
140140
ucc_offsetof(ucc_tl_ucp_lib_config_t, allgather_kn_radix),
141141
UCC_CONFIG_TYPE_UINT},
142142

143+
{"ALLGATHER_USE_LOOPBACK", "0", "If set to 1 performs network loopback for self copy, otherwise uses mc cuda copy",
144+
ucc_offsetof(ucc_tl_ucp_lib_config_t, allgather_use_loopback),
145+
UCC_CONFIG_TYPE_BOOL},
146+
143147
{"BCAST_KN_RADIX", "4", "Radix of the recursive-knomial bcast algorithm",
144148
ucc_offsetof(ucc_tl_ucp_lib_config_t, bcast_kn_radix),
145149
UCC_CONFIG_TYPE_UINT},

src/components/tl/ucp/tl_ucp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ typedef struct ucc_tl_ucp_lib_config {
5656
uint32_t reduce_scatter_kn_radix;
5757
uint32_t allgather_kn_radix;
5858
uint32_t bcast_kn_radix;
59+
int allgather_use_loopback;
5960
ucc_mrange_uint_t bcast_sag_kn_radix;
6061
uint32_t reduce_kn_radix;
6162
uint32_t gather_kn_radix;

0 commit comments

Comments
 (0)