Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make time && stress tests independent from IEDeveloperPackage #7411

Merged
merged 9 commits into from
Sep 16, 2021
10 changes: 9 additions & 1 deletion tests/stress_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

cmake_minimum_required(VERSION 3.13)

set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CXX_EXTENSIONS OFF)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
endif()

if (CMAKE_BUILD_TYPE STREQUAL "")
message(STATUS "CMAKE_BUILD_TYPE not defined, 'Release' will be used")
set(CMAKE_BUILD_TYPE "Release")
Expand All @@ -12,7 +19,8 @@ endif()
# Define directory where artifacts will be placed
set(OUTPUT_ROOT ${CMAKE_CURRENT_SOURCE_DIR})

find_package(InferenceEngineDeveloperPackage REQUIRED)
# Search OpenVINO Inference Engine installed
find_package(OpenVINO REQUIRED)

set(OpenVINO_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../")

Expand Down
26 changes: 6 additions & 20 deletions tests/stress_tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,13 @@ one at a time to mitigate memory statistics pollution. You can use

### Building Tests

Stress tests should be built in 2 steps.

1. Build `openvino`

Build `openvino` as usual but with `-DENABLE_TESTS=ON`.

2. Build `stress_tests`

Stress tests depend from the Inference Engine Developer Package located in the
`openvino` build directory.

In the command line snippet bellow, it is assumed that the Inference Engine
Developer Package CMake module can be found in the directory `build` under
`openvino` repository root.

To build the tests, you need to have OpenVINO™ installed or build from source.
Before build the tests, open a terminal, set OpenVINO™ environment, and after that
run the commands below:
ishariko marked this conversation as resolved.
Show resolved Hide resolved
``` bash
(
export OPENVINO_BUILD_DIR=$(git rev-parse --show-toplevel)/build
mkdir -p build && cd build && \
cmake -DInferenceEngineDeveloperPackage_DIR=$OPENVINO_BUILD_DIR .. && make -j$(nproc) \
)
source <OpenVINO_install_dir>/bin/setupvars.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bin/setupvars.sh -> setupvars.sh

mkdir build && cd build
cmake .. && make -j$(nproc)
```

### Preparing Test Data
Expand Down
1 change: 1 addition & 0 deletions tests/stress_tests/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ file (GLOB_RECURSE HDR *.h)

add_library(${TARGET_NAME} STATIC ${SRC} ${HDR})

include(${OpenVINO_SOURCE_DIR}cmake/developer_package/compile_flags/os_flags.cmake)
target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

add_subdirectory(${OpenVINO_SOURCE_DIR}/thirdparty/gflags
Expand Down
18 changes: 8 additions & 10 deletions tests/time_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,21 @@

cmake_minimum_required(VERSION 3.13)

set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CXX_EXTENSIONS OFF)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
endif()

set (CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the build type")

project(time_tests)

set(OpenVINO_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../")

# Search OpenVINO Inference Engine installed
find_package(InferenceEngine)

if(NOT InferenceEngine_FOUND)
# Define directory where artifacts will be placed
set(OUTPUT_ROOT ${CMAKE_CURRENT_SOURCE_DIR})

# Search OpenVINO Inference Engine via InferenceEngineDeveloperPackage_DIR
# in order to provide backward compatibility with old OpenVINO packages
find_package(InferenceEngineDeveloperPackage REQUIRED)
endif()
find_package(OpenVINO REQUIRED)

add_subdirectory(src)

Expand Down
12 changes: 1 addition & 11 deletions tests/time_tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,11 @@ the commands below:

1. Build tests:
``` bash
source <OpenVINO_install_dir>/bin/setupvars.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-> <OpenVINO_install_dir>/setupvars.sh

mkdir build && cd build
cmake .. && make time_tests
```

ishariko marked this conversation as resolved.
Show resolved Hide resolved
If you don't have OpenVINO™ installed you need to have the `build` folder, which
is created when you configure and build OpenVINO™ from sources:

``` bash
cmake .. -DInferenceEngine_DIR=$(realpath ../../../build) && make time_tests
```
For old versions of OpenVINO™ from sources use `-DInferenceEngineDeveloperPackage_DIR`:
``` bash
cmake .. -DInferenceEngineDeveloperPackage_DIR=$(realpath ../../../build) && make time_tests
```

2. Run test:
``` bash
./scripts/run_timetest.py ../../bin/intel64/Release/timetest_infer -m model.xml -d CPU
Expand Down