Repository navigation
UCP/RNDV: Fallback to PUT pipeline only if PUT protocol is supported - #6881
Conversation
2b71423 to
a6cfac9
Compare
fe3fbff to
54a9c6d
Compare
|
@Akshay-Venkatesh @bureddy @SeyedMir could you review pls? |
| UCS_TEST_P(test_ucp_am_nbx_rndv_memtype_disable_zcopy, rndv_disable_put_zcopy) | ||
| { | ||
| disable_rndv_zcopy_config(sender(), UCT_IFACE_FLAG_PUT_ZCOPY); | ||
| disable_rndv_zcopy_config(receiver(), UCT_IFACE_FLAG_PUT_ZCOPY); | ||
|
|
||
| ucs_memory_type_t mt = static_cast<ucs_memory_type_t>(get_variant_value(0)); | ||
| test_am_send_recv(64 * UCS_KBYTE, 8, 0, mt); | ||
| } | ||
|
|
||
| UCS_TEST_P(test_ucp_am_nbx_rndv_memtype_disable_zcopy, rndv_disable_get_zcopy) | ||
| { | ||
| disable_rndv_zcopy_config(sender(), UCT_IFACE_FLAG_GET_ZCOPY); | ||
| disable_rndv_zcopy_config(receiver(), UCT_IFACE_FLAG_GET_ZCOPY); | ||
|
|
||
| ucs_memory_type_t mt = static_cast<ucs_memory_type_t>(get_variant_value(0)); | ||
| test_am_send_recv(64 * UCS_KBYTE, 8, 0, mt); | ||
| } |
There was a problem hiding this comment.
can define a common function for these tests with caps parameter
| /* send FRAG RTR for sender to PUT the fragment. */ | ||
| ucp_rndv_send_frag_rtr(worker, rndv_req, rreq, rndv_rts_hdr); | ||
| goto out; | ||
| } else if (is_get_zcopy_supported) { |
There was a problem hiding this comment.
isn't presence of remote addr in RTS already saying that get zcopy is supported?
There was a problem hiding this comment.
it says that sender allows us to use GET Zcopy.
but we need to check local min/max of GET Zcopy to make sure GET Zcopy RNDV is supported by TLs
There was a problem hiding this comment.
then should we set is_get_zcopy_failed to true if we do not get into this else if? Because we do not register recv buffer for AM flow
There was a problem hiding this comment.
if we get here, it must be already set,
added assert() to document it
There was a problem hiding this comment.
@dmitrygx shouldn't above check if (!is_get_zcopy_failed) ?
because is_get_zcopy_supported might be true but is_get_zcopy_failed is false because GDR not available at receiver?
There was a problem hiding this comment.
@dmitrygx shouldn't above check if (!is_get_zcopy_failed) ?
I tried it, but it disables pipeline GET Zcopy then.
since we do GET Zcopy first and if it fails (e.g. GDR is not available)m it sets is_get_zcopy_failed to true and then we should fallback to pipeline GET protocol.
because is_get_zcopy_supported might be true but is_get_zcopy_failed is false because GDR not available at receiver?
yes, this check aims it. is_get_zcopy_supported should be true and since we get here it guarantees that is_get_zcopy_failed is true.
| lane = ucp_rndv_zcopy_get_lane(rndv_req, &uct_rkey, | ||
| UCP_REQUEST_SEND_PROTO_RNDV_GET); | ||
| if (lane == UCP_NULL_LANE) { | ||
| goto err; | ||
| } |
There was a problem hiding this comment.
like in normal GET Zcopy, it can be NULL if not able to select GET protocol due to RKEY
I had a reproducer for this. So, it was fixed in the same as in GET
There was a problem hiding this comment.
it was reproduced with some test case in our gtests
| req->send.lane = | ||
| ucp_rndv_zcopy_get_lane(req, &uct_rkey, |
There was a problem hiding this comment.
minor: looks like it can fir single line now
There was a problem hiding this comment.
unfortunately, no
the last argument UCP_REQUEST_SEND_PROTO_RNDV_GET breaks the 80 symbols per line rule
There was a problem hiding this comment.
i meant
req->send.lane = ucp_rndv_zcopy_get_lane(req, &uct_rkey,
UCP_REQUEST_SEND_PROTO_RNDV_GET);
anyway it's minor comment
There was a problem hiding this comment.
it doesn't fit 80 symbols per line
| if (req != rndv_req) { | ||
| /* If GET Zcopy operation was issued as a part of fragmented protocol, | ||
| * release the fragmented request which is no longer needed */ | ||
| ucs_mpool_put_inline((void*)req->send.mdesc); | ||
| ucp_request_put(req); | ||
| } |
There was a problem hiding this comment.
it's not supposed to be supported for fragmented protocols at all, is it? Maybe better assert here then
There was a problem hiding this comment.
it's not supposed to be supported for fragmented protocols at all, is it?
it is supported by GET pipeline and GET protocols.
only PUT pipeline doesn't support it when doing GET GPU->HOST memory copy
There was a problem hiding this comment.
are you sure AM rndv flow is supported for fragmented protos?
There was a problem hiding this comment.
RNDV AM isn't supported by fragmented protocol.
But we send RTR to start PUT (normal or pipeline, if supported) or AM instead of GET (normal or fragmented).
| { | ||
| ucp_request_t *rndv_req = ucs_container_of(self, ucp_request_t, send.uct); | ||
| ucp_request_t *req = ucs_container_of(self, ucp_request_t, send.uct); | ||
| ucp_request_t *rndv_req; |
There was a problem hiding this comment.
is changes in this func related to the reported issue (or) covering some other issue?
There was a problem hiding this comment.
yes, it fixes issue appeared after fixing the original one.
normal GET Zcopy fallbacks to pipeline GET Zcopy, but it couldn't be done too, so it should send RTR. But need to correctly release all things allocated for GET.
There was a problem hiding this comment.
when is the pipeline GET ZCOPY can fail? it does GET on HOST memory which should always be a success with both IB and TCP. is it because you explicitly force disabled UCT_IFACE_FLAG_GET_ZCOPY in the gtest?
There was a problem hiding this comment.
when is the pipeline GET ZCOPY can fail? it does GET on HOST memory which should always be a success with both IB and TCP. is it because you explicitly force disabled UCT_IFACE_FLAG_GET_ZCOPY in the gtest?
yes, when there is no UCT_IFACE_FLAG_GET_ZCOPY capability on transports.
There was a problem hiding this comment.
in that case, isn't '"is_get_zcopy_supported" is false and ucp_rndv_recv_start_get_pipeline is not called?
There was a problem hiding this comment.
in that case, isn't '
"is_get_zcopy_supported" is false anducp_rndv_recv_start_get_pipelineis not called?,
if is_get_zcopy_supported - false, then ucp_rndv_recv_start_get_pipeline is not called, since GET operation can't be done
There was a problem hiding this comment.
@bureddy the changes is needed to release resources (mdesc, request) for fragmented GET protocol if it couldn't be used by some reason (i.e. ucp_rndv_zcopy_get_lane() returns UCP_NULL_LANE).
| if (zcopy_caps == UCT_IFACE_FLAG_PUT_ZCOPY) { | ||
| ucp_ep_config_rndv_zcopy_commit(0, &config->rndv.put_zcopy); | ||
| } else { | ||
| ASSERT_TRUE(zcopy_caps == UCT_IFACE_FLAG_GET_ZCOPY); | ||
| ucp_ep_config_rndv_zcopy_commit(0, &config->rndv.get_zcopy); |
There was a problem hiding this comment.
what use case does it represent? We already run it on various transports, so what is emulated by hacking caps?
There was a problem hiding this comment.
we are emulating that either GET Zcopy or PUT Zcopy isn't supported by the transport.
the idea is to check how pipeline and normal RNDV will handle it.
|
bot:pipe:retest |
|
@brminich is it ok now? |
|
@yosefe could you review pls? |
| lane = ucp_rndv_zcopy_get_lane(rndv_req, &uct_rkey, | ||
| UCP_REQUEST_SEND_PROTO_RNDV_GET); | ||
| if (lane == UCP_NULL_LANE) { |
There was a problem hiding this comment.
Don't we already check it inside ucp_rndv_progress_rma_get_zcopy, called from progress, as set by ucp_rndv_send_frag_get_mem_type in line 1137?
We can check if lanes are valid inside ucp_rndv_progress_rma_get_zcopy, or before it, but why need both?
There was a problem hiding this comment.
removed it from ucp_rndv_progress_rma_get_zcopy() - just added assertion to check that it is called when there are lanes to do GET Zcopy.
There was a problem hiding this comment.
upd: unfortunately, i found out that we still need this code to get GET Zcopy lane to get correct UCT rkey.
but it if (lane != UCP_NULL_LANE) replaced with assertion
|
@yosefe could you review pls again? |
e61829c to
b344a26
Compare
What
Fallback to PUT pipeline only if PUT protocol is supported.
Why ?
Fixes #6836.
How ?
When is going to fallback to PUT pipeline protocol, check PUT Zcopy support assuming symmetric configuration of sender and receiver, i.e. check that the length of the message is:
0