-
Notifications
You must be signed in to change notification settings - Fork 169
UCX/BACKEND: Add internal connection establishment #819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
cb389d9
d966742
521d29d
54d6383
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1248,6 +1248,8 @@ nixl_status_t nixlUcxEngine::loadRemoteConnInfo (const std::string &remote_agent | |||||
|
|
||||||
| remoteConnMap.insert({remote_agent, conn}); | ||||||
|
|
||||||
| performConnectionEstablishment(remote_agent, conn); | ||||||
|
|
||||||
| return NIXL_SUCCESS; | ||||||
| } | ||||||
|
|
||||||
|
|
@@ -1817,3 +1819,33 @@ nixl_status_t nixlUcxEngine::genNotif(const std::string &remote_agent, const std | |||||
| } | ||||||
| return NIXL_SUCCESS; | ||||||
| } | ||||||
|
|
||||||
| void | ||||||
| nixlUcxEngine::performConnectionEstablishment( | ||||||
| const std::string &remote_agent, | ||||||
| const std::shared_ptr<nixlUcxConnection> &conn) const { | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Or pass just endpoints. |
||||||
| NIXL_DEBUG << "Establishing connection with " << remote_agent; | ||||||
|
|
||||||
| // Flush all endpoints to ensure connection establishment | ||||||
| // and avoid UCS_ERR_NOT_CONNECTED errors during data transfers | ||||||
|
Comment on lines
+1829
to
+1830
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To me it looks like trying to move workaround from user level to ucx backend instead of fixing UCP API, UCP EP should not return NOT_CONNECTED to avoid blocking on any level. Instead, the request should go on pending until completion as any other operation posted on UCP EP. |
||||||
| for (size_t i = 0; i < conn->eps.size(); ++i) { | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think flush without any previous request could complete without endpoint being connected. if confirmed, we could first send dummy op, then start flush |
||||||
| nixlUcxReq req; | ||||||
| nixl_status_t ret = conn->eps[i]->flushEp(req); | ||||||
tstamler marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since it is ucx engine api, i think it would be safer to start all the flush operations, then progress all flush requests in another loop, for the case where we would have inter-dependency somehow. |
||||||
|
|
||||||
| if (ret == NIXL_IN_PROG) { | ||||||
| nixlUcxWorker *worker = getWorker(i).get(); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||
| do { | ||||||
| ret = worker->test(req); | ||||||
| } while (ret == NIXL_IN_PROG); | ||||||
|
|
||||||
| worker->reqRelease(req); | ||||||
| } | ||||||
|
|
||||||
| if (ret != NIXL_SUCCESS) { | ||||||
| NIXL_WARN << "Failed to flush endpoint " << i << " for " << remote_agent | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. return error |
||||||
| << ", status: " << ret; | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| NIXL_DEBUG << "Connection establishment completed for " << remote_agent; | ||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handle possible failure