1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
6 * @brief A header that defines advanced related properties for VPU plugins.
7 * These properties should be used in SetConfig() and LoadNetwork() methods of plugins
9 * @file vpu_plugin_config.hpp
15 #include "ie_plugin_config.hpp"
17 #define VPU_CONFIG_KEY(name) InferenceEngine::VPUConfigParams::_CONFIG_KEY(VPU_##name)
18 #define VPU_CONFIG_VALUE(name) InferenceEngine::VPUConfigParams::VPU_##name
20 #define DECLARE_VPU_CONFIG_KEY(name) DECLARE_CONFIG_KEY(VPU_##name)
21 #define DECLARE_VPU_CONFIG_VALUE(name) DECLARE_CONFIG_VALUE(VPU_##name)
23 #define VPU_HDDL_CONFIG_KEY(name) InferenceEngine::VPUConfigParams::_CONFIG_KEY(VPU_HDDL_##name)
24 #define VPU_HDDL_CONFIG_VALUE(name) InferenceEngine::VPUConfigParams::VPU_HDDL_##name
26 #define DECLARE_VPU_HDDL_CONFIG_KEY(name) DECLARE_CONFIG_KEY(VPU_HDDL_##name)
27 #define DECLARE_VPU_HDDL_CONFIG_VALUE(name) DECLARE_CONFIG_VALUE(VPU_HDDL_##name)
29 namespace InferenceEngine {
30 namespace VPUConfigParams {
33 * @brief Turn on HW stages usage (applicable for MyriadX devices only).
34 * This option should be used with values: CONFIG_VALUE(YES) or CONFIG_VALUE(NO) (default)
36 DECLARE_VPU_CONFIG_KEY(HW_STAGES_OPTIMIZATION);
39 * @brief The key to specify desirable log level for devices.
40 * This option should be used with values: CONFIG_VALUE(LOG_NONE) (default),
41 * CONFIG_VALUE(LOG_WARNING), CONFIG_VALUE(LOG_INFO), CONFIG_VALUE(LOG_DEBUG)
43 DECLARE_VPU_CONFIG_KEY(LOG_LEVEL);
47 * @brief The key to define normalization coefficient for the network input.
48 * This option should used with be a real number. Example "255.f"
50 DECLARE_VPU_CONFIG_KEY(INPUT_NORM);
54 * @brief The flag to specify Bias value that is added to each element of the network input.
55 * This option should used with be a real number. Example "0.1f"
57 DECLARE_VPU_CONFIG_KEY(INPUT_BIAS);
60 * @brief The flag for adding to the profiling information the time of obtaining a tensor.
61 * This option should be used with values: CONFIG_VALUE(YES) or CONFIG_VALUE(NO) (default)
63 DECLARE_VPU_CONFIG_KEY(PRINT_RECEIVE_TENSOR_TIME);
66 * @brief The flag to reset stalled devices: CONFIG_VALUE(YES) or CONFIG_VALUE(NO) (default)
67 * This is a plugin scope option and must be used with the plugin's SetConfig method
69 DECLARE_VPU_CONFIG_KEY(FORCE_RESET);
72 * @brief [Only for HDDLPlugin]
73 * Type: Arbitrary non-empty string. If empty (""), equals no set, default: "";
74 * This option allows to specify the number of MYX devices used for inference a specific Executable network.
75 * Note: Only one network would be allocated to one device.
76 * The number of devices for the tag is specified in the hddl_service.config file.
85 * It means that an executable network marked with tagA will be executed on 3 devices
87 DECLARE_VPU_HDDL_CONFIG_KEY(GRAPH_TAG);
90 * @brief [Only for HDDLPlugin]
91 * Type: Arbitrary non-empty string. If empty (""), equals no set, default: "";
92 * This config makes the executable networks to be allocated on one certain device (instead of multiple devices).
93 * And all inference through this executable network, will be done on this device.
94 * Note: Only one network would be allocated to one device.
95 * The number of devices which will be used for stream-affinity must be specified in hddl_service.config file.
99 * "stream_device_number":5
101 * It means that 5 device will be used for stream-affinity
103 DECLARE_VPU_HDDL_CONFIG_KEY(STREAM_ID);
106 * @brief [Only for HDDLPlugin]
107 * Type: Arbitrary non-empty string. If empty (""), equals no set, default: "";
108 * This config allows user to control device flexibly. This config gives a "tag" for a certain device while
109 * allocating a network to it. Afterward, user can allocating/deallocating networks to this device with this "tag".
110 * Devices used for such use case is controlled by a so-called "Bypass Scheduler" in HDDL backend, and the number
111 * of such device need to be specified in hddl_service.config file.
113 * "service_settings":
115 * "bypass_device_number": 5
117 * It means that 5 device will be used for Bypass scheduler.
119 DECLARE_VPU_HDDL_CONFIG_KEY(DEVICE_TAG);
122 * @brief [Only for HDDLPlugin]
123 * Type: "YES/NO", default is "NO".
124 * This config is a sub-config of DEVICE_TAG, and only available when "DEVICE_TAG" is set. After a user load a
125 * network, the user got a handle for the network.
126 * If "YES", the network allocated is bind to the device (with the specified "DEVICE_TAG"), which means all afterwards
127 * inference through this network handle will be executed on this device only.
128 * If "NO", the network allocated is not bind to the device (with the specified "DEVICE_TAG"). If the same network
129 * is allocated on multiple other devices (also set BIND_DEVICE to "False"), then inference through any handle of these
130 * networks may be executed on any of these devices those have the network loaded.
132 DECLARE_VPU_HDDL_CONFIG_KEY(BIND_DEVICE);
135 * @brief [Only for HDDLPlugin]
136 * Type: A signed int wrapped in a string, default is "0".
137 * This config is a sub-config of DEVICE_TAG, and only available when "DEVICE_TAG" is set and "BIND_DEVICE" is "False".
138 * When there are multiple devices running a certain network (a same network running on multiple devices in Bypass Scheduler),
139 * the device with a larger number has a higher priority, and more inference tasks will be fed to it with priority.
141 DECLARE_VPU_HDDL_CONFIG_KEY(RUNTIME_PRIORITY);
145 * @brief [Only for HDDLPlugin]
146 * Type: "YES/NO", default is "NO". **Note: ONLY available when "DEVICE_TAG" is set.
147 * This config should be used only when the network has been loaded already with the same network content, the same
148 * "DEVICE_TAG" as used this time and "BIND_DEVICE" of the loaded network had been set to "NO".
149 * This config is only used to update the "RUNTIME_PRIORITY" of previous loaded network, and the application should keep using
150 * the network handle that previous allocated to do inference.
151 * - If "Yes": the "RUNTIME_PRIORITY" must be specified with a integer, and it will be set as the new runtime priority for that network on that device.
152 * - If "No": load this network to deivce.
153 * **Note: If "BIND_DEVICE" of the previously loaded network was "Yes", the behavior of "update runtime priority" is undefined.
155 DECLARE_VPU_HDDL_CONFIG_KEY(UPDATE_RUNTIME_PRIORITY);
158 * @brief This option allows to pass extra configuration for executable network.
159 * By default, it is empty string, which means - no configuration.
161 * <key>=<value>,<key>=<value>,...
162 * Supported parameters and options:
163 * * file : path to XML file with configuration
164 * * data : options related to data objects (input, output, intermediate), next parameter describes the option
165 * * scale : SCALE factor for data range (applicable for input and intermediate data)
167 DECLARE_VPU_CONFIG_KEY(NETWORK_CONFIG);
170 * @brief This option allows to to specify input output layouts for network layers.
171 * By default, this value set to VPU_CONFIG_VALUE(AUTO) value.
173 * VPU_CONFIG_VALUE(AUTO) executable network configured to use optimal layer layout depending on available HW
174 * VPU_CONFIG_VALUE(NCHW) executable network forced to use NCHW input/output layouts
175 * VPU_CONFIG_VALUE(NHWC) executable network forced to use NHWC input/output layouts
177 DECLARE_VPU_CONFIG_KEY(COMPUTE_LAYOUT);
180 * @brief This option allows to pass custom layers binding xml.
181 * If layer is present in such an xml, it would be used during inference even if the layer is natively supported
183 DECLARE_VPU_CONFIG_KEY(CUSTOM_LAYERS);
186 * @brief Supported keys definition for VPU_CONFIG_KEY(COMPUTE_LAYOUT) option.
188 DECLARE_VPU_CONFIG_VALUE(AUTO);
189 DECLARE_VPU_CONFIG_VALUE(NCHW);
190 DECLARE_VPU_CONFIG_VALUE(NHWC);
193 * @brief This option allows to specify device.
194 * If specified device is not available then creating infer request will throw an exception.
196 DECLARE_VPU_CONFIG_KEY(PLATFORM);
199 * @brief Supported keys definition for VPU_CONFIG_KEY(PLATFORM) option.
201 DECLARE_VPU_CONFIG_VALUE(2450);
202 DECLARE_VPU_CONFIG_VALUE(2480);
205 * @brief Ignore statistic in IR by plugin.
206 * Plugin could use statistic present in IR in order to try to improve calculations precision.
207 * If you don't want statistic to be used enable this option.
208 * This option should be used with values: CONFIG_VALUE(YES) or CONFIG_VALUE(NO) (default)
210 DECLARE_VPU_CONFIG_KEY(IGNORE_IR_STATISTIC);
212 } // namespace VPUConfigParams
213 } // namespace InferenceEngine