Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
5 changes: 5 additions & 0 deletions src/ucp/wireup/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ exchanged out-of-band) and connection-manager wireup (sockaddr listener).
both sides must pick the same lane assignment, otherwise the connection
will mismatch. Many tests assert specific lane assignments, so use
stable tie-breakers.
- A change of the lanes picked by `select.c` must keep the old selection
with peers of older releases: gate it by a `*_MIN_DST_VERSION` constant
in `wireup.h` checked against `dst_version` of the remote address, like
`UCP_WIREUP_MAX_LANES_MIN_DST_VERSION`. Otherwise a new and an old peer
pick different lanes.
- The proxy-ep path (`wireup_ep.c`) holds user requests in a queue; never
short-circuit it for a fast path that might run before all lanes are
active. Use `ucp_wireup_ep_progress_pending` on transition.
Expand Down
16 changes: 10 additions & 6 deletions src/ucp/wireup/select.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,10 @@ static void ucp_wireup_select_transport_tiebreak(
static size_t
ucp_wireup_bw_max_lanes(const ucp_wireup_select_params_t *select_params)
{
return (select_params->address->dst_version < 18) ? UCP_MAX_LANES_LEGACY :
UCP_MAX_LANES;
return (select_params->address->dst_version <
Comment thread
dmitrygx marked this conversation as resolved.
Resolved
UCP_WIREUP_MAX_LANES_MIN_DST_VERSION) ?
UCP_MAX_LANES_LEGACY :
UCP_MAX_LANES;
Comment thread
dmitrygx marked this conversation as resolved.
Resolved
}

static size_t
Expand Down Expand Up @@ -1103,7 +1105,7 @@ ucp_wireup_iface_score_bandwidth(const ucp_worker_iface_t *wiface,
{
double local_bw;

if (unpacked_addr->dst_version < 17) {
if (unpacked_addr->dst_version < UCP_WIREUP_BW_DISTANCE_MIN_DST_VERSION) {
local_bw = ucp_tl_iface_bandwidth(wiface->worker->context,
&wiface->attr.bandwidth);
} else {
Expand Down Expand Up @@ -1454,7 +1456,8 @@ ucp_wireup_is_connect_all_to_all(const ucp_worker_h worker,
{
return worker->context->config.ext.connect_all_to_all &&
!(worker->uuid == unpacked_addr->uuid) && /* Not on self */
(unpacked_addr->dst_version >= 19);
(unpacked_addr->dst_version >=
UCP_WIREUP_CONNECT_ALL_TO_ALL_MIN_DST_VERSION);
}

static double
Expand Down Expand Up @@ -1710,7 +1713,7 @@ static double ucp_wireup_get_lane_bw(ucp_worker_h worker,
ucp_worker_iface_t *wiface = ucp_worker_iface(worker, sinfo->rsc_index);
double bw_local, bw_remote;

if (address->dst_version < 17) {
if (address->dst_version < UCP_WIREUP_BW_DISTANCE_MIN_DST_VERSION) {
bw_local = ucp_tl_iface_bandwidth(worker->context,
&wiface->attr.bandwidth);
} else {
Expand Down Expand Up @@ -2319,7 +2322,8 @@ ucp_wireup_add_rma_bw_lanes(const ucp_wireup_select_params_t *select_params,
* use of fence operations usually don't request the TAG feature, hence the
* check.
*/
if ((select_params->address->dst_version >= 17) &&
if ((select_params->address->dst_version >=
UCP_WIREUP_SEPARATE_AM_LANE_MIN_DST_VERSION) &&
(context->config.features & (UCP_FEATURE_TAG | UCP_FEATURE_AM))) {
ucs_carray_for_each(lane_desc, select_ctx->lane_descs,
select_ctx->num_lanes) {
Expand Down
28 changes: 28 additions & 0 deletions src/ucp/wireup/wireup.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,34 @@ enum {
};


/*
* Minimal peer release version which includes the local distance in the lane
* bandwidth. With older peers the interface bandwidth is used without it.
*/
#define UCP_WIREUP_BW_DISTANCE_MIN_DST_VERSION 17


/*
* Minimal peer release version which separates the AM lane from the RMA BW
* lanes. With older peers the AM lane can also be used as an RMA BW lane.
*/
#define UCP_WIREUP_SEPARATE_AM_LANE_MIN_DST_VERSION 17


/*
* Minimal peer release version which supports UCP_MAX_LANES lanes. Older
* peers support up to UCP_MAX_LANES_LEGACY lanes.
*/
#define UCP_WIREUP_MAX_LANES_MIN_DST_VERSION 18


/*
* Minimal peer release version which connects all pairs of local and remote
* devices with UCX_CONNECT_ALL_TO_ALL. With older peers it is ignored.
*/
#define UCP_WIREUP_CONNECT_ALL_TO_ALL_MIN_DST_VERSION 19


/*
* Minimal peer release version which understands the token trailer of the
* LANES_ADDR messages. Older peers get the messages without any token.
Expand Down