-
Notifications
You must be signed in to change notification settings - Fork 432
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/RNDV: Adjust max_frag to be at least of minimal RNDV chunk size #10407
base: master
Are you sure you want to change the base?
Changes from 4 commits
9dba379
127cdff
5f7e5ce
5fe2171
423c3f0
5ca4485
49ed7e5
ffdbd93
dd04b1b
722d415
d94438a
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 |
---|---|---|
|
@@ -35,7 +35,7 @@ ucs_status_t ucp_proto_multi_init(const ucp_proto_multi_init_params_t *params, | |
ucp_lane_index_t i, lane, num_lanes; | ||
ucp_proto_multi_lane_priv_t *lpriv; | ||
ucp_proto_perf_node_t *perf_node; | ||
size_t max_frag, min_length, min_end_offset; | ||
size_t max_frag, min_length, min_end_offset, min_rndv_chunk; | ||
ucp_lane_map_t lane_map; | ||
ucp_md_map_t reg_md_map; | ||
uint32_t weight_sum; | ||
|
@@ -167,6 +167,18 @@ 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); | ||
|
||
min_rndv_chunk = lane_perf->bandwidth * | ||
context->config.ext.min_rndv_chunk_size / | ||
min_bandwidth; | ||
/* min_rndv_chunk must operate within iface/HW limits */ | ||
min_rndv_chunk = ucs_max(ucs_min(min_rndv_chunk, lane_perf->max_frag), | ||
lane_perf->min_length); | ||
/* For RNDV only: max scaled fragment must be at least min_rndv_chunk */ | ||
if ((params->super.send_op == UCT_EP_OP_PUT_ZCOPY) || | ||
(params->super.send_op == UCT_EP_OP_GET_ZCOPY)) { | ||
max_frag = ucs_max(max_frag, min_rndv_chunk); | ||
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. this is the actual fix, right? we have also test for that in maybe mock? 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. Yes, this line is the real fix, other changes are just the boundary checks 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.
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.
max_frag = ucs_double_to_sizet(lane_perf->bandwidth / max_frag_ratio,
lane_perf->max_frag);
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.
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'm afraid moving this code outside is gonna be very hard, because other calculations are tightly coupled with max_frag. Maybe in the future we can refactor this function, as it does a lot of things. Using flag in params seems viable option to me, and btw there are already suitable flags, indicating that RNDV is used: 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 have refactored code around min_chunk:
|
||
} | ||
|
||
lpriv->max_frag = max_frag; | ||
perf.max_frag += max_frag; | ||
|
||
|
@@ -215,9 +227,7 @@ ucs_status_t ucp_proto_multi_init(const ucp_proto_multi_init_params_t *params, | |
perf.min_length = ucs_max(perf.min_length, min_length); | ||
|
||
weight_sum += lpriv->weight; | ||
min_end_offset += lane_perf->bandwidth * | ||
context->config.ext.min_rndv_chunk_size / | ||
min_bandwidth; | ||
min_end_offset += min_rndv_chunk; | ||
mpriv->min_frag = ucs_max(mpriv->min_frag, lane_perf->min_length); | ||
mpriv->max_frag_sum += lpriv->max_frag; | ||
lpriv->weight_sum = weight_sum; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UCS_ERR_INVALID_PARAM - params->min_length is invalid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok