-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Exposing trace context to python backend #6985
Conversation
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.
Nice work 🚀
* Added TRITONSERVER_InferenceTraceSetContext logic
@@ -0,0 +1,46 @@ | |||
import numpy as np |
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.
@oandreeva-nv do we need a copyright statement for this file?
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.
Good catch, will follow up shortly
The purpose of this PR:
This PR is a Stage 1 towards adding an ability for users to create custom traces in python backend.
This set of PRs is heavily focused on OpenTelemetry trace mode.
Functionality:
PrepareTraceContext
and attaches it to TRITONSERVER_InferenceTrace instance throughTRITONSERVER_InferenceTraceSetContex
at the moment in time, whenREQUEST_START
callback happens. That one is happening from the core side, so when PBE model starts execution, it should have context attached to its trace.traceparent
: "..." andtracestate
: "...". Some of you may know about them from OpenTelemetry context propagation discussions. It's the same.TRITONSERVER_InferenceTrace
is initiated with an empty string as a context, since it is never updated, pbe will get an empty string and returnNone
withrequest.trace().get_context()
Below is a POC illustrated.
mode=triton
tests are on the way.Related PRs:
python_be: triton-inference-server/python_backend#346
core: triton-inference-server/core#334
POC:
created with model.py: