* [IE]: Enables Abstract class -> Parameter conversion support
Parameter has templated constructor allowing to write code
```
Parameter p = i; // i of type int for example
```
This constructor uses SFINAE to resolve ambiguity with
move-constructor, so checks that argument is not of the same type.
In case it's not the same type it calls std::tuple constructors that
constructs an instance of argument type. In the following case:
```
Parameter p = static_cast<Parameter>(abstractRef);
// abstractRef is a reference to abstract class
```
We have a reference to some abstract class that defines explicit
cast operator to Parameter. In contrast with expectations,
instead of cast operator, Parameter constructor is instantiated,
since template type deduction for Parameter constructor didn't fail
(abstract class has not the same type as Parameter). Instantiation
of tuple constructor used inside failed: it's impossible to create an
instance of abstract class what lead to compile-time error. To resolve
the issue additional condition introduced to check if argument type is
abstract.
Signed-off-by: Gladilov, Gleb <gleb.gladilov@intel.com>
* [IE]: Enables PrintTo method for Parameter and tests on it
Inference Engine API for configuration options uses Parameter
type as a return type of GetConfig method. Parameter is intended
to store object associated with configuration option.
To support objects of different types its constructor is templated.
Parameter overloads cast operators which are templated
as well. Both constructor and cast operators are implicit, which
makes it possible to implicitly convert any type to Parameter
and vice versa.
Since Parameter is a part of Inference Engine configuration API it's
essential google tests on API contain Parameter as tests parameter.
For each test parameter Google Test framework tries to print it to
an output stream. For that purpose, Google Test checks if test
parameter has output stream operator or PrintTo method. If not, it
checks if it could be implicitly converted to integral type and,
in this case, prints it as a long integer.
InferenceEngine::Parameter does not define output stream operator,
but could be implicitly converted to an integer, according cast
operators mentioned above, so Google Test tries to convert to
integer. Since Parameter not necessarily contains integer, this
conversion throws an exception of type mismatch, which makes it
impossible to use Parameter in Google Test framework as is.
In order to resolve that issue Parameter should define either
output stream operator or PrintTo method. If Parameter will
define output stream operator it will make it possible to compile
streaming almost any object to an output stream. The reason for it
is C++ checks if object could be implicitly converted to other type
which defines output stream operator, if objects itself doesn't do it
(e.g. `stream << "text";` calls std::string::operator<<, since
char const* is implicitly convertible to std::string).
Taking this into consideration the only way to support Parameter in
Google Test without breaking backward compatibility is define PrintTo
method.
Signed-off-by: Gladilov, Gleb <gleb.gladilov@intel.com>
* [IE]: Fixes ill-formed extending std names
According to the standard:
The behavior of a C++ program is undefined if
it adds declarations or definitions to namespace
std or to a namespace within namespace std unless
otherwise specified. A program may add a template
specialization for any standard library template
to namespace std only if the declaration depends
on a user-defined type and the specialization meets
the standard library requirements for the original
template and is not explicitly prohibited.
As as an unexpected result, InferenceEngine::Parameter
that contains std::vector<std::string> can be printed
via PrintTo. In that case operator<< version from
Inference Engine is picked up.
Signed-off-by: Gladilov, Gleb <gleb.gladilov@intel.com>
* [IE][VPU]: Moves CompilationConfig out of GT header
Keeping config in a separate header simplifies migration
to new interface.
Signed-off-by: Gladilov, Gleb <gleb.gladilov@intel.com>
* [IE][VPU]: Removes Platform enum
Since there is enum from MVNC for the same purpose
there is no need in Platform anyway
Signed-off-by: Gladilov, Gleb <gleb.gladilov@intel.com>
* [IE][VPU]: Introduces containers utility header
Contains some helpers to work with C++ maps
Signed-off-by: Gladilov, Gleb <gleb.gladilov@intel.com>
* [IE][VPU]: Introduces new configuration API
The main ideas are separate option-specific logic
from common container, automate logic processing
public vs private, deprecated, compile-time vs
runtime-time options and remove code duplication.
Since IE defines configuration API using std::string
and Parameter, options have to provide ways to be
represented as Parameter (ex.: GetConfig is called)
and be defined using std::string (ex.: SetConfig is
called). Keeping information about actual key value
is useful for error reporting.
New API fallbacks to previous version in case of
unsupported options are requested. This way migration
becomes iterative and looks simpler.
Options containers are related to corresponding components:
CompilationConfig (name to be changed) - GraphTransformer,
PluginConfiguration - base class for plugins configurations,
MyriadConfiguration - Myriad plugin configuration,
HDDLConfiguration - HDDL plugin configuration (to be
introduced in a separate request)
Signed-off-by: Gladilov, Gleb <gleb.gladilov@intel.com>
* [IE][VPU]: Replaces CompilationConfig with PluginConfiguration
Some of options to be refactored are stored inside CompilationConfig.
CompilationConfig is passed to graph transformer as a compiler to be
processed. Since it's separate data structure and migration process
is iterative we need a mechanism to provide some of compilation
options from new interface and some from old. It cannot be done via
plugin specific class (MyriadConfiguration), since there are others
plugins as graph transformer users. Plugin specific class
(MyriadConfiguration) already inherits from old version (MyriadConfig),
which in turn inherits from ParsedConfig containing CompilationConfig.
To resolve the issue MyriadConfig inheritance from ParsedConfig is made
virtual to make it possible for PluginConfiguration to virtually inherit
from ParsedConfig as well an so make PluginConfiguration data structure
for configuration options for graph transformer. Since
PluginConfiguration is base class of MyriadConfiguration as well as
MyriadConfig and inheritance is virtual plugin just casts its specific
configuration to base one passing to graph transformer.
Signed-off-by: Gladilov, Gleb <gleb.gladilov@intel.com>
* [IE][VPU]: Enables new tests on configuration API
* Enables following new shared tests on configuration API
* Can load network with empty configuration
* Check default value for configuration option
* Can load network with correct configuration
* Check custom value for configuration option (set and compare)
* Check public configuration options are visible through API
* Check private configuration options are invisible through API
* Check GetConfig throws an exception on incorrect key
* Refactors myriad plugin instantiations for shared tests
Signed-off-by: Gladilov, Gleb <gleb.gladilov@intel.com>
* [IE][VPU]: Extracts LogLevel enum to a separate header
Signed-off-by: Gladilov, Gleb <gleb.gladilov@intel.com>
* [IE][VPU]: Refactors LOG_LEVEL configuration option
Signed-off-by: Gladilov, Gleb <gleb.gladilov@intel.com>
* [IE][VPU]: Refactors COPY_OPTIMIZATION configuration option
Signed-off-by: Gladilov, Gleb <gleb.gladilov@intel.com>
* [IE][VPU]: Fixes behavior tests build
Signed-off-by: Gladilov, Gleb <gleb.gladilov@intel.com>
* [IE][VPU]: Updates tests on new exception class
Signed-off-by: Gladilov, Gleb <gleb.gladilov@intel.com>
* [IE][VPU]: Removes unused variable from mvnc test
Signed-off-by: Gladilov, Gleb <gleb.gladilov@intel.com>
* [IE][VPU]: Removes SizeVector streaming call
New assertion macro IE_ASSERT implementation uses
output streaming operator with r-value reference
argument as a stream. This prevents the compiler
from picking up overload from InferenceEngine::details,
since our version takes stream by non-const l-value
reference.
Since there is no simple solution to provide output
streaming operator overload for r-value references as
well and this call is just a message for assert in
test utilities, it was decided just to remove call
for now.
Signed-off-by: Gladilov, Gleb <gleb.gladilov@intel.com>
* adding conv2d decomposition
* save point
* build of conv_2d factorization succeeds
* working 2d conv decomposing transform
* added pseudo code for handling larger kernels
* fix conv splitting due to size
* active work on convolution 1xK without dilation
* validated NHWC ordered networks with convolution kernel sizes:
3x3
3x1
5x1
1x5
1x3
TODO: 2d max pooling
* removed debug printouts
* fusing max pooling/bias/af when -disable_nhwc_to_nchw option is used
* code cleanup
* [GNA] Fixes for CI run
* [GNA] Add tests, fix transform
* [GNA] Fix padded2valid and conv2d decomposition coexistence
* [GNA] Temporarily disable tests due to mock call count issues
* [GNA] Split tests for different hw versions
Co-authored-by: prozen <piotr.rozen@intel.com>
* Exclude xbyak from install
* Added automatically generated InferenceEngineConfig.cmake
* Reverted a version back
* Fixed issues with target aliases
* Make TBB dependency private
* Made ie_parallel.cmake self-sufficient
* Don't expose ie_paralle.cmake to end users
* Fixed compilation with TBB
* Fixes for TBB
* Fixed vpu_graph_transformer compilation
* Fixed tests compilation
* Added install of ie_parallel.cmake
* Switched ENABLE_ALTERNATIVE_TEMP to OFF. Fixed COMPONENTS for TBB
* Fixed file name in install rules
* Added find_dependency for TBB in ie_parallel.cmake
* WA for cmake bug with PACKAGE_PREFIX_DIR
* Fixed no-deprecation to fix speech-library build
* Reverted version from 2.1.0 to 2.1
* Revert "Reverted version from 2.1.0 to 2.1"
This reverts commit 7cb5d1563c.
* Returned custom version file back
* Added InferenceEngineConfig-version.cmake to share as well
* Disabled one more GPU test
* Added one more WA for CI
* WA for CI issue for C API
* WIP
* [GNA] Additional PWL segments are added to avoid saturation
After design phase for PWL segments has finished,
additional segments are added to avoid saturation.
This commit also reduces the number of PWL segments created
for some layer types.
* [GNA] Make PWL unit tests take into account saturation errata
* Small refactoring in TEMPLATE plugin
* Fixed compilation on Windows
* Fixed code style
* Hide CALL_STATUS_FNC helpers to private API
* Moved some base classes to private place from plugin_api
* Updates for VariableState creation
* Take Jane's changes for Demension names
* Revert "Take Jane's changes for Demension names"
This reverts commit 9f6c8fa5a6.
* Removed ICNNNetwork include
* removed more icnnnetwork includes
* Added missed include with ie_input_info.hpp
* Fixed GNA plugin to provide names w/o \0
Issue can be reproduced on stress testing:
Get stress scripts from git@github.com:google/gtest-parallel.git
> python3 <workdir>/gtest-parallel/gtest_parallel.py ./InferenceEngineUnitTests --gtest_filter=*GNAAOT* -r 100
It starts each test separately in different threads/processes and there is big chance of conflicts with unit_tests.bin
* fixed: StrideSlice/Crop was broken when crop axis != dim.size() - 1 & added support for tensor dim > 2
fixed: clamp had hard coded upper & lower boundary to -50/50
fixed: InsertIdentityLayerPass was adding not necessary identities that was leading to exception when 2 identities was added to convolution output
fixed: SubstituteScaleShiftBroadCastPass caused invalid input tensor dimension overwrite - instead of overwrite currently reshape is injected
* updated copyright header dates
* updated copyright date
* fixed braces not at the end of line
* fixed braces in if else sequence
* shortened line length
* fixed issues reported in review
* fixed test - model in test assumed clamped range <-5,5> however code had hard coded value <-50,50>, which test assumed as correct result
* fixed smoke_MemoryEltwiseReshapeConcatTest/MemoryEltwiseReshapeConcatTest
* [GNA] Added test for crop 4d
Co-authored-by: Andrey Dmitriev <andrey.dmitriev@intel.com>
- Created emitters for jitted load and store and apply to MVN node
- MVN template function removed
- Optimized tiles processing in MVN node implementation
Enable tests including rectangular kernel and multiple kernels
Pad filters to 16B
Fix style space after if before ( needed
Fix PRETTY_FUNCTION double def
Fix canMatchWith1AsyncThread
Fix ifdefs for gna 2.0
Add and fix mock
Simplify and fix condition for Rotate features
Refine commnets in GNA CONV tests file
Apply review, Refactor ConvolutionPrimitive
Refine CNN enforce legacy
Add debug print
Move debug dump definitions
Add new metric for GNA library version
Add coments on FP32
* [GNA] added support for per-channel FakeQuantise layer
* [GNA] added quantisation types detection in FQ enabled networks, and added input scale factors detection from FQ connected to input layer
* added FakeQuantize callback that will be use to cast integer values stored as float in FakeQuantized layer
* fixed per-channel multiplier calculation for int8 case
* precision improvements for int8 fake quantization and support for propagating scale factors to activation layers
* added initial int16 support
* added support for fake quantize layer with many connected output layers and support for FQ data encoded as FP16
* added support for already quantized weights
* Shared single layer test
* Added subgraph test
* Fix comment
* int8
* Enabling FQ tests on GNA
Co-authored-by: Eugene Smirnov <eugene.smirnov@intel.com>
Co-authored-by: Andrey Dmitriev <andrey.dmitriev@intel.com>
* QueryState moved to InferRequest
* deprecate ExecutableNetwork::QueryState,chaged tests (without any check yet)
* fix build
* review fixes + build fix
* build fix + review changes
* remove blank line
* style fixes
* test build fixes
* style fix
* style fix
* fixed build of tests
* fix
* mac build fix
* hddl plugin build fix
* clean up unneeded implementation for method
* fixed tests build
* add implementation for getstate, correct getName for MklDNN
* fixed description of state API in comments
* lint fixes
* Rename MemoryState to VariableState
* added tests for cpu for VariableStates, several small fixes in tests and code
* merge fix
* lint fix
* remove whitespaces
* spaces fix
* fix in test to make it workable for all plugins
* fix typo
* fix test for gna
* remove extra comment
* fix test for gna