diff --git a/examples/cli/plugins/example_combined/turnkeyml_plugin_example_combined/runtime.py b/examples/cli/plugins/example_combined/turnkeyml_plugin_example_combined/runtime.py index d96b6b23..64395209 100644 --- a/examples/cli/plugins/example_combined/turnkeyml_plugin_example_combined/runtime.py +++ b/examples/cli/plugins/example_combined/turnkeyml_plugin_example_combined/runtime.py @@ -8,7 +8,7 @@ import turnkeyml.common.exceptions as exp import turnkeyml.common.filesystem as fs from turnkeyml.run.onnxrt.within_conda import dummy_inputs -from turnkeyml.common.performance import MeasuredPerformance +from turnkeyml.run.performance import MeasuredPerformance combined_rt_name = "example-combined-rt" diff --git a/examples/cli/plugins/example_rt/turnkeyml_plugin_example_rt/runtime.py b/examples/cli/plugins/example_rt/turnkeyml_plugin_example_rt/runtime.py index 5ce10915..ed010694 100644 --- a/examples/cli/plugins/example_rt/turnkeyml_plugin_example_rt/runtime.py +++ b/examples/cli/plugins/example_rt/turnkeyml_plugin_example_rt/runtime.py @@ -1,7 +1,7 @@ import os import numpy as np from turnkeyml.run.basert import BaseRT -from turnkeyml.common.performance import MeasuredPerformance +from turnkeyml.run.performance import MeasuredPerformance import turnkeyml.common.exceptions as exp from turnkeyml.common.filesystem import Stats diff --git a/src/turnkeyml/run/basert.py b/src/turnkeyml/run/basert.py index 938647fb..42722f9b 100644 --- a/src/turnkeyml/run/basert.py +++ b/src/turnkeyml/run/basert.py @@ -7,7 +7,7 @@ from abc import ABC, abstractmethod import torch import numpy as np -from turnkeyml.common.performance import MeasuredPerformance, Device +from turnkeyml.run.performance import MeasuredPerformance, Device import turnkeyml.common.build as build import turnkeyml.common.exceptions as exp import turnkeyml.common.filesystem as fs diff --git a/src/turnkeyml/run/benchmark_model.py b/src/turnkeyml/run/benchmark_model.py index f231d23e..66e6094e 100644 --- a/src/turnkeyml/run/benchmark_model.py +++ b/src/turnkeyml/run/benchmark_model.py @@ -10,7 +10,7 @@ apply_default_runtime, ) import turnkeyml.cli.parser_helpers as parser_helpers -from turnkeyml.common.performance import Device, parse_device +from turnkeyml.run.performance import Device, parse_device default_iterations = 100 benchmark_default_device = "x86" diff --git a/src/turnkeyml/common/performance.py b/src/turnkeyml/run/performance.py similarity index 100% rename from src/turnkeyml/common/performance.py rename to src/turnkeyml/run/performance.py diff --git a/src/turnkeyml/run/torchrt/runtime.py b/src/turnkeyml/run/torchrt/runtime.py index d7e3c87d..7673194c 100644 --- a/src/turnkeyml/run/torchrt/runtime.py +++ b/src/turnkeyml/run/torchrt/runtime.py @@ -7,7 +7,7 @@ import torch import numpy as np from turnkeyml.run.basert import BaseRT -from turnkeyml.common.performance import MeasuredPerformance +from turnkeyml.run.performance import MeasuredPerformance from turnkeyml.run.onnxrt.execute import get_cpu_specs import turnkeyml.common.build as build import turnkeyml.common.exceptions as exp diff --git a/src/turnkeyml/sequence/tool_plugins.py b/src/turnkeyml/sequence/tool_plugins.py index a9aa5e8f..9cd170a8 100644 --- a/src/turnkeyml/sequence/tool_plugins.py +++ b/src/turnkeyml/sequence/tool_plugins.py @@ -2,7 +2,6 @@ import turnkeyml.tools.onnx as onnx_tools import turnkeyml.common.plugins as plugins import turnkeyml.tools.management_tools as mgmt -from turnkeyml.run.benchmark_model import Benchmark from turnkeyml.tools.discovery import Discover import turnkeyml.tools.report as report from turnkeyml.tools.load_build import LoadBuild @@ -16,7 +15,6 @@ mgmt.Cache, mgmt.ModelsLocation, report.Report, - Benchmark, Discover, export.ExportPytorchModel, onnx_tools.OptimizeOnnxModel, @@ -40,3 +38,11 @@ ) SUPPORTED_TOOLS.append(tool_class) + +# Give a "benchmark" tool installed by a plugin priority over +# a "benchmark" tool built into turnkeyml +tool_names = [tool.unique_name for tool in SUPPORTED_TOOLS] +if "benchmark" not in tool_names: + from turnkeyml.run.benchmark_model import Benchmark + + SUPPORTED_TOOLS.append(Benchmark) diff --git a/src/turnkeyml/version.py b/src/turnkeyml/version.py index e94f36fe..6ed01825 100644 --- a/src/turnkeyml/version.py +++ b/src/turnkeyml/version.py @@ -1 +1 @@ -__version__ = "3.0.5" +__version__ = "3.0.6" diff --git a/test/unit.py b/test/unit.py index 0b34fa2e..49c909f8 100644 --- a/test/unit.py +++ b/test/unit.py @@ -6,8 +6,8 @@ import os import sys import turnkeyml.common.filesystem as filesystem -import turnkeyml.common.performance as performance import turnkeyml.common.build as build +import turnkeyml.run.performance as performance import turnkeyml.run.plugin_helpers as plugin_helpers