-
Notifications
You must be signed in to change notification settings - Fork 53
Add support to query UCP debug info from requests #437
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
pentschev
wants to merge
53
commits into
rapidsai:main
Choose a base branch
from
pentschev:request-stats
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.
Open
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
3e40312
Add capability method to query worker attributes
pentschev 0f20908
Add tests for
pentschev f9ee756
Add method to debug information
pentschev e77c9be
Cache attributes before completion
pentschev a5f6b9b
[WIP] Always enable debug info
pentschev 34b805c
Improve query, add user-facing getter
pentschev a752fcc
Merge remote-tracking branch 'upstream/main' into request-stats
pentschev 11ce3cf
Merge remote-tracking branch 'upstream/main' into request-stats
pentschev 8d805a3
Merge remote-tracking branch 'upstream/main' into request-stats
pentschev 48f833d
Merge remote-tracking branch 'upstream/main' into request-stats
pentschev 5dee52f
Merge remote-tracking branch 'upstream/main' into request-stats
pentschev 4becdab
Add requestAttributes to ucxx::experimental::WorkerBuilder
pentschev cd13fc5
Improve tests
pentschev dc3445e
Query request attributes for other request types, add tests
pentschev d51f844
Make request-attribute querying race-free via lock-coordinated free
pentschev 15b086e
Skip ProgressTag configurations that have no UCP request to query
pentschev 174fb40
Reorganize tag tests
pentschev 68fd787
Merge remote-tracking branch 'upstream/main' into request-stats-dev
pentschev 612c4bc
Fix rendezvous threshold skip conditions
pentschev 718b464
Test for expected substring
pentschev 95407ab
Test stream send/recv attributes against per-direction substrings
pentschev 07f8c48
Test cleanup
pentschev 588e4f3
Accept either outcome on stream recv attribute query
pentschev 771bbb7
Make ProgressTagRequestAttributesDisabled non-parameterized
pentschev 110049e
Add disabled-attribute tests for Stream/AM/MemoryGet/MemoryPut
pentschev 08f1832
Add MemoryPutRequestAttributes test
pentschev 247bd82
Restore inclusive rndv threshold in AM allocator-type assertion
pentschev 6e02049
Tighten attribute-test eager skip for Tag and AM to strict-less-than
pentschev 600c9c7
Make attribute tests transport-agnostic via lenient assertions
pentschev da13cbf
Merge remote-tracking branch 'upstream/main' into request-stats
pentschev 53e4b9b
Return a C++ struct from Worker::queryAttributes and query every field
pentschev 91165e6
Align attribute APIs as getAttributes() and class-nested Attributes
pentschev d795703
Merge remote-tracking branch 'upstream/main' into request-stats
pentschev 6691758
Cancel inflight requests and submit force-close atomically in a singl…
41d80c2
Fix invalid _handle usage
16091bd
Rename getAttributes back to queryAttributes
2e6310a
Throw ucxx::NoElemError from Request::queryAttributes
be015a1
Split disabled vs runtime-unavailable in Request::queryAttributes
ed307b3
Drop redundant status field from Request::Attributes
024561b
Revert "Fix invalid _handle usage"
pentschev 9cd6e1f
Revert "Cancel inflight requests and submit force-close atomically in…
pentschev 5502e7a
Cleanup
pentschev 9513942
Merge remote-tracking branch 'origin/request-stats' into request-stats
pentschev 3716e5d
Docstring cleanup
pentschev d2a60b0
Fix noexcept mismatch on Worker::isRequestAttributesEnabled
pentschev 6cd44e5
Use memoryType sentinel instead of _isRequestAttrValid flag
pentschev a37d5e0
Inline queryRequestAttributes into publishRequest
pentschev 3e92f4b
Move enabled-check before mutex in publishRequest and queryAttributes
pentschev a1a5c17
Move debug string into cached attribute instead of copying
pentschev e0e389e
Merge remote-tracking branch 'upstream/main' into request-stats
pentschev f1d488d
Fix outdated variable name
pentschev 0c35d5e
More fixes
pentschev 8dfa5aa
Increase C++ test timeout
pentschev 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
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
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
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 |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| * SPDX-License-Identifier: BSD-3-Clause | ||
| */ | ||
| #include <chrono> | ||
| #include <cstring> | ||
| #include <memory> | ||
| #include <sstream> | ||
| #include <string> | ||
|
|
@@ -140,20 +141,18 @@ void Request::callback(void* request, ucs_status_t status) | |
| if (_status != UCS_INPROGRESS) | ||
| ucxx_trace_req_f(_ownerString.c_str(), | ||
| this, | ||
| _request, | ||
| request, | ||
| _operationName.c_str(), | ||
| "has status already set to %d (%s), callback setting %d (%s)", | ||
| _status, | ||
| ucs_status_string(_status), | ||
| status, | ||
| ucs_status_string(status)); | ||
|
|
||
| if (UCS_PTR_IS_PTR(_request)) ucp_request_free(request); | ||
|
|
||
| ucxx_trace_req_f(_ownerString.c_str(), this, _request, _operationName.c_str(), "completed"); | ||
| ucxx_trace_req_f(_ownerString.c_str(), this, request, _operationName.c_str(), "completed"); | ||
| setStatus(status); | ||
| ucxx_trace_req_f( | ||
| _ownerString.c_str(), this, _request, _operationName.c_str(), "isCompleted: %d", isCompleted()); | ||
| _ownerString.c_str(), this, request, _operationName.c_str(), "isCompleted: %d", isCompleted()); | ||
| } | ||
|
|
||
| void Request::process() | ||
|
|
@@ -235,11 +234,69 @@ void Request::setStatus(ucs_status_t status) | |
| _ownerString.c_str(), this, _request, _operationName.c_str(), "invoking user callback"); | ||
| _callback(status, _callbackData); | ||
| } | ||
|
|
||
| // Free the UCP request inside the lock so it is mutually exclusive with | ||
| // `publishRequest()`/`queryRequestAttributes()` on the submit thread. | ||
| if (UCS_PTR_IS_PTR(_request)) { | ||
|
pentschev marked this conversation as resolved.
|
||
| ucp_request_free(_request); | ||
| _request = nullptr; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| const std::string& Request::getOwnerString() const { return _ownerString; } | ||
|
|
||
| void Request::publishRequest(void* request) | ||
| { | ||
| if (!_worker->isRequestAttributesEnabled()) { | ||
| std::lock_guard<std::recursive_mutex> lock(_mutex); | ||
| _request = request; | ||
| return; | ||
| } | ||
|
|
||
| std::lock_guard<std::recursive_mutex> lock(_mutex); | ||
| _request = request; | ||
|
|
||
| if (_requestAttr.memoryType != UCS_MEMORY_TYPE_UNKNOWN) return; | ||
|
|
||
| ucp_request_attr_t result; | ||
|
|
||
| auto worker_attr = _worker->queryAttributes(); | ||
|
|
||
| std::string debugString(worker_attr.maxDebugString, '\0'); | ||
|
|
||
| result.field_mask = UCP_REQUEST_ATTR_FIELD_MEM_TYPE | UCP_REQUEST_ATTR_FIELD_INFO_STRING | | ||
| UCP_REQUEST_ATTR_FIELD_INFO_STRING_SIZE; | ||
|
|
||
| result.debug_string = debugString.data(); | ||
| result.debug_string_size = debugString.size(); | ||
|
|
||
| if (UCS_PTR_IS_PTR(_request)) { | ||
| auto queryStatus = ucp_request_query(_request, &result); | ||
| if (queryStatus == UCS_OK && result.debug_string != nullptr) { | ||
| debugString.resize(std::strlen(debugString.c_str())); | ||
| _requestAttr.debugString = std::move(debugString); | ||
| _requestAttr.memoryType = result.mem_type; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| Request::Attributes Request::queryAttributes() | ||
| { | ||
| if (!_worker->isRequestAttributesEnabled()) | ||
| throw ucxx::UnsupportedError( | ||
| "Request attributes querying is disabled on the owning worker; build the worker " | ||
| "with `ucxx::experimental::WorkerBuilder::requestAttributes(true)` to enable it"); | ||
|
Comment on lines
+286
to
+289
Contributor
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. Again, move this before grabbing the lock.
Member
Author
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. Done in 3e92f4b . |
||
|
|
||
| std::lock_guard<std::recursive_mutex> lock(_mutex); | ||
|
|
||
| if (_requestAttr.memoryType != UCS_MEMORY_TYPE_UNKNOWN) return _requestAttr; | ||
|
|
||
| throw ucxx::NoElemError( | ||
| "Request attributes are not available for this request: UCX took an inline-completion " | ||
| "path with no queryable UCP request, or the request has not completed yet"); | ||
| } | ||
|
|
||
| std::shared_ptr<Buffer> Request::getRecvBuffer() { return nullptr; } | ||
|
|
||
| std::string Request::getRecvHeader() { return {}; } | ||
|
|
||
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Some of the slow runners are already running close to the current 10 minutes timeout (sample from last night ran from 07:19:36 until 07:28:13, for a total of 08:37 minutes), with the addition of new tests they occasionally do timeout.