-
Notifications
You must be signed in to change notification settings - Fork 428
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: Consider RNDV_PERF_DIFF #10292
base: master
Are you sure you want to change the base?
Changes from 1 commit
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 |
---|---|---|
|
@@ -430,6 +430,27 @@ ucs_status_t ucp_proto_perf_aggregate2(const char *name, | |
return ucp_proto_perf_aggregate(name, perf_elems, 2, perf_p); | ||
} | ||
|
||
void ucp_proto_perf_apply_bias(ucp_proto_perf_t *perf, double bias) { | ||
ucs_linear_func_t bias_func = ucs_linear_func_make(0.0, 1.0 - bias); | ||
ucp_proto_perf_node_t *bias_node; | ||
ucp_proto_perf_factor_id_t fid; | ||
ucp_proto_perf_segment_t *seg; | ||
|
||
if (bias == 0) { | ||
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. compare with some epsilon value? 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. Done |
||
return; | ||
} | ||
|
||
ucp_proto_perf_segment_foreach(seg, perf) { | ||
for (fid = 0; fid < UCP_PROTO_PERF_FACTOR_LAST; ++fid) { | ||
seg->perf_factors[fid] = ucs_linear_func_compose( | ||
bias_func, seg->perf_factors[fid]); | ||
ucp_proto_perf_node_update_factors(seg->node, seg->perf_factors); | ||
} | ||
bias_node = ucp_proto_perf_node_new_data("bias", "%.2f %%", bias); | ||
ucp_proto_perf_node_own_child(seg->node, &bias_node); | ||
} | ||
Comment on lines
+444
to
+452
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. can we implement this using ucp_proto_perf_add_funcs? 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 think that this would be more laconic/readable since
|
||
} | ||
|
||
/* TODO: | ||
* Reconsider correctness of PPLN perf estimation logic since in case of async | ||
* operations it seems wrong to choose the longest factor without paying | ||
|
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.
code style
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.
Done