Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 7 additions & 4 deletions src/ucp/proto/proto_multi.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ ucp_proto_multi_aggregate_perf(const ucp_proto_multi_init_params_t *params,
perf->recv_overhead = 0;
perf->latency = 0;
perf->sys_latency = 0;
perf->min_length = 0;

ucs_for_each_bit(lane, selection->lane_map) {
lane_perf = &lanes_perf[lane];
Expand All @@ -581,7 +582,7 @@ ucp_proto_multi_aggregate_perf(const ucp_proto_multi_init_params_t *params,
perf->send_post_overhead += lane_perf->send_post_overhead;
perf->recv_overhead += lane_perf->recv_overhead;
perf->latency = ucs_max(perf->latency, lane_perf->latency);
perf->sys_latency = ucs_max(perf->sys_latency,
perf->sys_latency = ucs_max(perf->sys_latency,
lane_perf->sys_latency);
}

Expand All @@ -604,7 +605,7 @@ ucp_proto_multi_init_priv(const ucp_proto_multi_init_params_t *params,
const ucp_proto_common_tl_perf_t *lane_perf;
ucp_proto_multi_lane_priv_t *lpriv;
uct_iface_attr_v2_t iface_attr_v2;
size_t UCS_V_UNUSED min_length;
size_t min_length;
size_t max_frag, min_end_offset, min_chunk;
uint32_t weight_sum;
ucp_rsc_index_t rsc_index;
Expand Down Expand Up @@ -694,6 +695,7 @@ ucp_proto_multi_init_priv(const ucp_proto_multi_init_params_t *params,
lane_perf->min_length);

weight_sum += lpriv->weight;
perf->min_length = ucs_max(perf->min_length, min_length);
min_end_offset += min_chunk;
mpriv->min_frag = ucs_max(mpriv->min_frag, lane_perf->min_length);
mpriv->max_frag_sum += lpriv->max_frag;
Expand Down Expand Up @@ -727,8 +729,9 @@ ucp_proto_multi_init_priv(const ucp_proto_multi_init_params_t *params,
}
ucs_assert(mpriv->num_lanes == ucs_popcount(selection->lane_map));

/* Multi-lane protocols with non-zero min_frag pad length if needed */
perf->min_length = mpriv->min_frag;
if (params->single_lane_min_length) {
perf->min_length = mpriv->min_frag;
}
*reg_md_map_p = reg_md_map;
return UCS_OK;
}
Expand Down
4 changes: 4 additions & 0 deletions src/ucp/proto/proto_multi.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ typedef struct {
* several parts. The goal is to not split below this limit */
size_t min_chunk;

/* Use the largest per-lane minimum as the protocol minimum, allowing short
* messages that do not use all selected lanes */
size_t single_lane_min_length;

/* MDs on which the buffer is expected to be already registered, so no need
to account for the overhead of registering on them */
ucp_md_map_t initial_reg_md_map;
Expand Down
17 changes: 9 additions & 8 deletions src/ucp/rma/get_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,15 @@ ucp_proto_get_offload_zcopy_probe(const ucp_proto_init_params_t *init_params)
.super.exclude_map = 0,
.super.reg_mem_info = ucp_proto_common_select_param_mem_info(
init_params->select_param),
.max_lanes = context->config.ext.max_rma_lanes,
.min_chunk = context->config.ext.min_rma_chunk_size,
.initial_reg_md_map = 0,
.first.tl_cap_flags = UCT_IFACE_FLAG_GET_ZCOPY,
.first.lane_type = UCP_LANE_TYPE_RMA_BW,
.middle.tl_cap_flags = UCT_IFACE_FLAG_GET_ZCOPY,
.middle.lane_type = UCP_LANE_TYPE_RMA_BW,
.opt_align_offs = UCP_PROTO_COMMON_OFFSET_INVALID
.max_lanes = context->config.ext.max_rma_lanes,
.min_chunk = context->config.ext.min_rma_chunk_size,
.single_lane_min_length = 1,
.initial_reg_md_map = 0,
.first.tl_cap_flags = UCT_IFACE_FLAG_GET_ZCOPY,
.first.lane_type = UCP_LANE_TYPE_RMA_BW,
.middle.tl_cap_flags = UCT_IFACE_FLAG_GET_ZCOPY,
.middle.lane_type = UCP_LANE_TYPE_RMA_BW,
.opt_align_offs = UCP_PROTO_COMMON_OFFSET_INVALID
};

if (!ucp_proto_init_check_op(init_params, UCS_BIT(UCP_OP_ID_GET))) {
Expand Down
34 changes: 34 additions & 0 deletions test/gtest/ucp/test_ucp_proto_mock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1460,6 +1460,40 @@ UCS_TEST_P(test_ucp_proto_mock_rcx_twins_tag, use_single_net_device_2,

UCP_INSTANTIATE_TEST_CASE_TLS(test_ucp_proto_mock_rcx_twins_tag, rcx, "rc_x")

class test_ucp_proto_mock_rcx_twins_rndv_min :
public test_ucp_proto_mock_rcx_twins_tag {
public:
virtual void init() override
{
auto iface_attr_func = [](uct_iface_attr_t &iface_attr) {
iface_attr.cap.am.max_short = 208;
iface_attr.cap.get.min_zcopy = 65;
iface_attr.bandwidth.shared = 28e9;
iface_attr.latency.c = 500e-9;
iface_attr.latency.m = 1e-9;
};

add_mock_iface("mock_0:1", iface_attr_func);
add_mock_iface("mock_1:1", iface_attr_func);
add_mock_iface("mock_2:1", iface_attr_func);
test_ucp_proto_mock::init();
}
};

UCS_TEST_P(test_ucp_proto_mock_rcx_twins_rndv_min,
rndv_respects_lane_min_length,
"IB_NUM_PATHS?=1", "RNDV_THRESH=1", "RNDV_SCHEME=get_zcopy",
"MAX_RNDV_LANES=2")
{
check_config(
{{0, 129, "eager short", "rc_mlx5/mock_0:1"},
{130, INF, "rendezvous zero-copy read from remote",
"50% on rc_mlx5/mock_0:1 and 50% on rc_mlx5/mock_1:1"}});
}

UCP_INSTANTIATE_TEST_CASE_TLS(test_ucp_proto_mock_rcx_twins_rndv_min, rcx,
"rc_x")

class test_ucp_proto_mock_rcx_twins_put : public test_ucp_proto_mock_rcx_twins {
protected:
void check_config(const proto_select_data_vec_t &data_vec);
Expand Down