Skip to content

Commit 959744d

Browse files
authored
Remove benchmarking code (onnx#6076)
We the benchmarks are not testing much and thus are not very useful. Removing them to keep code lean and reduce dependencies. Signed-off-by: Justin Chu <[email protected]>
1 parent 30896d8 commit 959744d

File tree

5 files changed

+1
-170
lines changed

5 files changed

+1
-170
lines changed

.gitmodules

-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,3 @@
22
path = third_party/pybind11
33
url = https://github.com/pybind/pybind11.git
44
branch = master
5-
[submodule "third_party/benchmark"]
6-
path = third_party/benchmark
7-
url = https://github.com/google/benchmark.git

CMakeLists.txt

+1-26
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ cmake_policy(SET CMP0074 NEW)
1616

1717
# Project
1818
project(onnx C CXX)
19-
option(ONNX_BUILD_BENCHMARKS "Build ONNX micro-benchmarks" OFF)
2019
option(ONNX_USE_PROTOBUF_SHARED_LIBS "Build ONNX using protobuf shared library. Sets PROTOBUF_USE_DLLS CMAKE Flag and Protobuf_USE_STATIC_LIBS. " OFF)
2120

2221
option(BUILD_ONNX_PYTHON "Build Python binaries" OFF)
@@ -619,30 +618,6 @@ if(BUILD_ONNX_PYTHON)
619618
endif()
620619
endif()
621620

622-
if(ONNX_BUILD_BENCHMARKS)
623-
if(NOT TARGET benchmark)
624-
# We will not need to test benchmark lib itself.
625-
set(BENCHMARK_ENABLE_TESTING OFF
626-
CACHE BOOL "Disable benchmark testing as we don't need it.")
627-
# We will not need to install benchmark since we link it statically.
628-
set(BENCHMARK_ENABLE_INSTALL OFF
629-
CACHE BOOL
630-
"Disable benchmark install to avoid overwriting vendor install.")
631-
find_package(benchmark)
632-
if(NOT benchmark_FOUND)
633-
add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/benchmark)
634-
endif()
635-
endif()
636-
637-
add_executable(protobuf-bench tools/protobuf-bench.cc)
638-
target_include_directories(protobuf-bench PUBLIC
639-
$<BUILD_INTERFACE:${ONNX_ROOT}>
640-
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
641-
$<INSTALL_INTERFACE:include>
642-
$<BUILD_INTERFACE:${PROTOBUF_INCLUDE_DIRS}>)
643-
target_link_libraries(protobuf-bench onnx_proto benchmark::benchmark)
644-
endif()
645-
646621
# Export include directories
647622
set(ONNX_INCLUDE_DIRS "${ONNX_ROOT}" "${CMAKE_CURRENT_BINARY_DIR}")
648623
get_directory_property(hasParent PARENT_DIRECTORY)
@@ -742,7 +717,7 @@ if(ONNX_USE_UNITY_BUILD)
742717
# If ONNX_USE_UNITY_BUILD is set to ON, set onnx target to use Unity builds.
743718
# We set Unity build to use groups, it allows us to set some specific files to be compiled individually
744719
set_target_properties(onnx
745-
PROPERTIES
720+
PROPERTIES
746721
UNITY_BUILD ON
747722
UNITY_BUILD_MODE GROUP
748723
)

cmake/summary.cmake

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ function (onnx_print_configuration_summary)
2626
message(STATUS " ONNX_DISABLE_STATIC_REGISTRATION : ${ONNX_DISABLE_STATIC_REGISTRATION}")
2727
message(STATUS " ONNX_WERROR : ${ONNX_WERROR}")
2828
message(STATUS " ONNX_BUILD_TESTS : ${ONNX_BUILD_TESTS}")
29-
message(STATUS " ONNX_BUILD_BENCHMARKS : ${ONNX_BUILD_BENCHMARKS}")
3029
message(STATUS " ONNX_BUILD_SHARED_LIBS : ${ONNX_BUILD_SHARED_LIBS}")
3130
message(STATUS " BUILD_SHARED_LIBS : ${BUILD_SHARED_LIBS}")
3231
message(STATUS "")

third_party/benchmark

-1
This file was deleted.

tools/protobuf-bench.cc

-139
This file was deleted.

0 commit comments

Comments
 (0)