Skip to content

Instantly share code, notes, and snippets.

@ravi9
Created September 20, 2022 16:41
Show Gist options
  • Save ravi9/0840a9d713ec56c9d8f4a4530c8919fb to your computer and use it in GitHub Desktop.
Save ravi9/0840a9d713ec56c9d8f4a4530c8919fb to your computer and use it in GitHub Desktop.
"""
Copyright (c) 2022 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
# The models need to be placed and mounted in a particular directory structure and according to the following rules:
# tree models/
# models/
# ├── model1
# │ ├── 1
# │ │ ├── ir_model.bin
# │ │ └── ir_model.xml
# │ └── 2
# │ ├── ir_model.bin
# │ └── ir_model.xml
# └── model2
# │ └── 1
# │ ├── ir_model.bin
# │ ├── ir_model.xml
# │ └── mapping_config.json
# └── model3
# └── 1
# └── model.onnx
# You can add multiple models that need benchmarking like below:
# model_paths_list=("/path/to/model1/" "/path/to/model2/")
# model_paths_list=("${PWD}/models/FP32/efficientnet-b0/")
model_paths_list=("${PWD}/models/FP32/product-detection-0001/")
# Set parameters for only one mode for each run.
# If you want to run in Mode 1, parameters in mode 2 and mode 3 should be commented.
##**************************************************************##
# MODE 1:
# For a given Concurrency(Cameras), Script will output:
# - Min Latency
# - OVMS Config Params: CPU_THROUGHPUT_STREAMS
# Uncomment below line for MODE 1
kpi_concurrency=10 # number of Concurrency(cameras)
##**************************************************************##
##**************************************************************##
# MODE 2:
# For a given latency, the script will output:
# - Min, Max Concurrency (Cameras)
# - OVMS Config Params: CPU_THROUGHPUT_STREAMS
# Uncomment below 3 lines for MODE 2
# kpi_latency=0.09 # in ms (milliseconds)
# min_concurrency=1 # min number of Concurrency(cameras)
# max_concurrency=1 # max number of Concurrency(cameras)
##**************************************************************##
##**************************************************************##
# MODE 3:
# KPIs are unknown, Script will output several combinations of Streams,Concurrency,Latency(ms)
# There are no parameters for this mode.
##**************************************************************##
##**************************************************************##
# Change below parameters if neccesary.
##**************************************************************##
benchmark_duration=10
grpc_workers=1
batch_size=1
shape="auto"
port=9001
r_port=9000
ovms_docker_image='openvino/model_server:latest'
benchmark_docker_image='benchmark_client:latest'
ovms_container_name="ovms_server_benchm"
benchclient_container_name="benchmark_client_benchm"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment