Skip to content

API: Add getMappedPtrs#1098

Closed
michal-shalev wants to merge 4 commits intoai-dynamo:mainfrom
michal-shalev:add-mapped-ptr-api
Closed

API: Add getMappedPtrs#1098
michal-shalev wants to merge 4 commits intoai-dynamo:mainfrom
michal-shalev:add-mapped-ptr-api

Conversation

@michal-shalev
Copy link
Contributor

@michal-shalev michal-shalev commented Dec 9, 2025

PENDING openucx/ucx#11069 DO NOT MERGE YET

What?

Added getMappedPtrs API to expose UCX's direct access via ucp_rkey_ptr.

Why?

This API wraps ucp_rkey_ptr to expose direct pointer access when supported by the underlying UCX lane.

How?

  • Added nixlAgent::getMappedPtrs(nixlDlistH*, vector<void*>&)
  • Implemented nixl::ucx::rkey::getPtr() wrapper for ucp_rkey_ptr
  • Returns nullptr for lanes without direct access capability

@michal-shalev michal-shalev self-assigned this Dec 9, 2025
@michal-shalev michal-shalev requested review from a team, brminich, gleon99 and yosefe as code owners December 9, 2025 13:28
@copy-pr-bot
Copy link

copy-pr-bot bot commented Dec 9, 2025

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.

@github-actions
Copy link

github-actions bot commented Dec 9, 2025

👋 Hi michal-shalev! Thank you for contributing to ai-dynamo/nixl.

Your PR reviewers will review your contribution then trigger the CI to test your changes.

🚀

@michal-shalev michal-shalev marked this pull request as draft December 9, 2025 13:30
@michal-shalev michal-shalev force-pushed the add-mapped-ptr-api branch 6 times, most recently from e3ed790 to 1d7c07a Compare December 10, 2025 14:34
Signed-off-by: Michal Shalev <mshalev@nvidia.com>
Signed-off-by: Michal Shalev <mshalev@nvidia.com>
@michal-shalev michal-shalev marked this pull request as ready for review December 18, 2025 15:06
Signed-off-by: Michal Shalev <mshalev@nvidia.com>
Comment on lines +47 to +49
if (status == UCS_ERR_UNREACHABLE) {
return nullptr;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why don't we throw an exception in this case?
getMappedPtrs returns NIXL_SUCCESS, when every rkey::getPtr returns nullptr.

Comment on lines +1774 to +1775
NIXL_ERROR << "getMappedPtrs failed for descriptor " << i << ": " << e.what();
return NIXL_ERR_BACKEND;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we don't want to modify std::vector<void *> &ptrs in this case.

}

if (status == UCS_ERR_UNREACHABLE) {
return nullptr;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should just return ptr as ucp_rkey_ptr shouldn't modify it in case of error.

@michal-shalev
Copy link
Contributor Author

@brminich @yosefe @ofirfarjun7 @itayalroy
Closing this PR following the latest API discussions.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants