******************************************************************************** conan test conan-center-index/recipes/gemmlowp/all/test_package/conanfile.py gemmlowp/cci.20210928@ --profile=/home/conan/w/BuildSingleReference/49544/fcdfb011-97a3-4888-a455-33e1172c0a65/profile.txt ******************************************************************************** Configuration: [settings] arch=x86_64 build_type=Debug compiler=gcc compiler.libcxx=libstdc++11 compiler.version=6 os=Linux [options] gemmlowp:shared=True [build_requires] [env] gemmlowp/cci.20210928 (test package): Installing package Requirements gemmlowp/cci.20210928 from local cache - Cache Packages gemmlowp/cci.20210928:fb3febff600cca4aaabce135ed5f3e8edeb34f03 - Cache Installing (downloading, building) binaries... gemmlowp/cci.20210928: Already installed! [HOOK - conan-center.py] post_package_info(): [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] OK [HOOK - conan-center.py] post_package_info(): [LIBRARY DOES NOT EXIST (KB-H054)] OK gemmlowp/cci.20210928 (test package): Generator cmake_find_package_multi created gemmlowp-config-version.cmake gemmlowp/cci.20210928 (test package): Generator cmake_find_package_multi created gemmlowpTarget-debug.cmake gemmlowp/cci.20210928 (test package): Generator cmake_find_package_multi created gemmlowpTargets.cmake gemmlowp/cci.20210928 (test package): Generator cmake_find_package_multi created gemmlowp-config.cmake gemmlowp/cci.20210928 (test package): Generator txt created conanbuildinfo.txt gemmlowp/cci.20210928 (test package): Generator cmake created conanbuildinfo.cmake gemmlowp/cci.20210928 (test package): Aggregating env generators gemmlowp/cci.20210928 (test package): Generated conaninfo.txt gemmlowp/cci.20210928 (test package): Generated graphinfo Using lockfile: '/home/conan/w/BuildSingleReference/conan-center-index/recipes/gemmlowp/all/test_package/build/35288ba34fd81e220a74458cd963a4261dda6703/conan.lock' Using cached profile from lockfile [HOOK - conan-center.py] pre_build(): [FPIC MANAGEMENT (KB-H007)] 'fPIC' option not found [HOOK - conan-center.py] pre_build(): [FPIC MANAGEMENT (KB-H007)] OK gemmlowp/cci.20210928 (test package): Calling build() ----Running------ > cd '/home/conan/w/BuildSingleReference/conan-center-index/recipes/gemmlowp/all/test_package/build/35288ba34fd81e220a74458cd963a4261dda6703' && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Debug" -DCONAN_IN_LOCAL_CACHE="OFF" -DCONAN_COMPILER="gcc" -DCONAN_COMPILER_VERSION="6" -DCONAN_CXX_FLAGS="-m64" -DCONAN_SHARED_LINKER_FLAGS="-m64" -DCONAN_C_FLAGS="-m64" -DCONAN_LIBCXX="libstdc++11" -DCMAKE_INSTALL_PREFIX="/home/conan/w/BuildSingleReference/conan-center-index/recipes/gemmlowp/all/test_package/build/35288ba34fd81e220a74458cd963a4261dda6703/package" -DCMAKE_INSTALL_BINDIR="bin" -DCMAKE_INSTALL_SBINDIR="bin" -DCMAKE_INSTALL_LIBEXECDIR="bin" -DCMAKE_INSTALL_LIBDIR="lib" -DCMAKE_INSTALL_INCLUDEDIR="include" -DCMAKE_INSTALL_OLDINCLUDEDIR="include" -DCMAKE_INSTALL_DATAROOTDIR="share" -DCMAKE_PREFIX_PATH="/home/conan/w/BuildSingleReference/conan-center-index/recipes/gemmlowp/all/test_package/build/35288ba34fd81e220a74458cd963a4261dda6703" -DCMAKE_MODULE_PATH="/home/conan/w/BuildSingleReference/conan-center-index/recipes/gemmlowp/all/test_package/build/35288ba34fd81e220a74458cd963a4261dda6703" -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY="ON" -DCONAN_EXPORTED="1" -Wno-dev '/home/conan/w/BuildSingleReference/conan-center-index/recipes/gemmlowp/all/test_package' ----------------- -- The C compiler identification is GNU 6.4.0 -- The CXX compiler identification is GNU 6.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/g++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Conan: called by CMake conan helper -- Conan: Adjusting output directories -- Conan: Using cmake targets configuration -- Library eight_bit_int_gemm found /home/conan/w/BuildSingleReference/.conan/data/gemmlowp/cci.20210928/_/_/package/fb3febff600cca4aaabce135ed5f3e8edeb34f03/lib/libeight_bit_int_gemm.so -- Conan: Adjusting default RPATHs Conan policies -- Conan: Adjusting language standard -- Conan: Compiler GCC>=5, checking major version 6 -- Conan: Checking correct version: 6 -- Conan: C++ stdlib: libstdc++11 -- Library eight_bit_int_gemm found /home/conan/w/BuildSingleReference/.conan/data/gemmlowp/cci.20210928/_/_/package/fb3febff600cca4aaabce135ed5f3e8edeb34f03/lib/libeight_bit_int_gemm.so -- Found: /home/conan/w/BuildSingleReference/.conan/data/gemmlowp/cci.20210928/_/_/package/fb3febff600cca4aaabce135ed5f3e8edeb34f03/lib/libeight_bit_int_gemm.so -- Library eight_bit_int_gemm found /home/conan/w/BuildSingleReference/.conan/data/gemmlowp/cci.20210928/_/_/package/fb3febff600cca4aaabce135ed5f3e8edeb34f03/lib/libeight_bit_int_gemm.so -- Found: /home/conan/w/BuildSingleReference/.conan/data/gemmlowp/cci.20210928/_/_/package/fb3febff600cca4aaabce135ed5f3e8edeb34f03/lib/libeight_bit_int_gemm.so -- Configuring done -- Generating done -- Build files have been written to: /home/conan/w/BuildSingleReference/conan-center-index/recipes/gemmlowp/all/test_package/build/35288ba34fd81e220a74458cd963a4261dda6703 ----Running------ > cmake --build '/home/conan/w/BuildSingleReference/conan-center-index/recipes/gemmlowp/all/test_package/build/35288ba34fd81e220a74458cd963a4261dda6703' '--' '-j3' ----------------- Scanning dependencies of target test_package [ 50%] Building CXX object CMakeFiles/test_package.dir/test_package.cpp.o [100%] Linking CXX executable bin/test_package [100%] Built target test_package gemmlowp/cci.20210928 (test package): Running test() ----Running------ > bin/test_package ----------------- First, let us make some float matrices LHS and RHS, and compute their product. Here is the float LHS matrix: 0.629 0.812 -0.746 0.827 -0.729 0.67 0.938 -0.558 Here is the float RHS matrix: 0.265 -0.443 0.915 -0.384 -0.623 0.993 -0.805 0.0938 0.93 0.0944 0.986 0.935 Here is the float product (LHS * RHS) matrix obtained by ordinary float matrix multiplication, i.e. as far as we are concerned, the REFERENCE RESULT: 0.534 -0.0396 1.46 -1.26 -0.557 0.348 Now we embark on reproducing this result using quantized arithmetic. The code below splits into two parts: quantization code that only needs to run offline (e.g. to generate a quantized neural network workload), and actual runtime quantized code, which is typically performance-critical and where we typically do not want to use any floating-point arithmetic. We want to clearly distinguish between the two. The below is OFFLINE QUANTIZATION CODE. We still use some floating-point arithmetic in the process of generating the quantized workload to be run on-device. Now, let us choose quantization parameters for these matrices. You might ask, what good is quantization if we need to pick quantization parameters for the result before we can run the quantized computation to obtain the result? The idea is that we target applications such as neural networks, where unknown results are only allowed to vary within preexisting bounds. In practice, the bounds for the results are typically learned during the neural network training process. The min and max of the result do not have to be exact. If they are too broad, we just get lower quantization accuracy. If they are too narrow, we just get clamping at the bounds. For LHS, we have min = -0.746, max = 0.938, scale = 0.0066, zero_point = 113 For RHS, we have min = -0.805, max = 0.993, scale = 0.00705, zero_point = 114 For the result, we have min = -1.26, max = 1.46, scale = 0.0107, zero_point = 118 Quantized uint8 LHS matrix: 208 236 0 238 3 214 255 29 Quantized uint8 RHS matrix: 152 51 244 60 26 255 0 127 246 127 254 247 End of OFFLINE QUANTIZATION CODE. The below is ON-DEVICE RUNTIME QUANTIZED CODE. This is the part that is performance-critical and may only use quantized arithmetic. Quantized uint8 result matrix obtained by quantized multiplication: 168 115 255 0 66 151 End of ON-DEVICE RUNTIME QUANTIZED CODE. Here is the actual float product (LHS * RHS) matrix obtained by dequantizing the above uint8 result, i.e. as far as we are concerned, the ACTUAL RESULT: 0.533 -0.032 1.46 -1.26 -0.554 0.352 Difference between ACTUAL and REFERENCE float results: -0.000675 0.00764 -0.000674 -0.000674 0.0022 0.00369 CMake Warning: Manually-specified variables were not used by the project: CMAKE_EXPORT_NO_PACKAGE_REGISTRY CMAKE_INSTALL_BINDIR CMAKE_INSTALL_DATAROOTDIR CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_LIBDIR CMAKE_INSTALL_LIBEXECDIR CMAKE_INSTALL_OLDINCLUDEDIR CMAKE_INSTALL_SBINDIR