Skip to content

UCP/PROTO: Add option to force ZCOPY#11289

Open
tvegas1 wants to merge 4 commits intoopenucx:masterfrom
tvegas1:ucp_force_zcopy
Open

UCP/PROTO: Add option to force ZCOPY#11289
tvegas1 wants to merge 4 commits intoopenucx:masterfrom
tvegas1:ucp_force_zcopy

Conversation

@tvegas1
Copy link
Copy Markdown
Contributor

@tvegas1 tvegas1 commented Mar 24, 2026

What?

Add UCX_RMA_FORCE_ZCOPY=y, only allow zero-copy RMA protocols when set, and print explicit error message in case missing such capability.

Why?

Users need to be able to quickly identify when they are not using the optimal zero-copy path.

How?

Disable emulated protocols and print error message on connected protocol reconfig selection.

@tvegas1 tvegas1 requested a review from brminich March 25, 2026 14:45
ucs_memory_type_t local_mem_type, remote_mem_type;

if (!ep->worker->context->config.ext.rma_force_zcopy ||
(req->send.rma.rkey == 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.

why is this check needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

actually, it's no needed as rma should always have rkey


/* This protocol should not be selected for valid and connected endpoint */
if (ep->flags & UCP_EP_FLAG_REMOTE_CONNECTED) {
if (ucp_proto_reconfig_report_rma_force_zcopy_no_proto(req, ep)) {
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.

should we also abort request?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it is aborted with canceled status inside this function, you prefer to take the abort call out of this function?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

moved it outside

test_ucp_rma_force_zcopy()
{
modify_config("RMA_FORCE_ZCOPY", "y");
modify_config("IB_TX_INLINE_RESP", "0", SETENV_IF_NOT_EXIST);
Copy link
Copy Markdown
Contributor Author

@tvegas1 tvegas1 Apr 2, 2026

Choose a reason for hiding this comment

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

@brminich, with that configuration, cap.get.min_zcopy=1, and proto selection multi rail makes the smallest size proportionate to the number of rails, so 2 with this IB device (max rail is set to 2 in this test), so for sizes < number of rails, we would need emulation currently.

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.

2 participants