forked from visoftsolutions/noir_rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bb): wasmtime and remote benchmarking (AztecProtocol#4204)
- provides a script that runs threaded goblin_bench in WASM with 16 cores - point to https://github.com/AztecProtocol/google-benchmark with changes for our custom WASI environment. This included removing CMake's thread library heuristics (which were unneeded, anyway) and adding checks for a wasm environment when measuring time. See AztecProtocol/barretenberg#837 for followups. - remove conditional BENCHMARKS in CMakeLists.txt. There's no reason to conditionally provide benchmark targets now that WASM can process the google benchmark cmake - add some WASMTIME_ENV_HACK guards around fake SRS and a fixed core count. - helpers for running benchmarks on remote nodes --------- Co-authored-by: ludamad <[email protected]>
- Loading branch information
Showing
56 changed files
with
356 additions
and
379 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,19 @@ | ||
if(NOT TESTING) | ||
set(BENCHMARKS OFF) | ||
endif() | ||
|
||
if(BENCHMARKS) | ||
include(FetchContent) | ||
include(FetchContent) | ||
|
||
FetchContent_Declare( | ||
benchmark | ||
GIT_REPOSITORY https://github.com/google/benchmark | ||
GIT_TAG v1.7.1 | ||
FIND_PACKAGE_ARGS | ||
) | ||
FetchContent_Declare( | ||
benchmark | ||
GIT_REPOSITORY https://github.com/AztecProtocol/google-benchmark | ||
GIT_TAG 7638387d2727853d970fc9420dcf95cf3e9bd112 | ||
FIND_PACKAGE_ARGS | ||
) | ||
|
||
set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Benchmark tests off") | ||
set(BENCHMARK_ENABLE_INSTALL OFF CACHE BOOL "Benchmark installation off") | ||
set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Benchmark tests off") | ||
set(BENCHMARK_ENABLE_INSTALL OFF CACHE BOOL "Benchmark installation off") | ||
|
||
FetchContent_MakeAvailable(benchmark) | ||
if(NOT benchmark_FOUND) | ||
# FetchContent_MakeAvailable calls FetchContent_Populate if `find_package` is unsuccessful | ||
# so these variables will be available if we reach this case | ||
set_property(DIRECTORY ${benchmark_SOURCE_DIR} PROPERTY EXCLUDE_FROM_ALL) | ||
set_property(DIRECTORY ${benchmark_BINARY_DIR} PROPERTY EXCLUDE_FROM_ALL) | ||
endif() | ||
FetchContent_MakeAvailable(benchmark) | ||
if(NOT benchmark_FOUND) | ||
# FetchContent_MakeAvailable calls FetchContent_Populate if `find_package` is unsuccessful | ||
# so these variables will be available if we reach this case | ||
set_property(DIRECTORY ${benchmark_SOURCE_DIR} PROPERTY EXCLUDE_FROM_ALL) | ||
set_property(DIRECTORY ${benchmark_BINARY_DIR} PROPERTY EXCLUDE_FROM_ALL) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,49 @@ | ||
if(TESTING) | ||
include(GoogleTest) | ||
include(FetchContent) | ||
|
||
FetchContent_Declare( | ||
GTest | ||
GIT_REPOSITORY https://github.com/google/googletest.git | ||
# Version 1.12.1 is not compatible with WASI-SDK 12 | ||
GIT_TAG release-1.10.0 | ||
FIND_PACKAGE_ARGS | ||
include(GoogleTest) | ||
include(FetchContent) | ||
|
||
FetchContent_Declare( | ||
GTest | ||
GIT_REPOSITORY https://github.com/google/googletest.git | ||
# Version 1.12.1 is not compatible with WASI-SDK 12 | ||
GIT_TAG release-1.10.0 | ||
FIND_PACKAGE_ARGS | ||
) | ||
|
||
set(BUILD_GMOCK OFF CACHE BOOL "Build with gMock disabled") | ||
set(INSTALL_GTEST OFF CACHE BOOL "gTest installation disabled") | ||
|
||
FetchContent_MakeAvailable(GTest) | ||
|
||
if (NOT GTest_FOUND) | ||
# FetchContent_MakeAvailable calls FetchContent_Populate if `find_package` is unsuccessful | ||
# so these variables will be available if we reach this case | ||
set_property(DIRECTORY ${gtest_SOURCE_DIR} PROPERTY EXCLUDE_FROM_ALL) | ||
set_property(DIRECTORY ${gtest_BINARY_DIR} PROPERTY EXCLUDE_FROM_ALL) | ||
|
||
# Disable all warning when compiling gtest | ||
target_compile_options( | ||
gtest | ||
PRIVATE | ||
-w | ||
) | ||
|
||
set(BUILD_GMOCK OFF CACHE BOOL "Build with gMock disabled") | ||
set(INSTALL_GTEST OFF CACHE BOOL "gTest installation disabled") | ||
|
||
FetchContent_MakeAvailable(GTest) | ||
|
||
if (NOT GTest_FOUND) | ||
# FetchContent_MakeAvailable calls FetchContent_Populate if `find_package` is unsuccessful | ||
# so these variables will be available if we reach this case | ||
set_property(DIRECTORY ${gtest_SOURCE_DIR} PROPERTY EXCLUDE_FROM_ALL) | ||
set_property(DIRECTORY ${gtest_BINARY_DIR} PROPERTY EXCLUDE_FROM_ALL) | ||
|
||
# Disable all warning when compiling gtest | ||
target_compile_options( | ||
if(WASM) | ||
target_compile_definitions( | ||
gtest | ||
PRIVATE | ||
-w | ||
) | ||
|
||
if(WASM) | ||
target_compile_definitions( | ||
gtest | ||
PRIVATE | ||
-DGTEST_HAS_EXCEPTIONS=0 | ||
-DGTEST_HAS_STREAM_REDIRECTION=0 | ||
) | ||
endif() | ||
|
||
mark_as_advanced( | ||
BUILD_GMOCK BUILD_GTEST BUILD_SHARED_LIBS | ||
gmock_build_tests gtest_build_samples gtest_build_tests | ||
gtest_disable_pthreads gtest_force_shared_crt gtest_hide_internal_symbols | ||
-DGTEST_HAS_EXCEPTIONS=0 | ||
-DGTEST_HAS_STREAM_REDIRECTION=0 | ||
) | ||
|
||
add_library(GTest::gtest ALIAS gtest) | ||
add_library(GTest::gtest_main ALIAS gtest_main) | ||
endif() | ||
|
||
enable_testing() | ||
mark_as_advanced( | ||
BUILD_GMOCK BUILD_GTEST BUILD_SHARED_LIBS | ||
gmock_build_tests gtest_build_samples gtest_build_tests | ||
gtest_disable_pthreads gtest_force_shared_crt gtest_hide_internal_symbols | ||
) | ||
|
||
add_library(GTest::gtest ALIAS gtest) | ||
add_library(GTest::gtest_main ALIAS gtest_main) | ||
endif() | ||
|
||
enable_testing() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.