Skip to content

Commit

Permalink
update logging
Browse files Browse the repository at this point in the history
  • Loading branch information
tianleiwu committed Oct 4, 2023
1 parent aacf0df commit c686c01
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,13 @@
# limitations under the License.
# --------------------------------------------------------------------------

import logging

import coloredlogs
from cuda import cudart
from demo_utils import init_pipeline, parse_arguments, repeat_prompt
from diffusion_models import PipelineInfo
from engine_builder import EngineType, get_engine_type
from pipeline_txt2img import Txt2ImgPipeline

logger = logging.getLogger(__name__)

if __name__ == "__main__":
coloredlogs.install(fmt="%(funcName)20s: %(message)s")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self, onnx_path, device_id: int = 0, enable_cuda_graph=False, disab
if disable_optimization:
session_options.graph_optimization_level = ort.GraphOptimizationLevel.ORT_DISABLE_ALL

print("creating CUDA EP session for ", onnx_path)
logger.info("creating CUDA EP session for %s", onnx_path)
ort_session = ort.InferenceSession(
onnx_path,
session_options,
Expand All @@ -38,7 +38,7 @@ def __init__(self, onnx_path, device_id: int = 0, enable_cuda_graph=False, disab
"CPUExecutionProvider",
],
)
print("created CUDA EP session for ", onnx_path)
logger.info("created CUDA EP session for %s", onnx_path)

device = torch.device("cuda", device_id)
super().__init__(ort_session, device, enable_cuda_graph)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ def __init__(self, engine_path, device_id, onnx_path, fp16, input_profile, works

session_options = ort.SessionOptions()
session_options.graph_optimization_level = ort.GraphOptimizationLevel.ORT_DISABLE_ALL
print("creating TRT EP session for ", onnx_path)
logger.info("creating TRT EP session for %s", onnx_path)
ort_session = ort.InferenceSession(
onnx_path,
session_options,
providers=[
("TensorrtExecutionProvider", self.ort_trt_provider_options),
],
)
print("created TRT EP session for ", onnx_path)
logger.info("created TRT EP session for %s", onnx_path)

device = torch.device("cuda", device_id)
super().__init__(ort_session, device, enable_cuda_graph)
Expand Down

0 comments on commit c686c01

Please sign in to comment.