-
Notifications
You must be signed in to change notification settings - Fork 183
DEVICE/API: Add NIXL device-side logging infrastructure #886
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
5
commits into
ai-dynamo:main
Choose a base branch
from
michal-shalev:nixl-device-logging
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
5 commits
Select commit
Hold shift + click to select a range
18c020f
DEVICE/API: Add NIXL device-side logging infrastructure
michal-shalev 61720cb
DEVICE/API: Align to NIXL log
michal-shalev a3adf61
Merge branch 'main' into nixl-device-logging
michal-shalev f44875f
DEVICE/API: call ucs_device_status_string
michal-shalev 7085751
Merge branch 'main' into nixl-device-logging
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
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
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -20,6 +20,27 @@ | |||||||||
| #include <nixl_types.h> | ||||||||||
| #include <ucp/api/device/ucp_device_impl.h> | ||||||||||
|
|
||||||||||
| /* Helper function to extract the base filename */ | ||||||||||
| __device__ __forceinline__ static const char* nixl_device_basefile(const char* path) { | ||||||||||
| const char* base = path; | ||||||||||
| for (const char* p = path; *p; ++p) { | ||||||||||
| if (*p == '/') { | ||||||||||
| base = p + 1; | ||||||||||
| } | ||||||||||
| } | ||||||||||
| return base; | ||||||||||
| } | ||||||||||
|
|
||||||||||
| /* Helper macro to print a message from NIXL device function including the | ||||||||||
| * thread and block indices, file and line */ | ||||||||||
| #define nixl_device_printf(_log_level, _fmt, ...) \ | ||||||||||
| printf("%c T%-4d:B%-4d%*s%s:%d] " _fmt "\n", _log_level[0], threadIdx.x, blockIdx.x, \ | ||||||||||
| 17, "", nixl_device_basefile(__FILE__), __LINE__, ##__VA_ARGS__) | ||||||||||
|
|
||||||||||
| /* Print an error message from NIXL device function */ | ||||||||||
| #define nixl_device_error(_fmt, ...) \ | ||||||||||
| nixl_device_printf("ERROR", _fmt, ##__VA_ARGS__) | ||||||||||
|
Comment on lines
+41
to
+42
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.
Suggested change
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es32-use-all_caps-for-all-macro-names |
||||||||||
|
|
||||||||||
| struct nixlGpuXferStatusH { | ||||||||||
| ucp_device_request_t device_request; | ||||||||||
| }; | ||||||||||
|
|
@@ -67,7 +88,7 @@ nixlGpuConvertUcsStatus(ucs_status_t status) { | |||||||||
| if (!UCS_STATUS_IS_ERR(status)) { | ||||||||||
| return NIXL_IN_PROG; | ||||||||||
| } | ||||||||||
| printf("UCX returned error: %d\n", status); | ||||||||||
| nixl_device_error("UCX backend error: %s", ucs_device_status_string(status)); | ||||||||||
| return NIXL_ERR_BACKEND; | ||||||||||
| } | ||||||||||
|
|
||||||||||
|
|
@@ -247,6 +268,7 @@ nixlGpuGetXferStatus(nixlGpuXferStatusH &xfer_status) { | |||||||||
| case UCS_INPROGRESS: | ||||||||||
| return NIXL_IN_PROG; | ||||||||||
| default: | ||||||||||
| nixl_device_error("UCX backend error: %s", ucs_device_status_string(status)); | ||||||||||
| return NIXL_ERR_BACKEND; | ||||||||||
| } | ||||||||||
| } | ||||||||||
|
|
||||||||||
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.
The opening square bracket is missing.