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

UCP/PROTO: Report single lane performance until multi_lane_thresh #10327

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ivankochin
Copy link
Contributor

What?

Report one lane performance until certain threshold for multi-lane protocols.

Why?

All the multi-lane protocols have their own thresholds and before that thresholds protocols use only one lane. That PR represents this information in the perfomance structure.

Should fix (RM3606445)[https://redmine.mellanox.com/issues/3606445]

ucp_proto_common_tl_perf_t *lane_perf;
ucp_proto_multi_lane_priv_t *lpriv;
ucp_lane_index_t lane;
size_t min_length = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

code style: normally variables with initialization should come first

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thanks

@@ -191,12 +150,12 @@ ucs_status_t ucp_proto_multi_init(const ucp_proto_multi_init_params_t *params,
/* Make sure fragment is not zero */
ucs_assert(max_frag > 0);

lpriv->max_frag = max_frag;
perf.max_frag += max_frag;
lpriv->max_frag = max_frag;
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: align by =, like in the rest of the code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thanks

ucp_md_map_t reg_md_map, const char *perf_name,
ucp_proto_perf_t *perf)
{
ucp_proto_common_init_params_t single_lane_params = params->super;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we make a copy on purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we make copy to change it later

ucp_proto_perf_t **perf_p,
ucp_proto_multi_priv_t *mpriv)
static ucp_lane_map_t
ucp_proto_multi_filter_slow_lanes(ucp_lane_index_t *lanes,
Copy link
Contributor

Choose a reason for hiding this comment

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

lanes and lanes_perf can be const?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

&lanes_perf_nodes[lane]);
if (status != UCS_OK) {
return status;
if (ucs_popcount(lane_map) == max_lanes) {
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: maybe?

for (i = 0; (i < num_lanes) && (ucs_popcount(lane_map) < max_lanes); ++i) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I intentionally didn't made this by this way since I think the current one is more readable

return lane_map;
}

static ucp_proto_common_tl_perf_t
Copy link
Contributor

Choose a reason for hiding this comment

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

pass some params by const
Returning by value is intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thanks

Yes, it is intentional

@ivankochin ivankochin self-assigned this Nov 26, 2024
@@ -206,6 +207,7 @@ ucp_proto_get_offload_zcopy_probe(const ucp_proto_init_params_t *init_params)
.super.reg_mem_info = ucp_proto_common_select_param_mem_info(
init_params->select_param),
.max_lanes = context->config.ext.max_rma_lanes,
.multi_lane_thresh = UCP_MIN_BCOPY,
Copy link
Contributor

Choose a reason for hiding this comment

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

why MIN_BCOPY?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because ucp_proto_multi_max_payload always use only 1 lane until this size

@@ -259,6 +260,7 @@ ucp_proto_put_offload_zcopy_probe(const ucp_proto_init_params_t *init_params)
.super.reg_mem_info = ucp_proto_common_select_param_mem_info(
init_params->select_param),
.max_lanes = context->config.ext.max_rma_lanes,
.multi_lane_thresh = UCP_MIN_BCOPY,
Copy link
Contributor

Choose a reason for hiding this comment

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

why MIN_BCOPY?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because ucp_proto_multi_max_payload always use only 1 lane until this size

@@ -32,6 +32,7 @@ static void ucp_rndv_am_probe_common(ucp_proto_multi_init_params_t *params)
params->middle.lane_type = UCP_LANE_TYPE_AM_BW;
params->super.hdr_size = sizeof(ucp_request_data_hdr_t);
params->max_lanes = context->config.ext.max_rndv_lanes;
params->multi_lane_thresh = UCP_MIN_BCOPY;
Copy link
Contributor

Choose a reason for hiding this comment

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

do we have multi-lane support for AM rndv?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we have

static void ucp_rndv_am_probe_common(ucp_proto_multi_init_params_t *params)
{
    ...
    params->max_lanes          = context->config.ext.max_rndv_lanes;
    ....
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants