-
Notifications
You must be signed in to change notification settings - Fork 131
TL/UCP: add exact mixed-radix allgather schedules #1327
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
ec51644
94d3bd9
d17161b
155b53b
8e47d8d
1efec89
1f41ba6
3bd32dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| /** | ||
| * Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| * See file LICENSE for terms. | ||
| */ | ||
|
|
||
| #include "allgather.h" | ||
|
|
||
| #include <stdlib.h> | ||
|
|
||
| ucc_status_t ucc_tl_ucp_allgather_knomial_parse_radices( | ||
|
jeffnvidia marked this conversation as resolved.
Outdated
|
||
| const char *value, ucc_rank_t team_size, ucc_kn_radix_t *radices, | ||
| uint8_t *nradices) | ||
| { | ||
| const char *p = value; | ||
| char *end; | ||
| unsigned long parsed; | ||
| ucc_rank_t product = 1; | ||
| uint8_t n = 0; | ||
|
|
||
| *nradices = 0; | ||
| if (value == NULL || value[0] == '\0') { | ||
| return UCC_ERR_NOT_FOUND; | ||
| } | ||
|
|
||
| while (*p != '\0') { | ||
| if (n == UCC_KN_MAX_RADIX_PHASES) { | ||
| return UCC_ERR_INVALID_PARAM; | ||
| } | ||
| parsed = strtoul(p, &end, 10); | ||
| if (end == p || parsed < 2 || parsed > UINT16_MAX || | ||
| product > UCC_RANK_MAX / parsed) { | ||
| return UCC_ERR_INVALID_PARAM; | ||
| } | ||
| radices[n++] = (ucc_kn_radix_t)parsed; | ||
| product *= (ucc_rank_t)parsed; | ||
| if (*end == '\0') { | ||
| break; | ||
| } | ||
| if (*end != ',' || end[1] == '\0') { | ||
| return UCC_ERR_INVALID_PARAM; | ||
| } | ||
| p = end + 1; | ||
| } | ||
|
|
||
| if (product != team_size) { | ||
| return UCC_ERR_INVALID_PARAM; | ||
| } | ||
| *nradices = n; | ||
| return UCC_OK; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -172,6 +172,13 @@ ucc_config_field_t ucc_tl_ucp_lib_config_table[] = { | |
| ucc_offsetof(ucc_tl_ucp_lib_config_t, allgather_kn_radix), | ||
| UCC_CONFIG_TYPE_UINT_RANGED}, | ||
|
|
||
| {"ALLGATHER_KN_MIXED_RADICES", "", | ||
| "Optional exact mixed-radix schedule for knomial allgather, for example " | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i would maybe change semantic here, instead of exact decompostion consider it as allowed factors in decomposition so it generalises to any team size in a run.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't we want the option for the user to provide the exact order ? (between 8x6 and 6x8 for example) I'm thinking that maybe the user would for example want to start with the first radix being the number of ranks in one node. In the second PR, I provide an auto tuner that selects the radices and the order anyways but if the user chooses to select, I was thinking we ggive him "full control"
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree, but at the same time if we consider this config as exact decomposition then it is less useful. If context creates multiple teams of different size then most of them will skip this value. Maybe extend with extra "=", for instance
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I kept the |
||
| "4,4,6. Every radix must be at least 2 and their product must equal the " | ||
| "team size. Invalid schedules are rejected", | ||
| ucc_offsetof(ucc_tl_ucp_lib_config_t, allgather_kn_mixed_radices), | ||
| UCC_CONFIG_TYPE_STRING}, | ||
|
|
||
|
jeffnvidia marked this conversation as resolved.
Outdated
|
||
| {"BCAST_KN_RADIX", "4", "Radix of the recursive-knomial bcast algorithm", | ||
| ucc_offsetof(ucc_tl_ucp_lib_config_t, bcast_kn_radix), | ||
| UCC_CONFIG_TYPE_UINT}, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -144,6 +144,12 @@ gtest_LDFLAGS += $(UCX_LDFLAGS) | |
| gtest_LDADD += $(UCX_LIBS) $(UCX_LIBADD) | ||
| endif | ||
|
|
||
| if TL_UCP_ENABLED | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why test knomial_schedule depends on TL UCP?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It no longer depends on TL/UCP. The test was renamed to |
||
| gtest_SOURCES += \ | ||
| coll/test_knomial_schedule.cc \ | ||
| $(top_srcdir)/src/components/tl/ucp/allgather/allgather_knomial_schedule.c | ||
| endif | ||
|
|
||
| noinst_HEADERS = \ | ||
| common/gtest.h \ | ||
| common/test.h \ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.