Skip to content

UCP/RNDV: Skip PUT fence for ordered transports - #11673

Merged
roiedanino merged 7 commits into
openucx:masterfrom
roiedanino:issue-5125813-fence-fix-master
Jul 23, 2026
Merged

roiedanino merged 7 commits into
openucx:masterfrom
roiedanino:issue-5125813-fence-fix-master

Conversation

@roiedanino

@roiedanino roiedanino commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

What?

Skip the redundant rendezvous PUT fence before ATP only when every data lane advertises PUT-to-AM ordering.

Why?

PR #10658 enabled STRONG_ORDER for fenced RDMA writes when DDP ordering is enabled. On ordered IB transports, ATP receive completion is observed only after preceding PUT data placement, so the explicit fence is unnecessary. If that fence remains pending, a later unrelated PUT can inherit STRONG_ORDER.

Other transports, such as SRD, may require the fence, so UCP must not assume IB ordering semantics globally.

How?

  • Add the UCT_IFACE_FLAG_PUT_AM_ORDER transport capability.
  • Advertise the capability on RC-family interfaces.
  • Send ATP directly on the data lanes only when every data lane advertises the capability.
  • Preserve the existing fenced or flushed fallback for other transports and configurations.

Fixes Redmine #5125813

@roiedanino
roiedanino marked this pull request as ready for review July 19, 2026 14:11
Comment thread src/uct/ib/mlx5/rc/rc_mlx5_iface.c Resolved
@roiedanino
roiedanino force-pushed the issue-5125813-fence-fix-master branch from a633734 to 7b128fe Compare July 19, 2026 15:32
gleon99
gleon99 previously approved these changes Jul 19, 2026
@roiedanino
roiedanino enabled auto-merge (squash) July 20, 2026 06:53
Comment thread src/uct/ib/mlx5/rc/rc_mlx5.inl Resolved
Comment thread src/uct/ib/rc/base/rc_ep.h Resolved
@gleon99

gleon99 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

@Artemy-Mellanox @roiedanino please converge on the review, so that we can proceed with this one. Thanks!

@roiedanino
roiedanino force-pushed the issue-5125813-fence-fix-master branch 2 times, most recently from 129f474 to caabfc2 Compare July 21, 2026 11:22
UCP rendezvous PUT sends ATP on the same data lanes, where receive completion preserves PUT/ATP ordering. Remove the redundant fence so it cannot remain pending until an unrelated PUT.

Keep STRONG_ORDER for fenced RDMA writes when DDP ordering requires it, and use the regular PCI-atomic fence flag for non-PUT operations.

Signed-off-by: Roie Danino <rdanino@nvidia.com>
@roiedanino
roiedanino force-pushed the issue-5125813-fence-fix-master branch from caabfc2 to 5960f15 Compare July 21, 2026 14:24
@roiedanino roiedanino changed the title UCT/IB/MLX5: Limit strong ordering to PUT fences UCP/RNDV: Remove redundant PUT fence before ATP Jul 22, 2026
@shasson5

Copy link
Copy Markdown
Contributor

@Artemy-Mellanox can prioritize? it's urgent for 1.22 release

@Artemy-Mellanox

Copy link
Copy Markdown
Contributor

@Artemy-Mellanox can prioritize? it's urgent for 1.22 release

@yosefe can you take a look - fence is really redundant? how PUT/SEND work with OOO All ordering semantics?

@gleon99

gleon99 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

@Artemy-Mellanox can prioritize? it's urgent for 1.22 release

@yosefe can you take a look - fence is really redundant? how PUT/SEND work with OOO All ordering semantics?

Confirmed for CX‑8 OOO_ALL: SEND may arrive/scatter OOO, but the responder CQE is withheld until preceding messages, including RDMA WRITE data placement, complete.

UCX processes ATP only from that RX CQE, so the same-lane PUT is complete before ATP is observed. The explicit fence is therefore redundant for PUT→SEND; strong ordering is still required for fenced WRITE→WRITE.
@yosefe wdyt?

@shasson5

Copy link
Copy Markdown
Contributor

@gleon99 can approve?

@yosefe yosefe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems this PR is making UCP layer assume that C+UCT transport is IB with DDP, which is not always the case

@gleon99

gleon99 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Seems this PR is making UCP layer assume that C+UCT transport is IB with DDP, which is not always the case

This change is indeed too broad. Although it is safe for all IB, it isn't for SRD. Maybe introduce UCT ordering cap? @yosefe @Artemy-Mellanox

…ce-fix-master

Signed-off-by: Roie Danino <rdanino@nvidia.com>
Signed-off-by: Roie Danino <rdanino@nvidia.com>
@roiedanino roiedanino changed the title UCP/RNDV: Remove redundant PUT fence before ATP UCP/RNDV: Skip PUT fence for ordered transports Jul 23, 2026
@roiedanino

roiedanino commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor Author

@Artemy-Mellanox

I added a UCT capability flag for advertising the ordering guarantee of AM after PUT, advertised only by RC transport, so the fence will still be used by other transports

Can you please review again?

Comment thread test/gtest/ucp/test_ucp_request.cc Outdated
return (req->flags & UCP_REQUEST_FLAG_PROTO_SEND) &&
(req->send.proto_stage ==
UCP_PROTO_RNDV_PUT_STAGE_FENCED_ATP);
UCP_PROTO_RNDV_PUT_STAGE_ATP);

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.

maybe add srd TLS for full coverage?

Signed-off-by: Roie Danino <rdanino@nvidia.com>
Signed-off-by: Roie Danino <rdanino@nvidia.com>
@roiedanino
roiedanino enabled auto-merge (squash) July 23, 2026 11:11
@roiedanino
roiedanino merged commit 9a06403 into openucx:master Jul 23, 2026
161 checks passed
@roiedanino
roiedanino deleted the issue-5125813-fence-fix-master branch July 23, 2026 14:15
roiedanino added a commit to roiedanino/ucx that referenced this pull request Jul 23, 2026
Add UCT_IFACE_FLAG_PUT_AM_ORDER and select direct ATP only when every
RNDV data lane provides this capability. Preserve the fenced fallback
for SRD and mixed ordered/unordered lanes.

Add protocol coverage for the ordered path, unordered fallback, and
explicit SRD transport.

---------

Signed-off-by: Roie Danino <rdanino@nvidia.com>
(cherry picked from commit 9a06403)
roiedanino added a commit that referenced this pull request Jul 23, 2026
)

UCP/RNDV: Skip PUT fence for ordered transports (#11673)

Add UCT_IFACE_FLAG_PUT_AM_ORDER and select direct ATP only when every
RNDV data lane provides this capability. Preserve the fenced fallback
for SRD and mixed ordered/unordered lanes.

Add protocol coverage for the ordered path, unordered fallback, and
explicit SRD transport.

---------


(cherry picked from commit 9a06403)

Signed-off-by: Roie Danino <rdanino@nvidia.com>
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.

5 participants