Skip to content

Commit

Permalink
TL/SHARP: Option to enable SHARP multi-channel
Browse files Browse the repository at this point in the history
  • Loading branch information
bureddy committed Dec 12, 2024
1 parent 4f67436 commit a9d816f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/components/tl/sharp/tl_sharp.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2021-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* Copyright (c) 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*
* See file LICENSE for terms.
*/
Expand Down Expand Up @@ -72,6 +72,11 @@ static ucc_config_field_t ucc_tl_sharp_context_config_table[] = {
ucc_offsetof(ucc_tl_sharp_context_config_t, team_max_ppn),
UCC_CONFIG_TYPE_UINT},

{"USE_MULTI_CHANNEL", "0",
"Use SHARP Multi-channel feature. Options: 0-disable 1-enable",
ucc_offsetof(ucc_tl_sharp_context_config_t, use_multi_channel),
UCC_CONFIG_TYPE_BOOL},

{NULL}};

UCC_CLASS_DEFINE_NEW_FUNC(ucc_tl_sharp_lib_t, ucc_base_lib_t,
Expand Down
3 changes: 2 additions & 1 deletion src/components/tl/sharp/tl_sharp.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2021-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* Copyright (c) 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*
* See file LICENSE for terms.
*/
Expand Down Expand Up @@ -53,6 +53,7 @@ typedef struct ucc_tl_sharp_context_config {
int context_per_team;
int enable_lazy_group_alloc;
int team_max_ppn;
int use_multi_channel;
} ucc_tl_sharp_context_config_t;

typedef struct ucc_tl_sharp_lib {
Expand Down
6 changes: 5 additions & 1 deletion src/components/tl/sharp/tl_sharp_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,11 @@ ucc_status_t ucc_tl_sharp_context_init(ucc_tl_sharp_context_t *sharp_ctx,

init_spec.progress_func = NULL;
init_spec.world_local_rank = local_rank;
init_spec.group_channel_idx = 0;
if (sharp_ctx->cfg.use_multi_channel) {
init_spec.group_channel_idx = local_rank;
} else {
init_spec.group_channel_idx = 0;
}
init_spec.oob_ctx = oob_ctx;
init_spec.config = sharp_coll_default_config;
init_spec.config.user_progress_num_polls = sharp_ctx->cfg.uprogress_num_polls;
Expand Down

0 comments on commit a9d816f

Please sign in to comment.