-
Notifications
You must be signed in to change notification settings - Fork 183
DEVICE/API: Wait for wireup completion in createGpuXferReq #947
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
Open
michal-shalev
wants to merge
22
commits into
ai-dynamo:main
Choose a base branch
from
michal-shalev:internal-wireup
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+56
−46
Open
Changes from 13 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
9b37338
DEVICE/API: Wait for wireup completion in createGpuXferReq
michal-shalev 0d8c1dc
PR fixes
michal-shalev 1b61b1d
UCP/DEVICE: PR fixes 2.0
michal-shalev 2df59ce
UCP/DEVICE: Fix clang format
michal-shalev dfcaf8e
Merge branch 'main' into internal-wireup
michal-shalev ac91a5b
UCP/DEVICE: PR fixes 3.0
michal-shalev 84cedc6
Store reference to nixlUcxWorker in nixlUcxEp
michal-shalev 9d6d121
PR fixes 4.0
michal-shalev 934a393
PR fixes 5.0
michal-shalev de41b6a
PR fixes 6.0
michal-shalev e9e0141
PR fixes 7.0
michal-shalev 2af20f1
PR fixes 8.0
michal-shalev 661090d
Merge branch 'main' into internal-wireup
brminich 173772b
Progress all workers
michal-shalev 63328a1
Increase timout to 5 seconds
michal-shalev e20bb50
Remove progress from createGpuXferReq (done in progress thread)
michal-shalev 1d3c40e
Add progress thread validation for GPU transfer requests
michal-shalev 9b3b1d8
Fix clang
michal-shalev 54226c3
PR fixes
michal-shalev aefb7a4
PR fixes
michal-shalev 6c29778
Fix clang
michal-shalev 495e741
Merge branch 'main' into internal-wireup
michal-shalev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,8 @@ | |
| #include "rkey.h" | ||
| #include "config.h" | ||
|
|
||
| #include <chrono> | ||
|
|
||
| extern "C" { | ||
| #ifdef HAVE_UCX_GPU_DEVICE_API | ||
| #include <ucp/api/device/ucp_host.h> | ||
|
|
@@ -33,6 +35,7 @@ namespace nixl::ucx { | |
|
|
||
| nixlGpuXferReqH | ||
| createGpuXferReq(const nixlUcxEp &ep, | ||
| nixlUcxWorker &worker, | ||
| const std::vector<nixlUcxMem> &local_mems, | ||
| const std::vector<const nixl::ucx::rkey *> &remote_rkeys, | ||
| const std::vector<uint64_t> &remote_addrs) { | ||
|
|
@@ -74,8 +77,21 @@ createGpuXferReq(const nixlUcxEp &ep, | |
| params.element_size = sizeof(ucp_device_mem_list_elem_t); | ||
| params.num_elements = ucp_elements.size(); | ||
|
|
||
| const auto start = std::chrono::steady_clock::now(); | ||
rakhmets marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| constexpr auto timeout = std::chrono::milliseconds(500); | ||
|
||
| ucp_device_mem_list_handle_h ucx_handle; | ||
| ucs_status_t ucs_status = ucp_device_mem_list_create(ep.getEp(), ¶ms, &ucx_handle); | ||
| ucs_status_t ucs_status; | ||
| // Workaround: loop until wireup is completed | ||
| while ((ucs_status = ucp_device_mem_list_create(ep.getEp(), ¶ms, &ucx_handle)) == | ||
michal-shalev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| UCS_ERR_NOT_CONNECTED) { | ||
| worker.progress(); | ||
|
|
||
| if (std::chrono::steady_clock::now() - start > timeout) { | ||
| throw std::runtime_error( | ||
| "Timeout waiting for endpoint wireup completion has been exceeded"); | ||
| } | ||
rakhmets marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| if (ucs_status != UCS_OK) { | ||
| throw std::runtime_error(std::string("Failed to create device memory list: ") + | ||
| ucs_status_string(ucs_status)); | ||
|
|
@@ -96,6 +112,7 @@ releaseGpuXferReq(nixlGpuXferReqH gpu_req) noexcept { | |
|
|
||
| nixlGpuXferReqH | ||
| createGpuXferReq(const nixlUcxEp &ep, | ||
| nixlUcxWorker &worker, | ||
| const std::vector<nixlUcxMem> &local_mems, | ||
| const std::vector<const nixl::ucx::rkey *> &remote_rkeys, | ||
| const std::vector<uint64_t> &remote_addrs) { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
can't we get it from nixlUcxEp?
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.
There's no worker in
nixlUcxEpclass currently. ThenixlUcxEpis created bynixlUcxWorker::connect(), which passes the rawucp_worker_hhandle to the endpoint constructor, but it's not saved.Getting the worker from the ep would require changing
nixlUcxEp.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.
Added
ucp_worker_hand a getter tonixlUcxEpThere 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.
decided to return to passing the worker
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.
resolved? @brminich