Skip to content

Commit

Permalink
Move the performance module and Device class under the run module (#215)
Browse files Browse the repository at this point in the history
* Move the performance module and Device class under the run module

* rev version number

* Allow plugin benchmark tools to override the built-in one
  • Loading branch information
jeremyfowers authored Aug 12, 2024
1 parent de5439b commit 0449b54
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/turnkeyml/run/basert.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/turnkeyml/run/benchmark_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/turnkeyml/run/torchrt/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions src/turnkeyml/sequence/tool_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -16,7 +15,6 @@
mgmt.Cache,
mgmt.ModelsLocation,
report.Report,
Benchmark,
Discover,
export.ExportPytorchModel,
onnx_tools.OptimizeOnnxModel,
Expand All @@ -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)
2 changes: 1 addition & 1 deletion src/turnkeyml/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "3.0.5"
__version__ = "3.0.6"
2 changes: 1 addition & 1 deletion test/unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 0449b54

Please sign in to comment.