From 564d25c9604bec1ac9e5edb8dfb28ddbe0af4b24 Mon Sep 17 00:00:00 2001 From: Girish Chandrashekar Date: Wed, 30 Nov 2022 09:23:37 +0100 Subject: [PATCH] feat: add inference attributes to torchrt and onnx executor --- server/clip_server/executors/clip_onnx.py | 4 ++++ server/clip_server/executors/clip_tensorrt.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/server/clip_server/executors/clip_onnx.py b/server/clip_server/executors/clip_onnx.py index 1b52ec3a7..3262f0a8d 100644 --- a/server/clip_server/executors/clip_onnx.py +++ b/server/clip_server/executors/clip_onnx.py @@ -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( diff --git a/server/clip_server/executors/clip_tensorrt.py b/server/clip_server/executors/clip_tensorrt.py index 580095e30..62176fe4c 100644 --- a/server/clip_server/executors/clip_tensorrt.py +++ b/server/clip_server/executors/clip_tensorrt.py @@ -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(