Repository navigation
UCP/RMA: Fix restart of partially sent PUT requests - #12322
Conversation
A restarted PUT which was partially sent is reselected with the resume flag. put/offload/bcopy kept its offset on reset but cannot resume, so without a resumable AM protocol the request was canceled. put/rndv and get/rndv accepted the resume flag but ignored the offset. Skip the data which was already sent by a contiguous bcopy PUT, so any protocol can send the rest. Rewind an IOV request in put/offload/bcopy, and reject the resume flag in the RMA rendezvous probes.
|
🤖 Starting review — findings will be posted here when done. |
|
Residual coverage gap: the IOV rewind branch of Residual coverage gap: |
|
🤖 CI Triage Agent — Summary: Unable to fetch logs — cannot diagnose without them.
|
Let put/offload/bcopy resume a restarted request like put/am/bcopy, so an IOV request resumes in both protocols instead of being rewound by one. Share their reset, which still skips the sent data of a contig request. Drop the resume check in the RMA rendezvous probes, since no contig request is resumed anymore. In the test, take the async lock before checking the request, and check the resume flag for IOV requests too.
|
🤖 Starting review — findings will be posted here when done. |
|
🤖 Starting review — findings will be posted here when done. |
|
|
||
| test_ucp_rma_restart() | ||
| { | ||
| modify_config("PROTO_REQUEST_RESET", "y"); |
There was a problem hiding this comment.
minor: pls skip when !is_proto_enabled() - ucp_put_nbx() returns UCS_ERR_UNSUPPORTED with proto v1, so the first ASSERT_UCS_OK fails.
|
Residual coverage gap (unchanged from the previous revision): |
|
🤖 CI Triage Agent — TL;DR: Full analysisSummary: Azure job "roce on worker 1" (build 144992) failed: gtest Root cause: Timeline evidence of a hang, not slowness: the test starts at 10:35:01 and the next line is at 10:38:02 ( if (!ucp_datatype_iter_is_begin(&req->send.state.dt_iter))
select_param.op_id_flags |= UCP_PROTO_SELECT_OP_FLAG_RESUME;On Implicated commit: [REDACTED:Hex High Entropy String] — "UCP/RMA: Move the shared PUT bcopy reset to rma_send.c", Thomas Vegas (PR #12322 "UCP/RMA: Fix restart of partially sent PUT requests") File: src/ucp/proto/proto_common.c:879‑882 (RESUME decision in Suggested fix: Make the "partially sent" test reflect data actually transmitted, not iterator position:
Related: PR #12322 (this PR); restart/failover groundwork in #12266 and #11940
|
dmitrygx
left a comment
There was a problem hiding this comment.
good, apart small comment about moving new added function closer to similar ones
| } while (0) | ||
|
|
||
|
|
||
| ucs_status_t ucp_proto_put_bcopy_reset(ucp_request_t *req) |
There was a problem hiding this comment.
minor: maybe move closer to
Line 177 in a910af2
so it won't require defining
ucp_proto_put_bcopy_reset() in header file
There was a problem hiding this comment.
it's also the reset of put/am/bcopy in put_am.c, so it needs the declaration in rma.h wherever it is defined. it was in put_offload.c in 934fedd and moved to rma_send.c in 521cbaa so that put_am.c doesn't depend on the offload file; can move it back next to ucp_proto_put_offload_bcopy_progress() if you still prefer.
not related to this PR: setting the resume flag in |
|
🤖 Starting review — findings will be posted here when done. |
| /* The offset counts posted fragments, whose data bcopy already copied out | ||
| * of the user buffer. Make the unsent part of a contig request a request | ||
| * of its own, so any protocol can restart it without resume support. */ | ||
| if (dt_iter->dt_class == UCP_DATATYPE_CONTIG) { |
There was a problem hiding this comment.
In the contig branch of ucp_proto_put_bcopy_reset: can we put this in a helper in datatype_iter.inl, next to ucp_datatype_iter_slice()? dt_iter internals are otherwise only written under src/ucp/dt, and the slice helper already does the same buffer + offset / length arithmetic.
|
|
|
🤖 CI Triage Agent — TL;DR: The ASAN gtest job failed on a LeakSanitizer report (68024 bytes in 17 allocations) — every leaked block belongs to the UCP worker/endpoint created by Full analysisSummary: Root cause: All leak stacks share the same origin —
That combination means the UCP endpoint created in The leaking test is Implicated commit: [REDACTED:Hex High Entropy String] (PR #12322, branch File: test/gtest/ucp/test_ucp_proto_mock.cc:5116 ( Suggested fix:
Related: PR #12322 (the failing change). No existing issue found for this leak signature.
|
What?
Fix the restart of a partially sent PUT request.
Why?
When a request is restarted after part of it was sent, for example when the endpoint replays its pending requests after a reconfiguration or with
UCX_PROTO_REQUEST_RESET=y, it is reselected with the resume flag. Only a protocol that continues from the request offset may accept it:put/offload/bcopykeeps its offset on reset but does not declare resume support. Without a resumable AM protocol, such as withUCX_PROTO_EMULATION_ENABLE=n, no protocol is found and the request is canceled.put/rndvaccepts the resume flag but ignores the offset: its RTS carries the original buffer, remote address and length, so it sends the whole message again.How?
put/offload/bcopydeclares resume support, likeput/am/bcopy. Its send path already continues from the iterator offset, so an IOV request now resumes in both bcopy PUT protocols.ucp_proto_put_bcopy_reset(), which makes a contiguous request start from the current point: the buffer and the remote address move forward by the offset, the length shrinks by it, and the offset becomes 0. The request is reselected as a fresh PUT of the remaining data without the resume flag, so any protocol can send it, including rendezvous for GPU memory. This is safe because:put/rndvandget/rndvonly see requests that start from offset 0.test_ucp_rma_restartsends a PUT that is larger than the send queue, restarts it by purging and replaying the lane pending queue, and checks the data. It also checks that only IOV requests are resumed. Without the fix,put/offload/bcopyrequests are canceled, and contiguous requests are reselected with the resume flag.Tested on a host without GPU, so the rendezvous path is not covered:
test_ucp_rma_restartonrc_x,shmandtcp. Onshmandtcp,put_offload_bcopyis skipped since their RMA bandwidth lanes do not support put bcopy.*test_ucp_rma*and*test_ucp_ep_reconfig*, with and withoutUCX_PROTO_REQUEST_RESET=y.