Skip to content

Commit

Permalink
feat: add inference attributes to torchrt and onnx executor
Browse files Browse the repository at this point in the history
  • Loading branch information
Girish Chandrashekar committed Nov 30, 2022
1 parent 69205be commit 564d25c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/clip_server/executors/clip_onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ async def encode(
split_img_txt_da(d, _img_da, _txt_da)

with self.tracer.start_as_current_span('inference') as inference_span:
inference_span.set_attribute('drop_image_content', _drop_image_content)
inference_span.set_attribute('minibatch_size', self._minibatch_size)
inference_span.set_attribute('has_img_da', True if _img_da else False)
inference_span.set_attribute('has_txt_da', True if _txt_da else False)
# for image
if _img_da:
with self.tracer.start_as_current_span(
Expand Down
4 changes: 4 additions & 0 deletions server/clip_server/executors/clip_tensorrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ async def encode(
split_img_txt_da(d, _img_da, _txt_da)

with self.tracer.start_as_current_span('inference') as inference_span:
inference_span.set_attribute('drop_image_content', _drop_image_content)
inference_span.set_attribute('minibatch_size', self._minibatch_size)
inference_span.set_attribute('has_img_da', True if _img_da else False)
inference_span.set_attribute('has_txt_da', True if _txt_da else False)
# for image
if _img_da:
with self.tracer.start_as_current_span(
Expand Down

0 comments on commit 564d25c

Please sign in to comment.