feat: Add log callback option to tritonserver C and Python APIs - #504
Conversation
…into spolisetty/tri-1194-integrate-triton-logging-into-dynamo
whoisj
left a comment
There was a problem hiding this comment.
Looking good. I have a quesion.
…o' of https://github.com/triton-inference-server/core into spolisetty/tri-1194-integrate-triton-logging-into-dynamo
|
Need to add new stub to |
Good catch, added the |
|
Looks like some agent reviews were posted accidentally😅. |
Co-authored-by: Yingge He <157551214+yinggeh@users.noreply.github.com>
Co-authored-by: Yingge He <157551214+yinggeh@users.noreply.github.com>
Co-authored-by: Yingge He <157551214+yinggeh@users.noreply.github.com>
Co-authored-by: Yingge He <157551214+yinggeh@users.noreply.github.com>
Co-authored-by: Yingge He <157551214+yinggeh@users.noreply.github.com>
Co-authored-by: Yingge He <157551214+yinggeh@users.noreply.github.com>
Co-authored-by: Yingge He <157551214+yinggeh@users.noreply.github.com>
Greptile SummaryThis PR exposes the common-layer log callback through Triton's public C and Python APIs, allowing embedding applications to intercept structured log records instead of parsing formatted stderr/file output. The callback is staged on the options object and installed atomically in
Confidence Score: 5/5The change is safe to merge. GIL management is correct in both the trampoline and PyServer constructor, the callback lifetime design is intentional and commented, and the level mapping covers all known log levels. The implementation is internally consistent: the GIL is released during TRITONSERVER_ServerNew to prevent deadlock, the trampoline properly acquires the GIL before calling into Python, exceptions are correctly caught at the C boundary, and callback installation is atomic with respect to worker-thread startup. The level-mapping switch in src/tritonserver.cc is the one spot worth a second look — its default case will silently reclassify any log level added to the common library in the future as INFO. Important Files Changed
Reviews (4): Last reviewed commit: "Undo last commit" | Re-trigger Greptile |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Exposes the new common-layer callback through Triton's public APIs: a
TRITONSERVER_ServerOptionsSetLogCallbackC API and alog_callbackfield on the PythonOptions.CI: triton-inference-server/server#8858