Skip to content

UCP/CORE: add failover support for put bcopy/short and am bcopy#11582

Open
jeynmann wants to merge 34 commits into
openucx:masterfrom
jeynmann:failover_ext_ucp_bcopy_short
Open

UCP/CORE: add failover support for put bcopy/short and am bcopy#11582
jeynmann wants to merge 34 commits into
openucx:masterfrom
jeynmann:failover_ext_ucp_bcopy_short

Conversation

@jeynmann

Copy link
Copy Markdown
Contributor

What?

Add UCP failover lane recovery and replay support for put bcopy/short and am bcopy/short .

Why?

Failover recovery needs to resend operations that were posted locally but not received by the peer before a lane failure.

How?

UCT extracted outstanding operations through uct_ep_op_info_t.

UCP owns a copy of each extracted operation and payload and selects a dedicated failover/replay proto. Currently AM replay requires AM_BCOPY; PUT replay requires PUT_SHORT or PUT_BCOPY and same-MD lanes.

@jeynmann
jeynmann force-pushed the failover_ext_ucp_bcopy_short branch from a65b2ea to 6305b16 Compare June 27, 2026 16:27
JeynmannZ added 2 commits July 2, 2026 12:16
Arm RC mlx5 endpoints before peer failure so error handling leaves outstanding sends available for extraction.

Suppress user completions while releasing CQ resources, and let endpoint destruction hand the failed QP to asynchronous garbage collection.
Verify that extraction reports posted operations in order and preserves the metadata needed by failover replay.
@jeynmann
jeynmann force-pushed the failover_ext_ucp_bcopy_short branch from 6305b16 to b5b5ca0 Compare July 2, 2026 10:07
JeynmannZ added 8 commits July 3, 2026 07:01
Use the failover-specific _ft suffix for the completion-backed PUT bcopy entry point and transport operation. Remove the redundant capability bit since availability follows QUERY_TOKEN support.
Organize extracted operation metadata by protocol parameter group, align field-mask ordering with the structure layout, and distinguish AM flags from flush parameters. Also align internal operation initializers touched by outstanding extraction support.
@jeynmann
jeynmann force-pushed the failover_ext_ucp_bcopy_short branch from b5b5ca0 to e9b8868 Compare July 6, 2026 13:09
@jeynmann jeynmann changed the title [WIP][DNM] UCP/CORE: add failover support for bcopy short UCP/CORE: add failover support for bcopy short Jul 6, 2026
JeynmannZ added 13 commits July 7, 2026 05:04
Exchange failed-lane state with the peer, extract outstanding transport operations, and coordinate endpoint reconfiguration before replay.

Introduce the failover endpoint lifecycle and baseline fault-tolerance coverage for AM zcopy recovery.
Convert owned UCT operation descriptors into internal replay requests and route them through normal UCP protocol selection.

Support extracted zcopy, bcopy, and short operations without exposing replay state outside failover recovery.
Move extracted and pending operations into one ordered replay queue before destroying failed lanes.

Keep requests active after successful ownership transfer, and fall back to regular discard when extraction cannot complete.
Advertise replay support for AM eager and PUT short/bcopy protocols when their candidate lanes are compatible with hardware PSN failover.

Preserve protocol-specific replay metadata for single- and multi-fragment operations.
Exercise AM and PUT single- and multi-fragment protocols with a saturated send queue so failover replays both undelivered and unposted operations.

Validate every received message and the final PUT payload after recovery.
JeynmannZ added 7 commits July 7, 2026 05:24
Use the common RMA operation state and completion callbacks for completion-backed PUT bcopy replay. Consolidate failure cleanup and remove failover-specific RMA state.
Consume the refined outstanding-operation field masks and data layout, validate the operation field, and read AM flags from the AM parameter group.
@jeynmann
jeynmann force-pushed the failover_ext_ucp_bcopy_short branch from e9b8868 to 4633700 Compare July 7, 2026 02:26
@jeynmann jeynmann changed the title UCP/CORE: add failover support for bcopy short UCP/CORE: add failover support for put bcopy/short and am bcopy Jul 7, 2026
@gleon99
gleon99 requested a review from evgeny-leksikov July 7, 2026 07:38
Comment on lines +1944 to +1955
if (ucs_unlikely(ep->super.failover_flags &
UCT_RC_EP_FAILOVER_FLAG_ARMED)) {
/* Ownership is deferred to extract; only release HW/CQ resources
* without invoking user completions. */
ucs_debug("ep %p: deferring tx completions for failover, hw ci %u "
"sw pi %u available %d",
ep, hw_ci, ep->tx.wq.sw_pi,
uct_rc_txqp_available(&ep->super.txqp));
uct_rc_mlx5_iface_update_tx_res(&iface->super, ep, hw_ci);
ucs_debug("ep %p: released failover tx resources, available %d", ep,
uct_rc_txqp_available(&ep->super.txqp));
uct_ib_mlx5_update_db_cq_ci(&iface->cq[UCT_IB_DIR_TX]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need invoke a user completion with error, and it's user's (UCP) responsibility to extract or convert failed CQE to a WQE which could be reposted according to RX tocken

Comment thread src/ucp/proto/proto.c
Comment on lines +106 to +108
[UCP_OP_ID_FAILOVER_AM_BCOPY] = "failover_am_bcopy",
[UCP_OP_ID_FAILOVER_PUT_SHORT] = "failover_put_short",
[UCP_OP_ID_FAILOVER_PUT_BCOPY] = "failover_put_bcopy",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need new ops?

Comment on lines +98 to +99
if ((op->info.field_mask & UCT_EP_OP_INFO_FIELD_COMP) &&
(op->info.comp != NULL)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would assume that if the field flag is set, the filed is valid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants