Skip to content

Active Message APIs: support scatter-gather I/O and user-defined header data (Part 2: Python APIs)#595

Open
grlee77 wants to merge 32 commits intorapidsai:mainfrom
grlee77:grelee/ucxx-iov-updates-python
Open

Active Message APIs: support scatter-gather I/O and user-defined header data (Part 2: Python APIs)#595
grlee77 wants to merge 32 commits intorapidsai:mainfrom
grlee77:grelee/ucxx-iov-updates-python

Conversation

@grlee77
Copy link
Copy Markdown
Contributor

@grlee77 grlee77 commented Feb 18, 2026

Please review #594 first as those C++ changes are also included here.

See the description in that MR for the motivation for these features. This PR adds Python APIs corresponding to the C++ enhancements made there.

As for the C++ APIs, the changes here have backwards compatible defaults (memory_type_policy=None, user_header=None).

In order to preserve the existing function signature of Endpoint.am_recv a new Endpoint.am_recv_with_header was added if the user needs the custom user_header support. Another API option would be adding a new boolean flag like return_header=False to the existing method signature, but then the return type is not always the same. I thought it may be cleaner to just provide a separate method.

The majority of the lines added here are in test cases.

add test for strict memory policy unsupported-path
The std::visit lambda was taking data::AmSend amSend by value, creating a temporary copy.
For IOV sends, sendBuffer pointed to amSend._iov.data() — the
copy's vector storage. When the lambda returned, the copy was destroyed, but ucp_am_send_nbx
is async and still needed the IOV descriptors, causing a use-after-free. Changed to const data::AmSend&
amSend so it references the original data in _requestData, which lives as long as the RequestAm object.

Add UCP_OP_ATTR_FIELD_DATATYPE so UCX doesn't ignore the .datatype field
this is needed to include host-side information on tensor shape, strides, dtype etc when using I/O Vector (iov) APIs
@grlee77 grlee77 requested review from a team as code owners February 18, 2026 17:43
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot bot commented Feb 18, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@grlee77 grlee77 force-pushed the grelee/ucxx-iov-updates-python branch from 7e0d5bc to 9cc3dc7 Compare February 25, 2026 15:33
@grlee77 grlee77 force-pushed the grelee/ucxx-iov-updates-python branch from 9cc3dc7 to c517f79 Compare February 26, 2026 23:10
@pentschev pentschev added non-breaking Introduces a non-breaking change ucxx feature request New feature or request labels Mar 3, 2026
@pentschev
Copy link
Copy Markdown
Member

/ok to test 92e8aac

@pentschev
Copy link
Copy Markdown
Member

/ok to test efa8f07

@pentschev
Copy link
Copy Markdown
Member

/ok to test 12ae26d

@pentschev
Copy link
Copy Markdown
Member

/ok to test 26f0f71

@pentschev
Copy link
Copy Markdown
Member

/ok to test 02a29ce

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

Labels

feature request New feature or request non-breaking Introduces a non-breaking change ucxx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants