-
Notifications
You must be signed in to change notification settings - Fork 181
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
18c020f
61720cb
a3adf61
f44875f
7085751
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 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -20,6 +20,16 @@ | |||||||||
| #include <nixl_types.h> | ||||||||||
| #include <ucp/api/device/ucp_device_impl.h> | ||||||||||
|
|
||||||||||
| /* Helper macro to print a message from NIXL device function including the | ||||||||||
| * thread and block indices, file, line, and function */ | ||||||||||
| #define nixl_device_printf(_title, _fmt, ...) \ | ||||||||||
| printf("(%5d:%5d) %5s %s:%d %s: " _fmt "\n", threadIdx.x, blockIdx.x, _title, \ | ||||||||||
|
||||||||||
| __FILE__, __LINE__, __func__, ##__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; | ||||||||||
| }; | ||||||||||
|
|
@@ -66,7 +76,7 @@ nixlGpuConvertUcsStatus(ucs_status_t status) { | |||||||||
| if (!UCS_STATUS_IS_ERR(status)) { | ||||||||||
| return NIXL_SUCCESS; | ||||||||||
| } | ||||||||||
| printf("UCX returned error: %d\n", status); | ||||||||||
| nixl_device_error("UCX backend error"); | ||||||||||
rakhmets marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||
| return NIXL_ERR_BACKEND; | ||||||||||
| } | ||||||||||
|
|
||||||||||
|
|
@@ -242,6 +252,7 @@ nixlGpuGetXferStatus(nixlGpuXferStatusH &xfer_status) { | |||||||||
| case UCS_INPROGRESS: | ||||||||||
| return NIXL_IN_PROG; | ||||||||||
| default: | ||||||||||
| nixl_device_error("UCX backend error"); | ||||||||||
| return NIXL_ERR_BACKEND; | ||||||||||
| } | ||||||||||
| } | ||||||||||
|
|
||||||||||
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.
title -> level
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.
renamed to log_level