Repository navigation
Conversation
|
🤖 Starting review — findings will be posted here when done. |
| /* No TX window while the window is released: a completion callback that | ||
| * sends on this EP gets UCS_ERR_NO_RESOURCE instead of adding a packet | ||
| * which this purge would not release */ | ||
| uct_ud_ep_tx_stop(ep); |
There was a problem hiding this comment.
can we move uct_ud_ep_tx_stop() to the beginning of the purge?
uct_ud_iface_dispatch_async_comps() and uct_ud_ep_purge_outstanding() also
invoke user completions that may send, and such a packet is then completed with
the purge error instead of getting UCS_ERR_NO_RESOURCE.
A CREQ from the peer that arrives while our own CREQ is not acknowledged (a simultaneous connect) is handled as the ACK of our CREQ. An endpoint check waiting behind our CREQ must not complete with it, since the peer may not have received any packet of the endpoint, as on a link that drops the packets of one side only. ep_check_simultaneous_creq_tx_lost: the peer drops all packets of the endpoint and connects back. The check must not complete until a packet of the endpoint reaches the peer. ep_check_simultaneous_creq_destroy: as above, but the endpoint cannot send its CREP and is destroyed. The check must complete once, as canceled.
A CREQ from the peer that arrives while our own CREQ is not acknowledged (a simultaneous connect) is handled as the ACK of our CREQ, which is removed from the TX window. An endpoint check added behind the CREQ by uct_ep_check() was completed with it, although the peer may not have received any packet from us. UCP gates the recovery of a failed lane by such an endpoint check on an aux UD endpoint on each side. The replier creates its aux endpoint first, so the CREQ of the initiator probe arrives as a simultaneous one and completes the replier probe. When the link drops the packets of the replier only, the replier then connected its replacement queue pair and put the lane back into its endpoint while the drop was still in place. Its traffic and keepalive on that lane failed again, and the lane flapped. The CREQ still has to leave the TX window, since a connected endpoint must not resend it. Before handling the incoming CREQ as its ACK, move the checks waiting for our CREQ to the next PSN, the one of our CREP. They complete when the peer acknowledges the CREP, one round trip later on a working link, and only after a packet of ours reached the peer. A purge that drops the CREP before it is sent releases them with the packets sent.
b355d52 to
390d02e
Compare
|
🤖 Starting review — findings will be posted here when done. |
|
|
||
| /* No TX resources on m_e1: its CREP stays scheduled */ | ||
| tx_available = iface(m_e1)->tx.available; | ||
| iface(m_e1)->tx.available = 0; |
There was a problem hiding this comment.
On devices without ordered_send_comp every send is signaled, so the CREQ send completion polled inside validate_connect() adds the TX credit back and the CREP may be sent; then tx.psn advances, uct_ud_ep_crep_comp_purge() is not exercised anymore and the test still passes. Can we assert the CREP is still scheduled before destroy_ep(), e.g. ASSERT_TRUE(uct_ud_ep_ctl_op_check(ep(m_e1), UCT_UD_EP_OP_CREP))?
|
Coverage note: both new tests require The negative check in Not covered, and arguably out of scope: |
Print tx.psn on the CREP assert, make uct_ud_ep_crep_comp_wait() mirror uct_ud_ep_crep_comp_purge() by tx.psn, and check in the destroy test that the CREP is still scheduled, so the test cannot pass with the CREP sent.
|
Re the summary: agreed, flush on a connected endpoint with a pending CREP is a separate, pre-existing case; this PR keeps to the endpoint check. |
|
🤖 Starting review — findings will be posted here when done. |
| uct_ud_ep_ctl_op_del(ep, ep->tx.pending.ops); | ||
| ucs_arbiter_group_desched(&iface->tx.pending_q, &ep->tx.pending.group); | ||
| ep->tx.acked_psn = (uct_ud_psn_t)(ep->tx.psn - 1); | ||
| uct_ud_ep_crep_comp_purge(ep); |
There was a problem hiding this comment.
uct_ud_ep_flush(CANCEL) also forces acked_psn = tx.psn - 1 and relies on the ACK_REQ send completion to drain the window, but in the state created by uct_ud_ep_crep_comp_wait() (ep connected by the simultaneous CREQ, CREP still only scheduled, dummy comp skb at psn == tx.psn) the bumped completion stays at the queue head with psn > acked_psn, so ucs_queue_for_each_extract() stops there and neither it nor the flush completion queued behind it is released. The user completion then waits for the CREP ack or the peer timeout (UD_TIMEOUT, default 30s), i.e. flush(CANCEL) (UCP force close) can stall on such an ep. Can we call uct_ud_ep_crep_comp_purge() in the CANCEL branch of uct_ud_ep_flush() as well?
There was a problem hiding this comment.
Right, the bumped completion blocked the window head after flush(CANCEL). Done in 7ec9414: the CANCEL branch of uct_ud_ep_flush() calls uct_ud_ep_crep_comp_purge() too. I did not add a test for it: the CREP stays unsent only without TX resources, and then flush() returns UCS_ERR_NO_RESOURCE before it gets to the window.
|
Coverage note: both new tests require |
flush(CANCEL) acknowledges the packets sent, but a completion moved to the PSN of the CREP which is not sent yet stayed in the window, and the flush completion behind it waited for the CREP ACK or the endpoint timeout.
|
🤖 Starting review — findings will be posted here when done. |
|
🤖 Review complete — no issues found. |
|
🤖 CI Triage Agent — Summary: Unable to fetch logs — cannot diagnose without them.
|
|
🤖 Starting review — findings will be posted here when done. |
| ep_check_comp.status = UCS_OK; | ||
| ep_check_count = 0; | ||
| ep_check_status = UCS_OK; | ||
| flush_comp.func = [](uct_completion_t*) {}; |
There was a problem hiding this comment.
pls align these with the assignment block above and add the space before *; .clang-format has AlignConsecutiveAssignments: true and PointerAlignment: Right, so the format code CI job will report a diff on these 3 lines.
| flush_comp.func = [](uct_completion_t*) {}; | |
| flush_comp.func = [](uct_completion_t *) {}; | |
| flush_comp.count = 1; | |
| flush_comp.status = UCS_OK; |
(All 8 assignments from ep_check_comp.func down to flush_comp.status are one consecutive run with no blank line, so clang-format aligns = to the column set by ep_check_comp.status.)
|
🤖 Starting review — findings will be posted here when done. |
|
/build |
| ASSERT_EQ(UCS_INPROGRESS, uct_ep_check(m_e1->ep(0), 0, &ep_check_comp)); | ||
|
|
||
| /* No TX resources on m_e1: its CREP stays scheduled */ | ||
| tx_available = iface(m_e1)->tx.available; |
There was a problem hiding this comment.
In ep_check_simultaneous_creq_destroy: can we reclaim the CREQ send credit first, as in ep_check_simultaneous_creq_cancel?
| tx_available = iface(m_e1)->tx.available; | |
| /* Reclaim the local CREQ send credit before hiding the TX resources. */ | |
| short_progress_loop(); | |
| tx_available = iface(m_e1)->tx.available; | |
| iface(m_e1)->tx.available = 0; |
On devices with ordered_send_comp=0 (EFA) every send is signaled, so poll_tx() during validate_connect() returns the CREQ credit, the CREP gets sent and ASSERT_TRUE(..., UCT_UD_EP_OP_CREP) fails.
Impact: test-only flakiness, limited to transports where each send generates a CQE (uct_ud_verbs_post_send() forces IBV_SEND_SIGNALED when !dev->ordered_send_comp); on mlx5/IB the first CREQ is unsignaled (UCT_UD_TX_MODERATION=64), so the current code passes there.
There was a problem hiding this comment.
Done in f19d2fd: the destroy test reclaims the CREQ send credit before hiding the TX resources, as the cancel test does.
|
minor: pls update the |
Poll the CREQ send completion in ep_check_simultaneous_creq_destroy before hiding the TX resources, as ep_check_simultaneous_creq_cancel does. Where every send is signaled, the completion polled later in validate_connect() returned the credit and the CREP was sent. Also add the space before '*' in the cancel test's completion lambda.
|
🤖 Starting review — findings will be posted here when done. |
|
🤖 Review complete — no issues found. |
|
🤖 CI Triage Agent — TL;DR: The BlueField ASan job failed on a LeakSanitizer report (68 KB in 17 allocations), not on the PR's UD code: Full analysisSummary: Root cause: All 17 leak stacks come from objects allocated while setting up that one test:
A leaked wireup proxy + its Implicated commit: unknown (not the PR commit). Most likely candidates in the touched area: File: test/gtest/ucp/test_ucp_proto_mock.cc:5029-5035 ( Suggested fix:
Related: PR #12409 (the PR under test, unrelated to the failure); #11901 (test_port_speed robustness); #12360 (close endpoints by force on worker destroy); #12334 / #12362 (measured path bandwidth); #12206 (skip slow BW lanes during pairwise selection)
|
|
🤖 Starting review — findings will be posted here when done. |
|
🤖 Review complete — no issues found. |
89d2ec0 to
f19d2fd
Compare
What
An endpoint check on a UD endpoint no longer completes when a simultaneous CREQ from the peer is handled as the ACK of our CREQ. The check now waits for the ACK of our CREP.
Why
A simultaneous CREQ shows only that we received the peer's packet, not that the peer received ours. UCP gates the recovery of a failed lane by such a check on an aux UD endpoint. When a link drops the packets of one side only, the probe of that side completed on the peer's CREQ, so the side put the lane back while its packets were still dropped. The lane then failed again and flapped.
On a NIXL disaggregated-inference test (KV cache PUSH, fault tolerance on, one NIC plane of the prefill node drops its TX traffic), the flapping lane stalled KV transfers for 35-40 s at a time while the drop lasted: -50% to -83% tok/s/GPU. With this fix, throughput during the drop is the same as with KV PULL (187k vs 108k tok/s/GPU before the fix), and no requests fail.
How
uct_ud_ep_crep_comp_wait(): before the incoming CREQ is handled as the ACK of our CREQ, move the completions waiting for our CREQ to the PSN of our CREP.uct_ud_ep_crep_comp_purge(): a purge drops the CREP that is not sent yet, so it releases those completions with the packets sent.test_ud.ep_check_simultaneous_creq_tx_lostandtest_ud.ep_check_simultaneous_creq_destroy.