diff options
Diffstat (limited to 'infra')
89 files changed, 598 insertions, 172 deletions
diff --git a/infra/cmake/modules/IdentifyPlatform.cmake b/infra/cmake/modules/IdentifyPlatform.cmake index 6616283fb..890055fae 100644 --- a/infra/cmake/modules/IdentifyPlatform.cmake +++ b/infra/cmake/modules/IdentifyPlatform.cmake @@ -35,6 +35,8 @@ endif() if("${HOST_ARCH}" STREQUAL "x86_64") set(HOST_ARCH_BASE ${HOST_ARCH}) +elseif("${HOST_ARCH}" STREQUAL "armv7em") + set(HOST_ARCH_BASE "arm") elseif("${HOST_ARCH}" STREQUAL "armv7l") set(HOST_ARCH_BASE "arm") elseif("${HOST_ARCH}" STREQUAL "armv7hl") @@ -49,6 +51,8 @@ endif() if("${TARGET_ARCH}" STREQUAL "x86_64") set(TARGET_ARCH_BASE ${TARGET_ARCH}) +elseif("${TARGET_ARCH}" STREQUAL "armv7em") + set(TARGET_ARCH_BASE "arm") elseif("${TARGET_ARCH}" STREQUAL "armv7l") set(TARGET_ARCH_BASE "arm") elseif("${TARGET_ARCH}" STREQUAL "armv7hl") diff --git a/infra/cmake/packages/AbseilConfig.cmake b/infra/cmake/packages/AbseilConfig.cmake index 6fae7211d..b3cb364e1 100644 --- a/infra/cmake/packages/AbseilConfig.cmake +++ b/infra/cmake/packages/AbseilConfig.cmake @@ -12,11 +12,18 @@ function(_Abseil_import) # NOTE Turn off abseil testing set(BUILD_TESTING OFF) + # Set -fPIC property because Abseil-cpp can be used for shared library + set(CMAKE_POSITION_INDEPENDENT_CODE ON) + # Abseil-cpp 20211102.0 show warning without below setting + set(ABSL_PROPAGATE_CXX_STD ON) + add_extdirectory("${AbseilSource_DIR}" ABSEIL) add_library(abseil INTERFACE) + target_link_libraries(abseil INTERFACE # From "Available Abseil CMake Public Targets" in CMake/README.md + # Add absl::status (It is not listed in CMake/README.md) absl::algorithm absl::base absl::debugging @@ -27,19 +34,14 @@ function(_Abseil_import) absl::numeric absl::random_random absl::strings - absl::status absl::synchronization absl::time absl::utility + absl::status ) endif(NOT TARGET abseil) set(Abseil_FOUND TRUE PARENT_SCOPE) endfunction(_Abseil_import) -set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fPIC") -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fPIC") -set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fPIC") -set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fPIC") - _Abseil_import() diff --git a/infra/cmake/packages/AbseilSourceConfig.cmake b/infra/cmake/packages/AbseilSourceConfig.cmake index 8aeb86db3..0297c08bc 100644 --- a/infra/cmake/packages/AbseilSourceConfig.cmake +++ b/infra/cmake/packages/AbseilSourceConfig.cmake @@ -7,14 +7,13 @@ function(_AbseilSource_import) nnas_include(ExternalSourceTools) nnas_include(OptionTools) - # NOTE TensorFlow 2.3 downloads abseil from the following URL + # NOTE TensorFlow 2.9 downloads abseil 20211102.0 envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") - envoption(ABSEIL_URL ${EXTERNAL_DOWNLOAD_SERVER}/abseil/abseil-cpp/archive/df3ea785d8c30a9503321a3d35ee7d35808f190d.tar.gz) - + envoption(ABSEIL_URL ${EXTERNAL_DOWNLOAD_SERVER}/abseil/abseil-cpp/archive/20211102.0.tar.gz) ExternalSource_Download(ABSEIL DIRNAME ABSEIL URL ${ABSEIL_URL} - CHECKSUM MD5=4d9aa7e757adf48fef171c85f0d88552) + CHECKSUM MD5=bdca561519192543378b7cade101ec43) set(AbseilSource_DIR ${ABSEIL_SOURCE_DIR} PARENT_SCOPE) set(AbseilSource_FOUND TRUE PARENT_SCOPE) diff --git a/infra/cmake/packages/CMSISSource-5.8.0/CMSISSourceConfig.cmake b/infra/cmake/packages/CMSISSource-5.8.0/CMSISSourceConfig.cmake index 99118c5d9..d1588d3fd 100644 --- a/infra/cmake/packages/CMSISSource-5.8.0/CMSISSourceConfig.cmake +++ b/infra/cmake/packages/CMSISSource-5.8.0/CMSISSourceConfig.cmake @@ -2,7 +2,8 @@ function(_CMSISSource_import) nnas_include(ExternalSourceTools) nnas_include(OptionTools) - envoption(CMSIS_5_8_0_URL https://github.com/ARM-software/CMSIS_5/archive/refs/tags/5.8.0.tar.gz) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(CMSIS_5_8_0_URL ${EXTERNAL_DOWNLOAD_SERVER}/ARM-software/CMSIS_5/archive/refs/tags/5.8.0.tar.gz) set(CMSIS_5_8_0_SHA256 fe6b697b8782e7fd6131034b7646a3b65c83018774abf7f9f94901a3bc7c82ad) ExternalSource_Download(CMSIS DIRNAME CMSIS-5.8.0 ${CMSIS_5_8_0_URL} diff --git a/infra/cmake/packages/CaffeSourceConfig.cmake b/infra/cmake/packages/CaffeSourceConfig.cmake index 41cc2c9f7..05eb5b30e 100644 --- a/infra/cmake/packages/CaffeSourceConfig.cmake +++ b/infra/cmake/packages/CaffeSourceConfig.cmake @@ -7,7 +7,8 @@ function(_CaffeSource_import) nnas_include(ExternalSourceTools) nnas_include(OptionTools) - envoption(CAFFE_URL https://github.com/BVLC/caffe/archive/1.0.tar.gz) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(CAFFE_URL ${EXTERNAL_DOWNLOAD_SERVER}/BVLC/caffe/archive/1.0.tar.gz) ExternalSource_Download(CAFFE ${CAFFE_URL}) diff --git a/infra/cmake/packages/CpuInfoSourceConfig.cmake b/infra/cmake/packages/CpuInfoSourceConfig.cmake index 60419ad9f..b93a6a2e5 100644 --- a/infra/cmake/packages/CpuInfoSourceConfig.cmake +++ b/infra/cmake/packages/CpuInfoSourceConfig.cmake @@ -8,8 +8,8 @@ function(_CpuInfoSource_import) nnas_include(OptionTools) envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") - # CPUINFO commit including patch from tflite v2.3 - envoption(CPUINFO_URL ${EXTERNAL_DOWNLOAD_SERVER}/pytorch/cpuinfo/archive/63b254577ed77a8004a9be6ac707f3dccc4e1fd9.tar.gz) + # CPUINFO commit from tflite v2.8 + envoption(CPUINFO_URL ${EXTERNAL_DOWNLOAD_SERVER}/pytorch/cpuinfo/archive/5916273f79a21551890fd3d56fc5375a78d1598d.tar.gz) ExternalSource_Download(CPUINFO DIRNAME CPUINFO URL ${CPUINFO_URL}) diff --git a/infra/cmake/packages/Egl_HeadersSourceConfig.cmake b/infra/cmake/packages/Egl_HeadersSourceConfig.cmake new file mode 100644 index 000000000..fae57f6ce --- /dev/null +++ b/infra/cmake/packages/Egl_HeadersSourceConfig.cmake @@ -0,0 +1,21 @@ +function(_Egl_HeadersSource_import) + if(NOT DOWNLOAD_EGL_HEADERS) + set(Egl_HeadersSource_FOUND FALSE PARENT_SCOPE) + return() + endif(NOT DOWNLOAD_EGL_HEADERS) + + nnas_include(ExternalSourceTools) + nnas_include(OptionTools) + + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(EGL_HEADERS_URL ${EXTERNAL_DOWNLOAD_SERVER}/KhronosGroup/EGL-Registry/archive/649981109e263b737e7735933c90626c29a306f2.zip) + + ExternalSource_Download(EGL_HEADERS + DIRNAME EGL_HEADERS + URL ${EGL_HEADERS_URL}) + + set(Egl_HeadersSource_DIR ${EGL_HEADERS_SOURCE_DIR} PARENT_SCOPE) + set(Egl_HeadersSource_FOUND TRUE PARENT_SCOPE) +endfunction(_Egl_HeadersSource_import) + +_Egl_HeadersSource_import() diff --git a/infra/cmake/packages/FarmhashSourceConfig.cmake b/infra/cmake/packages/FarmhashSourceConfig.cmake index a19c8b992..fa1867c5c 100644 --- a/infra/cmake/packages/FarmhashSourceConfig.cmake +++ b/infra/cmake/packages/FarmhashSourceConfig.cmake @@ -10,7 +10,8 @@ function(_FarmhashSource_import) # NOTE TensorFlow 1.12 downloads farmhash from the following URL # TensorFlow 1.13.1 downloads farmhash from the following URL # TensorFlow 2.3.0 downloads farmhash from the following URL - envoption(FARMHASH_1_12_URL https://github.com/google/farmhash/archive/816a4ae622e964763ca0862d9dbd19324a1eaf45.tar.gz) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(FARMHASH_1_12_URL ${EXTERNAL_DOWNLOAD_SERVER}/google/farmhash/archive/816a4ae622e964763ca0862d9dbd19324a1eaf45.tar.gz) ExternalSource_Download(FARMHASH ${FARMHASH_1_12_URL}) diff --git a/infra/cmake/packages/FlatBuffersSource-2.0/FlatBuffersSourceConfig.cmake b/infra/cmake/packages/FlatBuffersSource-2.0/FlatBuffersSourceConfig.cmake index a0a32aa9e..e094055b7 100644 --- a/infra/cmake/packages/FlatBuffersSource-2.0/FlatBuffersSourceConfig.cmake +++ b/infra/cmake/packages/FlatBuffersSource-2.0/FlatBuffersSourceConfig.cmake @@ -7,7 +7,8 @@ function(_FlatBuffersSource_import) nnas_include(ExternalSourceTools) nnas_include(OptionTools) - envoption(FLATBUFFERS_2_0_URL https://github.com/google/flatbuffers/archive/v2.0.0.tar.gz) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(FLATBUFFERS_2_0_URL ${EXTERNAL_DOWNLOAD_SERVER}/google/flatbuffers/archive/v2.0.0.tar.gz) ExternalSource_Download(FLATBUFFERS DIRNAME FLATBUFFERS-2.0 CHECKSUM MD5=a27992324c3cbf86dd888268a23d17bd diff --git a/infra/cmake/packages/Fp16SourceConfig.cmake b/infra/cmake/packages/Fp16SourceConfig.cmake index 3623fd210..3df4e4cc5 100644 --- a/infra/cmake/packages/Fp16SourceConfig.cmake +++ b/infra/cmake/packages/Fp16SourceConfig.cmake @@ -9,7 +9,7 @@ function(_Fp16Source_import) envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") # fp16 commit in xnnpack 8b283aa30a31 - envoption(FP16_URL ${EXTERNAL_DOWNLOAD_SERVER}/Maratyszcza/FP16/archive/3c54eacb74f6f5e39077300c5564156c424d77ba.tar.gz) + envoption(FP16_URL ${EXTERNAL_DOWNLOAD_SERVER}/Maratyszcza/FP16/archive/4dfe081cf6bcd15db339cf2680b9281b8451eeb3.tar.gz) ExternalSource_Download(FP16 DIRNAME FP16 URL ${FP16_URL}) diff --git a/infra/cmake/packages/GEMMLowpSourceConfig.cmake b/infra/cmake/packages/GEMMLowpSourceConfig.cmake index 6e1cfa9c9..3b3560359 100644 --- a/infra/cmake/packages/GEMMLowpSourceConfig.cmake +++ b/infra/cmake/packages/GEMMLowpSourceConfig.cmake @@ -9,7 +9,8 @@ function(_GEMMLowpSource_import) # NOTE TensorFlow 1.12 uses the following URL # TensorFlow 1.13.1 uses the following URL - envoption(GEMMLOWP_URL https://github.com/google/gemmlowp/archive/38ebac7b059e84692f53e5938f97a9943c120d98.tar.gz) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(GEMMLOWP_URL ${EXTERNAL_DOWNLOAD_SERVER}/google/gemmlowp/archive/38ebac7b059e84692f53e5938f97a9943c120d98.tar.gz) ExternalSource_Download(GEMMLOWP ${GEMMLOWP_URL}) diff --git a/infra/cmake/packages/GFlagsSourceConfig.cmake b/infra/cmake/packages/GFlagsSourceConfig.cmake index 3e70d89fc..2f9b7537f 100644 --- a/infra/cmake/packages/GFlagsSourceConfig.cmake +++ b/infra/cmake/packages/GFlagsSourceConfig.cmake @@ -7,7 +7,8 @@ function(_GFlagsSource_import) nnas_include(ExternalSourceTools) nnas_include(OptionTools) - envoption(GFLAGS_URL https://github.com/gflags/gflags/archive/v2.2.1.tar.gz) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(GFLAGS_URL ${EXTERNAL_DOWNLOAD_SERVER}/gflags/gflags/archive/v2.2.1.tar.gz) ExternalSource_Download(GFLAGS ${GFLAGS_URL}) diff --git a/infra/cmake/packages/GTestSourceConfig.cmake b/infra/cmake/packages/GTestSourceConfig.cmake index e57d0965a..643c3d109 100644 --- a/infra/cmake/packages/GTestSourceConfig.cmake +++ b/infra/cmake/packages/GTestSourceConfig.cmake @@ -7,7 +7,8 @@ function(_GTestSource_import) nnas_include(ExternalSourceTools) nnas_include(OptionTools) - envoption(GTEST_URL https://github.com/google/googletest/archive/release-1.11.0.tar.gz) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(GTEST_URL ${EXTERNAL_DOWNLOAD_SERVER}/google/googletest/archive/release-1.11.0.tar.gz) ExternalSource_Download(GTEST ${GTEST_URL}) diff --git a/infra/cmake/packages/HDF5SourceConfig.cmake b/infra/cmake/packages/HDF5SourceConfig.cmake index 9db048c86..3440dbd20 100644 --- a/infra/cmake/packages/HDF5SourceConfig.cmake +++ b/infra/cmake/packages/HDF5SourceConfig.cmake @@ -7,7 +7,8 @@ function(_HDF5Source_import) nnas_include(ExternalSourceTools) nnas_include(OptionTools) - envoption(HDF5_URL https://github.com/HDFGroup/hdf5/archive/hdf5-1_8_16.tar.gz) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(HDF5_URL ${EXTERNAL_DOWNLOAD_SERVER}/HDFGroup/hdf5/archive/hdf5-1_8_16.tar.gz) ExternalSource_Download(HDF5 ${HDF5_URL} PATCH ${CMAKE_CURRENT_LIST_DIR}/HDF5Source.patch) diff --git a/infra/cmake/packages/JsoncppSourceConfig.cmake b/infra/cmake/packages/JsoncppSourceConfig.cmake index 3195ea479..8d672854b 100644 --- a/infra/cmake/packages/JsoncppSourceConfig.cmake +++ b/infra/cmake/packages/JsoncppSourceConfig.cmake @@ -7,7 +7,8 @@ function(_JsoncppSource_import) nnas_include(ExternalSourceTools) nnas_include(OptionTools) - envoption(JSONCPP_URL https://github.com/open-source-parsers/jsoncpp/archive/refs/tags/1.9.5.tar.gz) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(JSONCPP_URL ${EXTERNAL_DOWNLOAD_SERVER}/open-source-parsers/jsoncpp/archive/refs/tags/1.9.5.tar.gz) ExternalSource_Download(JSONCPP ${JSONCPP_URL}) diff --git a/infra/cmake/packages/MbedOSSource-6.15/MbedOSSourceConfig.cmake b/infra/cmake/packages/MbedOSSource-6.15/MbedOSSourceConfig.cmake index 805554538..e55647da8 100644 --- a/infra/cmake/packages/MbedOSSource-6.15/MbedOSSourceConfig.cmake +++ b/infra/cmake/packages/MbedOSSource-6.15/MbedOSSourceConfig.cmake @@ -2,7 +2,8 @@ function(_MbedOSSource_import) nnas_include(ExternalSourceTools) nnas_include(OptionTools) - envoption(MBEDOS_6_15_URL https://github.com/ARMmbed/mbed-os/archive/refs/tags/mbed-os-6.15.0.tar.gz) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(MBEDOS_6_15_URL ${EXTERNAL_DOWNLOAD_SERVER}/ARMmbed/mbed-os/archive/refs/tags/mbed-os-6.15.0.tar.gz) set(MBEDOS_6_15_SHA256 529b04c41f3020ed8a62f12d47f2d3de87e1b07fb13708534534a587f7ea048e) ExternalSource_Download(MBEDOS DIRNAME MBEDOS-6.15 ${MBEDOS_6_15_URL} diff --git a/infra/cmake/packages/NEON2SSESourceConfig.cmake b/infra/cmake/packages/NEON2SSESourceConfig.cmake index bd40267a5..82c71e2a8 100644 --- a/infra/cmake/packages/NEON2SSESourceConfig.cmake +++ b/infra/cmake/packages/NEON2SSESourceConfig.cmake @@ -8,10 +8,10 @@ function(_NEON2SSESource_import) nnas_include(OptionTools) # NOTE TensorFlow 1.13.1 downloads NEON2SSE from the following URL - # NOTE TensorFlow 2.1 downloads NEON2SSE from the following URL - # NOTE TensorFlow 2.2 downloads NEON2SSE from the following URL - # NOTE TensorFlow 2.3 downloads NEON2SSE from the following URL - envoption(NEON2SSE_URL https://github.com/intel/ARM_NEON_2_x86_SSE/archive/1200fe90bb174a6224a525ee60148671a786a71f.tar.gz) + # NOTE TensorFlow 2.8.0 downloads NEON2SSE from the following URL + # NOTE commit c12f8932c3be5aebaf35562d699f645686c4e2c3 will resolve build fail on debug build + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(NEON2SSE_URL ${EXTERNAL_DOWNLOAD_SERVER}/intel/ARM_NEON_2_x86_SSE/archive/1200fe90bb174a6224a525ee60148671a786a71f.tar.gz) ExternalSource_Download(NEON2SSE ${NEON2SSE_URL}) diff --git a/infra/cmake/packages/ONNXSource-1.4.1/ONNXSourceConfig.cmake b/infra/cmake/packages/ONNXSource-1.4.1/ONNXSourceConfig.cmake index c9fb5e490..fe21f6d3d 100644 --- a/infra/cmake/packages/ONNXSource-1.4.1/ONNXSourceConfig.cmake +++ b/infra/cmake/packages/ONNXSource-1.4.1/ONNXSourceConfig.cmake @@ -7,7 +7,8 @@ function(_ONNXSource_import) nnas_include(ExternalSourceTools) nnas_include(OptionTools) - envoption(ONNX_1_4_1_URL https://github.com/onnx/onnx/archive/v1.4.1.zip) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(ONNX_1_4_1_URL ${EXTERNAL_DOWNLOAD_SERVER}/onnx/onnx/archive/v1.4.1.zip) ExternalSource_Download(ONNX DIRNAME ONNX-1.4.1 CHECKSUM MD5=604b43a22fbc758f32ae9f3a4fb9d397 diff --git a/infra/cmake/packages/ONNXSource-1.6.0/ONNXSourceConfig.cmake b/infra/cmake/packages/ONNXSource-1.6.0/ONNXSourceConfig.cmake index ef903f834..b2ad08b90 100644 --- a/infra/cmake/packages/ONNXSource-1.6.0/ONNXSourceConfig.cmake +++ b/infra/cmake/packages/ONNXSource-1.6.0/ONNXSourceConfig.cmake @@ -7,7 +7,8 @@ function(_ONNXSource_import) nnas_include(ExternalSourceTools) nnas_include(OptionTools) - envoption(ONNX_1_6_0_URL https://github.com/onnx/onnx/archive/v1.6.0.zip) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(ONNX_1_6_0_URL ${EXTERNAL_DOWNLOAD_SERVER}/onnx/onnx/archive/v1.6.0.zip) ExternalSource_Download(ONNX DIRNAME ONNX-1.6.0 CHECKSUM MD5=cbdc547a527f1b59c7f066c8d258b966 diff --git a/infra/cmake/packages/OouraFFTSourceConfig.cmake b/infra/cmake/packages/OouraFFTSourceConfig.cmake index be551fbe4..d84b5b20f 100644 --- a/infra/cmake/packages/OouraFFTSourceConfig.cmake +++ b/infra/cmake/packages/OouraFFTSourceConfig.cmake @@ -8,7 +8,8 @@ function(_OouraFFTSource_import) nnas_include(OptionTools) # NOTE TensorFlow 2.3 downloads OOURAFFT from the following URL - envoption(OOURAFFT_URL https://github.com/petewarden/OouraFFT/archive/v1.0.tar.gz) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(OOURAFFT_URL ${EXTERNAL_DOWNLOAD_SERVER}/petewarden/OouraFFT/archive/v1.0.tar.gz) ExternalSource_Download(OOURAFFT ${OOURAFFT_URL}) diff --git a/infra/cmake/packages/Opengl_HeadersSourceConfig.cmake b/infra/cmake/packages/Opengl_HeadersSourceConfig.cmake new file mode 100644 index 000000000..c5a774a73 --- /dev/null +++ b/infra/cmake/packages/Opengl_HeadersSourceConfig.cmake @@ -0,0 +1,21 @@ +function(_Opengl_HeadersSource_import) + if(NOT DOWNLOAD_OPENGL_HEADERS) + set(Opengl_HeadersSource_FOUND FALSE PARENT_SCOPE) + return() + endif(NOT DOWNLOAD_OPENGL_HEADERS) + + nnas_include(ExternalSourceTools) + nnas_include(OptionTools) + + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(OPENGL_HEADERS_URL ${EXTERNAL_DOWNLOAD_SERVER}/KhronosGroup/OpenGL-Registry/archive/0cb0880d91581d34f96899c86fc1bf35627b4b81.zip) + + ExternalSource_Download(OPENGL_HEADERS + DIRNAME OPENGL_HEADERS + URL ${OPENGL_HEADERS_URL}) + + set(Opengl_HeadersSource_DIR ${OPENGL_HEADERS_SOURCE_DIR} PARENT_SCOPE) + set(Opengl_HeadersSource_FOUND TRUE PARENT_SCOPE) +endfunction(_Opengl_HeadersSource_import) + +_Opengl_HeadersSource_import() diff --git a/infra/cmake/packages/ProtobufSourceConfig.cmake b/infra/cmake/packages/ProtobufSourceConfig.cmake index baa49eeb0..a1704e53d 100644 --- a/infra/cmake/packages/ProtobufSourceConfig.cmake +++ b/infra/cmake/packages/ProtobufSourceConfig.cmake @@ -7,7 +7,8 @@ function(_ProtobufSource_import) nnas_include(ExternalSourceTools) nnas_include(OptionTools) - envoption(PROTOBUF_URL https://github.com/protocolbuffers/protobuf/archive/v3.5.2.tar.gz) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(PROTOBUF_URL ${EXTERNAL_DOWNLOAD_SERVER}/protocolbuffers/protobuf/archive/v3.5.2.tar.gz) ExternalSource_Download(PROTOBUF ${PROTOBUF_URL} PATCH ${CMAKE_CURRENT_LIST_DIR}/ProtobufSource.patch) diff --git a/infra/cmake/packages/Pybind11SourceConfig.cmake b/infra/cmake/packages/Pybind11SourceConfig.cmake index 76f51e4d3..2f6425355 100644 --- a/infra/cmake/packages/Pybind11SourceConfig.cmake +++ b/infra/cmake/packages/Pybind11SourceConfig.cmake @@ -7,7 +7,8 @@ function(_Pybind11Source_import) nnas_include(ExternalSourceTools) nnas_include(OptionTools) - envoption(PYBIND11_URL https://github.com/pybind/pybind11/archive/v2.5.0.tar.gz) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(PYBIND11_URL ${EXTERNAL_DOWNLOAD_SERVER}/pybind/pybind11/archive/v2.5.0.tar.gz) ExternalSource_Download(PYBIND11 ${PYBIND11_URL}) diff --git a/infra/cmake/packages/PytorchSourceConfig.cmake b/infra/cmake/packages/PytorchSourceConfig.cmake index 0212f2f4b..94757f865 100644 --- a/infra/cmake/packages/PytorchSourceConfig.cmake +++ b/infra/cmake/packages/PytorchSourceConfig.cmake @@ -7,7 +7,8 @@ function(_PytorchSource_import) nnas_include(ExternalSourceTools) nnas_include(OptionTools) - envoption(PYTORCH_URL https://github.com/pytorch/pytorch/archive/v0.4.1.tar.gz) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(PYTORCH_URL ${EXTERNAL_DOWNLOAD_SERVER}/pytorch/pytorch/archive/v0.4.1.tar.gz) ExternalSource_Download(PYTORCH ${PYTORCH_URL}) diff --git a/infra/cmake/packages/TensorFlowEigenSource-2.1.0/TensorFlowEigenSourceConfig.cmake b/infra/cmake/packages/TensorFlowEigenSource-2.1.0/TensorFlowEigenSourceConfig.cmake index f84675596..8120ebca2 100644 --- a/infra/cmake/packages/TensorFlowEigenSource-2.1.0/TensorFlowEigenSourceConfig.cmake +++ b/infra/cmake/packages/TensorFlowEigenSource-2.1.0/TensorFlowEigenSourceConfig.cmake @@ -9,7 +9,8 @@ function(_TensorFlowEigenSource_import) # Exact version used by TensorFlow v2.1.0. # See tensorflow/tensorflow/workspace.bzl. - envoption(TENSORFLOW_2_1_0_EIGEN_URL https://gitlab.com/libeigen/eigen/-/archive/4e696901f873a2347f76d931cf2f701e31e15d05/eigen-4e696901f873a2347f76d931cf2f701e31e15d05.tar.gz) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://gitlab.com") + envoption(TENSORFLOW_2_1_0_EIGEN_URL ${EXTERNAL_DOWNLOAD_SERVER}/libeigen/eigen/-/archive/4e696901f873a2347f76d931cf2f701e31e15d05/eigen-4e696901f873a2347f76d931cf2f701e31e15d05.tar.gz) ExternalSource_Download(EIGEN DIRNAME TENSORFLOW-2.1.0-EIGEN ${TENSORFLOW_2_1_0_EIGEN_URL}) diff --git a/infra/cmake/packages/TensorFlowEigenSource-2.8.0/TensorFlowEigenSourceConfig.cmake b/infra/cmake/packages/TensorFlowEigenSource-2.8.0/TensorFlowEigenSourceConfig.cmake new file mode 100644 index 000000000..6f59f0771 --- /dev/null +++ b/infra/cmake/packages/TensorFlowEigenSource-2.8.0/TensorFlowEigenSourceConfig.cmake @@ -0,0 +1,21 @@ +function(_TensorFlowEigenSource_import) + if(NOT DOWNLOAD_EIGEN) + set(TensorFlowEigenSource_FOUND FALSE PARENT_SCOPE) + return() + endif(NOT DOWNLOAD_EIGEN) + + nnas_include(ExternalSourceTools) + nnas_include(OptionTools) + + # Exact version used by TensorFlow v2.8.0. + # See tensorflow/third_party/eigen3/workspace.bzl. + envoption(EXTERNAL_DOWNLOAD_SERVER "https://gitlab.com") + envoption(TENSORFLOW_2_8_0_EIGEN_URL ${EXTERNAL_DOWNLOAD_SERVER}/libeigen/eigen/-/archive/008ff3483a8c5604639e1c4d204eae30ad737af6/eigen-e1dd31ce174c3d26fbe38388f64b09d2adbd7557a59e90e6f545a288cc1755fc.tar.gz) + + ExternalSource_Download(EIGEN DIRNAME TENSORFLOW-2.8.0-EIGEN ${TENSORFLOW_2_8_0_EIGEN_URL}) + + set(TensorFlowEigenSource_DIR ${EIGEN_SOURCE_DIR} PARENT_SCOPE) + set(TensorFlowEigenSource_FOUND TRUE PARENT_SCOPE) +endfunction(_TensorFlowEigenSource_import) + +_TensorFlowEigenSource_import() diff --git a/infra/cmake/packages/TensorFlowEigenSource-2.8.0/TensorFlowEigenSourceConfigVersion.cmake b/infra/cmake/packages/TensorFlowEigenSource-2.8.0/TensorFlowEigenSourceConfigVersion.cmake new file mode 100644 index 000000000..2ad2e241e --- /dev/null +++ b/infra/cmake/packages/TensorFlowEigenSource-2.8.0/TensorFlowEigenSourceConfigVersion.cmake @@ -0,0 +1,10 @@ +set(PACKAGE_VERSION "2.8.0") +set(PACKAGE_VERSION_EXACT FALSE) +set(PACKAGE_VERSION_COMPATIBLE FALSE) +set(PACKAGE_VERSION_UNSUITABLE TRUE) + +if(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + set(PACKAGE_VERSION_COMPATIBLE TRUE) + set(PACKAGE_VERSION_UNSUITABLE FALSE) +endif(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) diff --git a/infra/cmake/packages/TensorFlowGEMMLowpSource-2.1.0/TensorFlowGEMMLowpSourceConfig.cmake b/infra/cmake/packages/TensorFlowGEMMLowpSource-2.1.0/TensorFlowGEMMLowpSourceConfig.cmake index 035264fa9..421be6c66 100644 --- a/infra/cmake/packages/TensorFlowGEMMLowpSource-2.1.0/TensorFlowGEMMLowpSourceConfig.cmake +++ b/infra/cmake/packages/TensorFlowGEMMLowpSource-2.1.0/TensorFlowGEMMLowpSourceConfig.cmake @@ -9,7 +9,8 @@ function(_TensorFlowGEMMLowpSource_import) # Exact version used by TensorFlow v2.1.0. # See tensorflow/tensorflow/workspace.bzl. - envoption(TENSORFLOW_2_1_0_GEMMLOWP_URL https://github.com/google/gemmlowp/archive/12fed0cd7cfcd9e169bf1925bc3a7a58725fdcc3.zip) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(TENSORFLOW_2_1_0_GEMMLOWP_URL ${EXTERNAL_DOWNLOAD_SERVER}/google/gemmlowp/archive/12fed0cd7cfcd9e169bf1925bc3a7a58725fdcc3.zip) ExternalSource_Download(GEMMLOWP DIRNAME TENSORFLOW-2.1.0-GEMMLOWP ${TENSORFLOW_2_1_0_GEMMLOWP_URL}) diff --git a/infra/cmake/packages/TensorFlowGEMMLowpSource-2.3.0/TensorFlowGEMMLowpSourceConfig.cmake b/infra/cmake/packages/TensorFlowGEMMLowpSource-2.3.0/TensorFlowGEMMLowpSourceConfig.cmake index bc13d6227..44c56a6be 100644 --- a/infra/cmake/packages/TensorFlowGEMMLowpSource-2.3.0/TensorFlowGEMMLowpSourceConfig.cmake +++ b/infra/cmake/packages/TensorFlowGEMMLowpSource-2.3.0/TensorFlowGEMMLowpSourceConfig.cmake @@ -9,7 +9,8 @@ function(_TensorFlowGEMMLowpSource_import) # Exact version used by TensorFlow v2.3.0. # See tensorflow/tensorflow/workspace.bzl. - envoption(TENSORFLOW_2_3_0_GEMMLOWP_URL https://github.com/google/gemmlowp/archive/fda83bdc38b118cc6b56753bd540caa49e570745.zip) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(TENSORFLOW_2_3_0_GEMMLOWP_URL ${EXTERNAL_DOWNLOAD_SERVER}/google/gemmlowp/archive/fda83bdc38b118cc6b56753bd540caa49e570745.zip) ExternalSource_Download(GEMMLOWP DIRNAME TENSORFLOW-2.3.0-GEMMLOWP ${TENSORFLOW_2_3_0_GEMMLOWP_URL}) diff --git a/infra/cmake/packages/TensorFlowGEMMLowpSource-2.6.0/TensorFlowGEMMLowpSourceConfig.cmake b/infra/cmake/packages/TensorFlowGEMMLowpSource-2.6.0/TensorFlowGEMMLowpSourceConfig.cmake index b7f3148e8..76cdfdd6c 100644 --- a/infra/cmake/packages/TensorFlowGEMMLowpSource-2.6.0/TensorFlowGEMMLowpSourceConfig.cmake +++ b/infra/cmake/packages/TensorFlowGEMMLowpSource-2.6.0/TensorFlowGEMMLowpSourceConfig.cmake @@ -9,7 +9,8 @@ function(_TensorFlowGEMMLowpSource_import) # Exact version used by TensorFlow v2.6.0. # See tensorflow/third_party/gemmlowp/workspace.bzl. - envoption(TENSORFLOW_2_6_0_GEMMLOWP_URL https://github.com/google/gemmlowp/archive/fda83bdc38b118cc6b56753bd540caa49e570745.zip) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(TENSORFLOW_2_6_0_GEMMLOWP_URL ${EXTERNAL_DOWNLOAD_SERVER}/google/gemmlowp/archive/fda83bdc38b118cc6b56753bd540caa49e570745.zip) ExternalSource_Download(GEMMLOWP DIRNAME TENSORFLOW-2.6.0-GEMMLOWP ${TENSORFLOW_2_6_0_GEMMLOWP_URL}) diff --git a/infra/cmake/packages/TensorFlowGEMMLowpSource-2.8.0/TensorFlowGEMMLowpSourceConfig.cmake b/infra/cmake/packages/TensorFlowGEMMLowpSource-2.8.0/TensorFlowGEMMLowpSourceConfig.cmake index f3663cc78..3e17490c3 100644 --- a/infra/cmake/packages/TensorFlowGEMMLowpSource-2.8.0/TensorFlowGEMMLowpSourceConfig.cmake +++ b/infra/cmake/packages/TensorFlowGEMMLowpSource-2.8.0/TensorFlowGEMMLowpSourceConfig.cmake @@ -9,7 +9,8 @@ function(_TensorFlowGEMMLowpSource_import) # Exact version used by TensorFlow v2.8.0. # See tensorflow/third_party/gemmlowp/workspace.bzl. - envoption(TENSORFLOW_2_8_0_GEMMLOWP_URL https://github.com/google/gemmlowp/archive/fda83bdc38b118cc6b56753bd540caa49e570745.zip) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(TENSORFLOW_2_8_0_GEMMLOWP_URL ${EXTERNAL_DOWNLOAD_SERVER}/google/gemmlowp/archive/fda83bdc38b118cc6b56753bd540caa49e570745.zip) ExternalSource_Download(GEMMLOWP DIRNAME TENSORFLOW-2.8.0-GEMMLOWP ${TENSORFLOW_2_8_0_GEMMLOWP_URL}) diff --git a/infra/cmake/packages/TensorFlowGpuSourceConfig.cmake b/infra/cmake/packages/TensorFlowGpuSourceConfig.cmake index f1debe775..369816a5e 100644 --- a/infra/cmake/packages/TensorFlowGpuSourceConfig.cmake +++ b/infra/cmake/packages/TensorFlowGpuSourceConfig.cmake @@ -13,7 +13,7 @@ function(_TensorFlowGpuSource_Import) set(PATCH_DONE "TRUE") endif() endif() - + if(${PATCH_DONE} STREQUAL "TRUE") message(STATUS "Skip downloading TensorFlowGpuSource") set(TENSORFLOWGPU_SOURCE_DIR "${NNAS_EXTERNALS_DIR}/TENSORFLOW_GPU" PARENT_SCOPE) @@ -28,7 +28,8 @@ function(_TensorFlowGpuSource_Import) # Download TFLite Source Code nnas_include(ExternalSourceTools) nnas_include(OptionTools) - envoption(TENSORFLOW_2_4_1_URL https://github.com/tensorflow/tensorflow/archive/v2.4.1.tar.gz) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(TENSORFLOW_2_4_1_URL ${EXTERNAL_DOWNLOAD_SERVER}/tensorflow/tensorflow/archive/v2.4.1.tar.gz) ExternalSource_Download(TFLITE_GPU_DELEGATE DIRNAME TENSORFLOW-2.4.1 ${TENSORFLOW_2_4_1_URL}) # Patch for non used codes on onert backend/gpu_cl diff --git a/infra/cmake/packages/TensorFlowRuySource-2.3.0/TensorFlowRuySourceConfig.cmake b/infra/cmake/packages/TensorFlowRuySource-2.3.0/TensorFlowRuySourceConfig.cmake index 3dbf05ece..3a7dc893c 100644 --- a/infra/cmake/packages/TensorFlowRuySource-2.3.0/TensorFlowRuySourceConfig.cmake +++ b/infra/cmake/packages/TensorFlowRuySource-2.3.0/TensorFlowRuySourceConfig.cmake @@ -9,7 +9,8 @@ function(_TensorFlowRuySource_import) # Exact version used by TensorFlow v2.3.0. # See tensorflow/third_party/ruy/workspace.bzl - envoption(TENSORFLOW_2_3_0_RUY_URL https://github.com/google/ruy/archive/34ea9f4993955fa1ff4eb58e504421806b7f2e8f.zip) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(TENSORFLOW_2_3_0_RUY_URL ${EXTERNAL_DOWNLOAD_SERVER}/google/ruy/archive/34ea9f4993955fa1ff4eb58e504421806b7f2e8f.zip) ExternalSource_Download(RUY DIRNAME TENSORFLOW-2.3.0-RUY ${TENSORFLOW_2_3_0_RUY_URL}) diff --git a/infra/cmake/packages/TensorFlowRuySource-2.6.0/TensorFlowRuySourceConfig.cmake b/infra/cmake/packages/TensorFlowRuySource-2.6.0/TensorFlowRuySourceConfig.cmake index b4dee914f..e4dd4f2bf 100644 --- a/infra/cmake/packages/TensorFlowRuySource-2.6.0/TensorFlowRuySourceConfig.cmake +++ b/infra/cmake/packages/TensorFlowRuySource-2.6.0/TensorFlowRuySourceConfig.cmake @@ -9,7 +9,8 @@ function(_TensorFlowRuySource_import) # Exact version used by TensorFlow v2.6.0. # See tensorflow/third_party/ruy/workspace.bzl - envoption(TENSORFLOW_2_6_0_RUY_URL https://github.com/google/ruy/archive/e6c1b8dc8a8b00ee74e7268aac8b18d7260ab1ce.zip) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(TENSORFLOW_2_6_0_RUY_URL ${EXTERNAL_DOWNLOAD_SERVER}/google/ruy/archive/e6c1b8dc8a8b00ee74e7268aac8b18d7260ab1ce.zip) ExternalSource_Download(RUY DIRNAME TENSORFLOW-2.6.0-RUY ${TENSORFLOW_2_6_0_RUY_URL}) diff --git a/infra/cmake/packages/TensorFlowRuySource-2.8.0/TensorFlowRuySourceConfig.cmake b/infra/cmake/packages/TensorFlowRuySource-2.8.0/TensorFlowRuySourceConfig.cmake new file mode 100644 index 000000000..2ead7cd51 --- /dev/null +++ b/infra/cmake/packages/TensorFlowRuySource-2.8.0/TensorFlowRuySourceConfig.cmake @@ -0,0 +1,21 @@ +function(_TensorFlowRuySource_import) + if(NOT DOWNLOAD_RUY) + set(TensorFlowRuySource_FOUND FALSE PARENT_SCOPE) + return() + endif(NOT DOWNLOAD_RUY) + + nnas_include(ExternalSourceTools) + nnas_include(OptionTools) + + # Exact version used by TensorFlow v2.8.0. + # See tensorflow/third_party/ruy/workspace.bzl + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(TENSORFLOW_2_8_0_RUY_URL ${EXTERNAL_DOWNLOAD_SERVER}/google/ruy/archive/e6c1b8dc8a8b00ee74e7268aac8b18d7260ab1ce.zip) + + ExternalSource_Download(RUY DIRNAME TENSORFLOW-2.8.0-RUY ${TENSORFLOW_2_8_0_RUY_URL}) + + set(TensorFlowRuySource_DIR ${RUY_SOURCE_DIR} PARENT_SCOPE) + set(TensorFlowRuySource_FOUND TRUE PARENT_SCOPE) +endfunction(_TensorFlowRuySource_import) + +_TensorFlowRuySource_import() diff --git a/infra/cmake/packages/TensorFlowRuySource-2.8.0/TensorFlowRuySourceConfigVersion.cmake b/infra/cmake/packages/TensorFlowRuySource-2.8.0/TensorFlowRuySourceConfigVersion.cmake new file mode 100644 index 000000000..2ad2e241e --- /dev/null +++ b/infra/cmake/packages/TensorFlowRuySource-2.8.0/TensorFlowRuySourceConfigVersion.cmake @@ -0,0 +1,10 @@ +set(PACKAGE_VERSION "2.8.0") +set(PACKAGE_VERSION_EXACT FALSE) +set(PACKAGE_VERSION_COMPATIBLE FALSE) +set(PACKAGE_VERSION_UNSUITABLE TRUE) + +if(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + set(PACKAGE_VERSION_COMPATIBLE TRUE) + set(PACKAGE_VERSION_UNSUITABLE FALSE) +endif(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) diff --git a/infra/cmake/packages/TensorFlowSource-1.14/TensorFlowSourceConfig.cmake b/infra/cmake/packages/TensorFlowSource-1.14/TensorFlowSourceConfig.cmake index bcdf9f28c..33538c234 100644 --- a/infra/cmake/packages/TensorFlowSource-1.14/TensorFlowSourceConfig.cmake +++ b/infra/cmake/packages/TensorFlowSource-1.14/TensorFlowSourceConfig.cmake @@ -7,7 +7,8 @@ function(_TensorFlowSource_import) nnas_include(ExternalSourceTools) nnas_include(OptionTools) - envoption(TENSORFLOW_1_14_URL https://github.com/tensorflow/tensorflow/archive/v1.14.0.tar.gz) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(TENSORFLOW_1_14_URL ${EXTERNAL_DOWNLOAD_SERVER}/tensorflow/tensorflow/archive/v1.14.0.tar.gz) ExternalSource_Download(TENSORFLOW DIRNAME TENSORFLOW-1.14 ${TENSORFLOW_1_14_URL}) diff --git a/infra/cmake/packages/TensorFlowSource-2.1.0/TensorFlowSourceConfig.cmake b/infra/cmake/packages/TensorFlowSource-2.1.0/TensorFlowSourceConfig.cmake index 0d2a95056..aabc22f72 100644 --- a/infra/cmake/packages/TensorFlowSource-2.1.0/TensorFlowSourceConfig.cmake +++ b/infra/cmake/packages/TensorFlowSource-2.1.0/TensorFlowSourceConfig.cmake @@ -7,7 +7,8 @@ function(_TensorFlowSource_import) nnas_include(ExternalSourceTools) nnas_include(OptionTools) - envoption(TENSORFLOW_2_1_0_URL https://github.com/tensorflow/tensorflow/archive/v2.1.0.tar.gz) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(TENSORFLOW_2_1_0_URL ${EXTERNAL_DOWNLOAD_SERVER}/tensorflow/tensorflow/archive/v2.1.0.tar.gz) ExternalSource_Download(TENSORFLOW DIRNAME TENSORFLOW-2.1.0 ${TENSORFLOW_2_1_0_URL}) diff --git a/infra/cmake/packages/TensorFlowSource-2.2.0/TensorFlowSourceConfig.cmake b/infra/cmake/packages/TensorFlowSource-2.2.0/TensorFlowSourceConfig.cmake index 71220d743..7dabf88c8 100644 --- a/infra/cmake/packages/TensorFlowSource-2.2.0/TensorFlowSourceConfig.cmake +++ b/infra/cmake/packages/TensorFlowSource-2.2.0/TensorFlowSourceConfig.cmake @@ -7,7 +7,8 @@ function(_TensorFlowSource_import) nnas_include(ExternalSourceTools) nnas_include(OptionTools) - envoption(TENSORFLOW_2_2_0_URL https://github.com/tensorflow/tensorflow/archive/v2.2.0.tar.gz) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(TENSORFLOW_2_2_0_URL ${EXTERNAL_DOWNLOAD_SERVER}/tensorflow/tensorflow/archive/v2.2.0.tar.gz) ExternalSource_Download(TENSORFLOW DIRNAME TENSORFLOW-2.2.0 ${TENSORFLOW_2_2_0_URL}) diff --git a/infra/cmake/packages/TensorFlowSource-2.3.0-rc0Config.cmake b/infra/cmake/packages/TensorFlowSource-2.3.0-rc0Config.cmake index 82df579a1..967d49e87 100644 --- a/infra/cmake/packages/TensorFlowSource-2.3.0-rc0Config.cmake +++ b/infra/cmake/packages/TensorFlowSource-2.3.0-rc0Config.cmake @@ -10,7 +10,8 @@ function(_import) nnas_include(ExternalSourceTools) nnas_include(OptionTools) - envoption(TENSORFLOW_2_3_0_RC0_URL https://github.com/tensorflow/tensorflow/archive/v2.3.0-rc0.tar.gz) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(TENSORFLOW_2_3_0_RC0_URL ${EXTERNAL_DOWNLOAD_SERVER}/tensorflow/tensorflow/archive/v2.3.0-rc0.tar.gz) ExternalSource_Download(TENSORFLOW DIRNAME TENSORFLOW-2.3.0-RC0 ${TENSORFLOW_2_3_0_RC0_URL}) diff --git a/infra/cmake/packages/TensorFlowSource-2.3.0/TensorFlowSourceConfig.cmake b/infra/cmake/packages/TensorFlowSource-2.3.0/TensorFlowSourceConfig.cmake index 5c3a0f8cc..0ad0cda0b 100644 --- a/infra/cmake/packages/TensorFlowSource-2.3.0/TensorFlowSourceConfig.cmake +++ b/infra/cmake/packages/TensorFlowSource-2.3.0/TensorFlowSourceConfig.cmake @@ -7,7 +7,8 @@ function(_TensorFlowSource_import) nnas_include(ExternalSourceTools) nnas_include(OptionTools) - envoption(TENSORFLOW_2_3_0_URL https://github.com/tensorflow/tensorflow/archive/v2.3.0.tar.gz) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(TENSORFLOW_2_3_0_URL ${EXTERNAL_DOWNLOAD_SERVER}/tensorflow/tensorflow/archive/v2.3.0.tar.gz) ExternalSource_Download(TENSORFLOW DIRNAME TENSORFLOW-2.3.0 ${TENSORFLOW_2_3_0_URL}) diff --git a/infra/cmake/packages/TensorFlowSource-2.6.0/TensorFlowSourceConfig.cmake b/infra/cmake/packages/TensorFlowSource-2.6.0/TensorFlowSourceConfig.cmake index 611c7c805..9a7af17b1 100644 --- a/infra/cmake/packages/TensorFlowSource-2.6.0/TensorFlowSourceConfig.cmake +++ b/infra/cmake/packages/TensorFlowSource-2.6.0/TensorFlowSourceConfig.cmake @@ -7,7 +7,8 @@ function(_TensorFlowSource_import) nnas_include(ExternalSourceTools) nnas_include(OptionTools) - envoption(TENSORFLOW_2_6_0_URL https://github.com/tensorflow/tensorflow/archive/v2.6.0.tar.gz) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(TENSORFLOW_2_6_0_URL ${EXTERNAL_DOWNLOAD_SERVER}/tensorflow/tensorflow/archive/v2.6.0.tar.gz) ExternalSource_Download(TENSORFLOW DIRNAME TENSORFLOW-2.6.0 ${TENSORFLOW_2_6_0_URL}) diff --git a/infra/cmake/packages/TensorFlowSource-2.8.0/TensorFlowSourceConfig.cmake b/infra/cmake/packages/TensorFlowSource-2.8.0/TensorFlowSourceConfig.cmake index 4abe2eae6..988a0f49f 100644 --- a/infra/cmake/packages/TensorFlowSource-2.8.0/TensorFlowSourceConfig.cmake +++ b/infra/cmake/packages/TensorFlowSource-2.8.0/TensorFlowSourceConfig.cmake @@ -7,7 +7,8 @@ function(_TensorFlowSource_import) nnas_include(ExternalSourceTools) nnas_include(OptionTools) - envoption(TENSORFLOW_2_8_0_URL https://github.com/tensorflow/tensorflow/archive/v2.8.0.tar.gz) + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(TENSORFLOW_2_8_0_URL ${EXTERNAL_DOWNLOAD_SERVER}/tensorflow/tensorflow/archive/v2.8.0.tar.gz) ExternalSource_Download(TENSORFLOW DIRNAME TENSORFLOW-2.8.0 ${TENSORFLOW_2_8_0_URL}) diff --git a/infra/cmake/packages/VulkanSourceConfig.cmake b/infra/cmake/packages/VulkanSourceConfig.cmake new file mode 100644 index 000000000..76b69898e --- /dev/null +++ b/infra/cmake/packages/VulkanSourceConfig.cmake @@ -0,0 +1,20 @@ +function(_VulkanSource_import) + if(NOT ${DOWNLOAD_VULKAN}) + set(VulkanSource_FOUND FALSE PARENT_SCOPE) + return() + endif(NOT ${DOWNLOAD_VULKAN}) + + nnas_include(ExternalSourceTools) + nnas_include(OptionTools) + + envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") + envoption(VULKAN_URL ${EXTERNAL_DOWNLOAD_SERVER}/KhronosGroup/Vulkan-Headers/archive/ec2db85225ab410bc6829251bef6c578aaed5868.tar.gz) + ExternalSource_Download(VULKAN + DIRNAME VULKAN + URL ${VULKAN_URL}) + + set(VulkanSource_DIR ${VULKAN_SOURCE_DIR} PARENT_SCOPE) + set(VulkanSource_FOUND TRUE PARENT_SCOPE) +endfunction(_VulkanSource_import) + +_VulkanSource_import() diff --git a/infra/command/format b/infra/command/format index 5cf9606fa..993a6ad5a 100644 --- a/infra/command/format +++ b/infra/command/format @@ -154,11 +154,9 @@ function check_python_files() { fi # Check python files - FILES_TO_CHECK_PYTHON=`echo "$FILES_TO_CHECK" | tr ' ' '\n' | egrep '\.py$'` + FILES_TO_CHECK_PYTHON=(`echo "$FILES_TO_CHECK" | tr ' ' '\n' | egrep '\.py$'`) # Exceptional case: one-cmds don't have '.py' extension: ignore non-python source (cmake, etc) and ignore shell script: one-prepare-venv - FILES_TO_CHECK_PYTHON=`echo "$FILES_TO_CHECK_PYTHON" | egrep -v '^compiler/one-cmds/.*\..*$' | egrep -v '^compiler/one-cmds/one-prepare-venv$'` - # Transform to array - FILES_TO_CHECK_PYTHON=($FILES_TO_CHECK_PYTHON) + FILES_TO_CHECK_PYTHON+=(`echo "$FILES_TO_CHECK" | tr ' ' '\n' | egrep '^compiler/one-cmds/[^(\./)]*$' | egrep -v '^compiler/one-cmds/one-prepare-venv$'`) for s in ${DIRECTORIES_NOT_TO_BE_TESTED[@]}; do skip=${s#'.'/}/ diff --git a/infra/command/gen-coverage-report b/infra/command/gen-coverage-report index 3058aee9a..df6377d2a 100644 --- a/infra/command/gen-coverage-report +++ b/infra/command/gen-coverage-report @@ -69,10 +69,10 @@ done opencl_files=($(find ./runtime/onert/backend/gpu_cl/open_cl/ \( -name "*.cc" -o -name "*.h" \) -exec realpath {} \; )) -# Exclude *.test.cpp files from coverage report +# Exclude test files from coverage report # Exclude flatbuffer generated files from coverage report "${LCOV_PATH}" -r "${EXTRACTED_COVERAGE_INFO_PATH}" -o "${EXCLUDED_COVERAGE_INFO_PATH}" \ - '*.test.cpp' '*_schema_generated.h' "${opencl_files[@]}" + '*.test.cpp' '*.test.cc' '*/test/*' '*/tests/*' '*_schema_generated.h' "${opencl_files[@]}" # Final coverage data cp -v ${EXCLUDED_COVERAGE_INFO_PATH} ${COVERAGE_INFO_PATH} diff --git a/infra/debian/compiler/changelog b/infra/debian/compiler/changelog index 2763ac55b..ddca70a17 100644 --- a/infra/debian/compiler/changelog +++ b/infra/debian/compiler/changelog @@ -1,3 +1,50 @@ +one (1.21.0) bionic; urgency=medium + + * Support unrolling of LSTM and RNN Ops in `one-import-onnx` tool + * Introduced new tools `one-infer`, `circle-operator`, `circle-interpreter` + * Introduced `Workflow`(WIP) in `one-cmds` + * New option `quant_config` in `one-quantize` + * New option `fake_quantize` in `one-quantize` + * More Ops supported: Densify + * More Ops for quantization: ReduceMax + * More Ops for mixed-precision quantization (MPQ): LeakyRelu, Neg, Relu6, Squeeze + * More Ops for `convert_nchw_to_nhwc` option: LogSoftmax, ReduceMax, SplitV, Softmax + * New optimization options in `one-optimize`: `replace_non_const_fc_with_bmm`, `resolve_customop_splitv`, `fold_densify` + * Improved reshape elimination in `convert_nchw_to_nhwc` option. + * Support fusion of Channel-wise Add + Relu with TConv + * Support negative axis in ArgMin/Max + * Show errors for unrecognized options in `one-optimize` + * Fix shape inference for `StridedSlice` + * Fix FuseBatchNormWithTConvPass to support TConv with bias + * Deprecate `--O1` option in `circle2circle` + * Support gcc-11 + * Support limited Float16 for kernels constants with dequantization to Float32 + + -- seongwoo <mhs4670go@naver.com> Wed, 06 Sep 2022 12:00:00 +0900 + +one (1.20.0) bionic; urgency=medium + + * luci-interpreter supports multiple kernels with PAL layer including Cortext-M + * luci-interpreter supports integer tensor for partly kernels + * luci import support constant without coping to reduce memory for luci-interpreter + * Reduce duplicate codes to package released modules + * Limited support for ONNX LSTM/RNN unrolling while importing + * Limited support for ARM32 cross build + * Support new operator: SVDF + * New virtual CircleVariable to support tensor with variable + * Support quantization of BatchMatMul Op + * Support mixed(UINT8 + INT16) quantization + * Support backward propagation of quantization parameters + * Upgrade default python to version 3.8 + * Support TensorFlow 2.8.0, ONNX-TF 1.10.0, ONNX 1.11.0 + * Upgrade circle schema to follow tflite schema v3b + * Refactor to mio-tflite280, mio-circle04 with version and helpers methods + * Use one flatbuffers 2.0 version + * Drop support for TensorFlow 1.x + * Fix for several bugs, performance enhancements, and typos + + -- seongwoo <mhs4670go@naver.com> Tue, 26 Apr 2022 12:00:00 +0900 + one (1.19.0) bionic; urgency=medium * `circle-quantizer` supports input/output type option diff --git a/infra/debian/compiler/docs/one-infer.1 b/infra/debian/compiler/docs/one-infer.1 new file mode 100644 index 000000000..a1bafbb12 --- /dev/null +++ b/infra/debian/compiler/docs/one-infer.1 @@ -0,0 +1,46 @@ +.TH ONE-INFER "1" "July 2022" "one-infer version 1.21.0" "User Commands" +.SH NAME +one-infer \- manual page for one-infer version 1.21.0 +.SH DESCRIPTION +usage: one\-infer [\-h] [\-v] [\-C CONFIG] [\-d DRIVER | \fB\-b\fR BACKEND] [\-\-post\-process POST_PROCESS] [\-\-] [COMMANDS FOR BACKEND DRIVER] +.PP +command line tool to infer model +.SS "optional arguments:" +.TP +\fB\-h\fR, \fB\-\-help\fR +show this help message and exit +.TP +\fB\-v\fR, \fB\-\-version\fR +show program's version number and exit +.TP +\fB\-V\fR, \fB\-\-verbose\fR +output additional information to stdout or stderr +.TP +\fB\-C\fR CONFIG, \fB\-\-config\fR CONFIG +run with configuation file +.TP +\fB\-d\fR DRIVER, \fB\-\-driver\fR DRIVER +backend inference driver name to execute +.TP +\fB\-b\fR BACKEND, \fB\-\-backend\fR BACKEND +backend name to use +.TP +\fB\-\-post\-process\fR POST_PROCESS +post processing script to convert I/O data to standard +format +.SH COPYRIGHT +Copyright \(co 2020\-2022 Samsung Electronics Co., Ltd. All Rights Reserved +Licensed under the Apache License, Version 2.0 +https://github.com/Samsung/ONE +.SH "SEE ALSO" +The full documentation for +.B one-infer +is maintained as a Texinfo manual. If the +.B info +and +.B one-infer +programs are properly installed at your site, the command +.IP +.B info one-infer +.PP +should give you access to the complete manual. diff --git a/infra/debian/compiler/docs/one-partition.1 b/infra/debian/compiler/docs/one-partition.1 new file mode 100644 index 000000000..5b6fe933d --- /dev/null +++ b/infra/debian/compiler/docs/one-partition.1 @@ -0,0 +1,56 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. +.TH ONE-PARTITION "1" "June 2022" "one-partition version 1.21.0" "User Commands" +.SH NAME +one-partition \- manual page for one-partition version 1.21.0 +.SH DESCRIPTION +usage: one\-partition [\-h] [\-v] [\-V] [\-C CONFIG] [\-\-backends BACKENDS] +.TP +[\-\-default DEFAULT] [\-\-part_file PART_FILE] +[\-\-input_file INPUT_FILE] [\-\-work_path WORK_PATH] +.PP +command line tool to partition circle model by multiple backends +.SS "optional arguments:" +.TP +\fB\-h\fR, \fB\-\-help\fR +show this help message and exit +.TP +\fB\-v\fR, \fB\-\-version\fR +show program's version number and exit +.TP +\fB\-V\fR, \fB\-\-verbose\fR +output additional information to stdout or stderr +.TP +\fB\-C\fR CONFIG, \fB\-\-config\fR CONFIG +run with configuation file +.TP +\fB\-\-backends\fR BACKENDS +backends in CSV to use for partitioning +.TP +\fB\-\-default\fR DEFAULT +default backend to assign +.TP +\fB\-\-part_file\fR PART_FILE +partition file which provides backend to assign +.TP +\fB\-\-input_file\fR INPUT_FILE +input circle model filename +.TP +\fB\-\-work_path\fR WORK_PATH +work path of partition, input files exist and output +files are produced +.SH COPYRIGHT +Copyright \(co 2020\-2022 Samsung Electronics Co., Ltd. All Rights Reserved +Licensed under the Apache License, Version 2.0 +https://github.com/Samsung/ONE +.SH "SEE ALSO" +The full documentation for +.B one-partition +is maintained as a Texinfo manual. If the +.B info +and +.B one-partition +programs are properly installed at your site, the command +.IP +.B info one-partition +.PP +should give you access to the complete manual. diff --git a/infra/debian/compiler/one-compiler.install b/infra/debian/compiler/one-compiler.install index 805ba8677..65e46d188 100644 --- a/infra/debian/compiler/one-compiler.install +++ b/infra/debian/compiler/one-compiler.install @@ -1,6 +1,8 @@ # {FILES_TO_INSTALL} {DEST_DIR} # bin usr/bin/circle2circle usr/share/one/bin/ +usr/bin/circle-eval-diff usr/share/one/bin/ +usr/bin/circle-operator usr/share/one/bin/ usr/bin/circle-partitioner usr/share/one/bin/ usr/bin/circle-quantizer usr/share/one/bin/ usr/bin/generate_bcq_metadata.py usr/share/one/bin/ @@ -16,14 +18,21 @@ usr/bin/one-import-bcq usr/share/one/bin/ usr/bin/one-import-onnx usr/share/one/bin/ usr/bin/one-import-tf usr/share/one/bin/ usr/bin/one-import-tflite usr/share/one/bin/ +usr/bin/one-infer usr/share/one/bin/ usr/bin/one-optimize usr/share/one/bin/ usr/bin/one-pack usr/share/one/bin/ +usr/bin/one-partition usr/share/one/bin/ usr/bin/one-prepare-venv usr/share/one/bin/ usr/bin/one-profile usr/share/one/bin/ usr/bin/one-quantize usr/share/one/bin/ usr/bin/one-version usr/share/one/bin/ usr/bin/onelib/constant.py usr/share/one/bin/onelib/ usr/bin/onelib/make_cmd.py usr/share/one/bin/onelib/ +usr/bin/onelib/CfgRunner.py usr/share/one/bin/onelib/ +usr/bin/onelib/OptionBuilder.py usr/share/one/bin/onelib/ +usr/bin/onelib/TopologicalSortHelper.py usr/share/one/bin/onelib/ +usr/bin/onelib/WorkflowRunner.py usr/share/one/bin/onelib/ +usr/bin/onnx_legalizer.py usr/share/one/bin/ usr/bin/rawdata2hdf5 usr/share/one/bin/ usr/bin/record-minmax usr/share/one/bin/ usr/bin/tf2nnpkg usr/share/one/bin/ diff --git a/infra/debian/compiler/one-compiler.manpages b/infra/debian/compiler/one-compiler.manpages index 77f2f4e46..e0284ae4e 100644 --- a/infra/debian/compiler/one-compiler.manpages +++ b/infra/debian/compiler/one-compiler.manpages @@ -1,5 +1,6 @@ debian/docs/one-build.1 debian/docs/one-codegen.1 +debian/docs/one-infer.1 debian/docs/one-import.1 debian/docs/one-import-bcq.1 debian/docs/one-import-onnx.1 @@ -7,6 +8,7 @@ debian/docs/one-import-tf.1 debian/docs/one-import-tflite.1 debian/docs/one-optimize.1 debian/docs/one-pack.1 +debian/docs/one-partition.1 debian/docs/one-profile.1 debian/docs/one-quantize.1 debian/docs/onecc.1 diff --git a/infra/debian/runtime/changelog b/infra/debian/runtime/changelog index 4cf0abc30..e07c50c21 100644 --- a/infra/debian/runtime/changelog +++ b/infra/debian/runtime/changelog @@ -1,3 +1,18 @@ +one (1.21.0) bionic; urgency=low + + * Runtime supports to run nnpackage with two models + * Conv2D and Depthwise Conv2D supports per-channel quantization of uint8 type. + * TRIX backend supports batch execution which run in parallel with multicore + + -- Chunseok Lee <chunseok.lee@samsung.com> Tue, 06 Sep 2022 12:00:00 +0900 + +one (1.20.0) bionic; urgency=low + + * Introduce TRIX backend + * API supports new data type NNFW_TYPE_TENSOR_QUANT16_SYMM_SIGNED + + -- Chunseok Lee <chunseok.lee@samsung.com> Wed, 26 Apr 2022 12:00:00 +0900 + one (1.19.0) bionic; urgency=low * Synch up version with ONE Compiler diff --git a/infra/debian/runtime/rules b/infra/debian/runtime/rules index dee87a9ed..97170ee09 100755 --- a/infra/debian/runtime/rules +++ b/infra/debian/runtime/rules @@ -3,7 +3,7 @@ DEBVER := $(shell dpkg-parsechangelog -SVersion) export DH_VERBOSE = 1 export _DESTDIR = debian/tmp/ export BUILD_TYPE=release -export OPTIONS=-DBUILD_LOGGING=0 -DBUILD_TFLITE_COMPARATOR_TEST_TOOL=0 -DBUILD_NNPACKAGE_RUN=0 -DBUILD_TFLITE_RUN=0 -DBUILD_NNAPI_TEST=0 -DBUILD_RUNTIME_NNAPI_TEST=0 -DBUILD_TFLITE_BENCHMARK_MODEL=0 -DBUILD_TFLITE_VANILLA_RUN=0 -DBUILD_TENSORFLOW_LITE_2_3_0=0 -DBUILD_TENSORFLOW_LITE=0 +export OPTIONS=-DBUILD_LOGGING=0 -DBUILD_TFLITE_COMPARATOR_TEST_TOOL=0 -DBUILD_NNPACKAGE_RUN=0 -DBUILD_TFLITE_RUN=0 -DBUILD_NNAPI_TEST=0 -DBUILD_RUNTIME_NNAPI_TEST=0 -DBUILD_TFLITE_BENCHMARK_MODEL=0 -DBUILD_TFLITE_VANILLA_RUN=0 -DBUILD_TENSORFLOW_LITE_2_8_0=0 -DBUILD_TENSORFLOW_LITE=0 export DEBIAN_BUILD=1 export INSTALL_PATH=debian/tmp/usr/ %: diff --git a/infra/docker/bionic/Dockerfile b/infra/docker/bionic/Dockerfile index dbc22a6e8..f7ffc73fd 100644 --- a/infra/docker/bionic/Dockerfile +++ b/infra/docker/bionic/Dockerfile @@ -86,7 +86,7 @@ RUN echo 'deb [trusted=yes] http://download.tizen.org/tools/latest-release/Ubunt RUN apt-get update && apt-get -qqy install gbs RUN wget http://download.tizen.org/sdk/tizenstudio/official/binary/sdb_3.1.4_ubuntu-64.zip -O sdb.zip RUN unzip -d tmp sdb.zip && rm sdb.zip -RUN cp tmp/data/tools/sdb /usr/bin/. && rm -rf tmp +RUN cp tmp/data/tools/sdb /usr/bin/. && rm -rf tmp/* # Install java RUN apt-get install -y --no-install-recommends openjdk-8-jdk diff --git a/infra/docker/focal/Dockerfile b/infra/docker/focal/Dockerfile index 6f3cd9b60..1cdeffbb7 100644 --- a/infra/docker/focal/Dockerfile +++ b/infra/docker/focal/Dockerfile @@ -46,7 +46,7 @@ RUN echo 'deb [trusted=yes] http://download.tizen.org/tools/latest-release/Ubunt RUN apt-get update && apt-get -qqy install gbs RUN wget http://download.tizen.org/sdk/tizenstudio/official/binary/sdb_4.2.19_ubuntu-64.zip -O sdb.zip RUN unzip -d tmp sdb.zip && rm sdb.zip -RUN cp tmp/data/tools/sdb /usr/bin/. && rm -rf tmp +RUN cp tmp/data/tools/sdb /usr/bin/. && rm -rf tmp/* # Clean archives (to reduce image size) RUN apt-get clean -y diff --git a/infra/nncc/CMakeLists.txt b/infra/nncc/CMakeLists.txt index 2ff5a5f6a..768d7972b 100644 --- a/infra/nncc/CMakeLists.txt +++ b/infra/nncc/CMakeLists.txt @@ -1,4 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +# The libboost 1.74 uses IN_LIST operator, which requires the policy CMP0057, in a CMake file. +# This policy requires ``cmake_minimum_required(VERSION 3.3)``. +# Run "cmake --help-policy CMP0057" for policy details. +cmake_minimum_required(VERSION 3.3) project(nncc) diff --git a/infra/nncc/cmake/options/options_armv7em-generic.cmake b/infra/nncc/cmake/options/options_armv7em-generic.cmake new file mode 100644 index 000000000..d671b73f1 --- /dev/null +++ b/infra/nncc/cmake/options/options_armv7em-generic.cmake @@ -0,0 +1,3 @@ +# +# armv7em generic cmake options +# diff --git a/infra/nnfw/CMakeLists.txt b/infra/nnfw/CMakeLists.txt index 897a16fbf..2a27eee59 100644 --- a/infra/nnfw/CMakeLists.txt +++ b/infra/nnfw/CMakeLists.txt @@ -55,6 +55,12 @@ macro(nnas_find_package PREFIX) ) endmacro(nnas_find_package) +# C++14 feature requires 5 or later +# Using std::unordered_map shows build fail under 6.2 +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.2) + message(FATAL "Runtime build requires GNU Compiler version 6.2 or later.") +endif() + set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_EXTENSIONS OFF) diff --git a/infra/nnfw/cmake/ApplyCompileFlags.cmake b/infra/nnfw/cmake/ApplyCompileFlags.cmake index b042b0c42..b1c7ff568 100644 --- a/infra/nnfw/cmake/ApplyCompileFlags.cmake +++ b/infra/nnfw/cmake/ApplyCompileFlags.cmake @@ -31,3 +31,13 @@ endforeach() foreach(FLAG ${FLAGS_CXXONLY}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAG}") endforeach() + +# lib pthread as a variable (finding pthread build option must be disabled on android) +# Define here to use on external lib build +set(LIB_PTHREAD lib_pthread) +add_library(${LIB_PTHREAD} INTERFACE) +if(NOT TARGET_OS STREQUAL "android") + # Get compile option (ex. "-pthread" on linux GNU build tool) + find_package(Threads) + target_link_libraries(${LIB_PTHREAD} INTERFACE Threads::Threads) +endif() diff --git a/infra/nnfw/cmake/CfgOptionFlags.cmake b/infra/nnfw/cmake/CfgOptionFlags.cmake index 5371120ad..440f1859a 100644 --- a/infra/nnfw/cmake/CfgOptionFlags.cmake +++ b/infra/nnfw/cmake/CfgOptionFlags.cmake @@ -31,6 +31,8 @@ option(GENERATE_RUNTIME_NNAPI_TESTS "Generate NNAPI operation gtest" ON) option(ENVVAR_ONERT_CONFIG "Use environment variable for onert configuration" ON) option(INSTALL_TEST_SCRIPTS "Install test scripts" ON) option(BUILD_GPU_CL "Build gpu_cl backend" OFF) +option(BUILD_NPUD "Build NPU daemon" ON) +option(ENVVAR_NPUD_CONFIG "Use environment variable for npud configuration" ON) # # Default build configuration for contrib # @@ -72,9 +74,10 @@ option(DOWNLOAD_OOURAFFT "Download Ooura FFT source" ON) option(DOWNLOAD_GTEST "Download Google Test source and build Google Test" ON) option(BUILD_BOOST "Build boost source" OFF) option(BUILD_TENSORFLOW_LITE "Build TensorFlow Lite from the downloaded source" ON) -option(BUILD_TENSORFLOW_LITE_2_3_0 "Build TensorFlow Lite 2.3.0 from the downloaded source" OFF) +option(BUILD_TENSORFLOW_LITE_2_8_0 "Build TensorFlow Lite 2.8.0 from the downloaded source" OFF) option(BUILD_TENSORFLOW_LITE_GPU "Build TensorFlow Lite GPU delegate from the downloaded source" OFF) option(BUILD_ARMCOMPUTE "Build ARM Compute from the downloaded source" ON) +option(DEBUG_ARMCOMPUTE "Build ARM Compute as debug type" OFF) option(BUILD_RUY "Build ruy library from the downloaded source" ON) option(BUILD_CPUINFO "Build cpuinfo library from the downloaded source" ON) option(PROFILE_RUY "Enable ruy library profiling" OFF) diff --git a/infra/nnfw/cmake/buildtool/config/config_aarch64-android.cmake b/infra/nnfw/cmake/buildtool/config/config_aarch64-android.cmake index e0c81dee7..fb63b3c47 100644 --- a/infra/nnfw/cmake/buildtool/config/config_aarch64-android.cmake +++ b/infra/nnfw/cmake/buildtool/config/config_aarch64-android.cmake @@ -1,8 +1,5 @@ include("cmake/buildtool/config/config_linux.cmake") -# On Android, pthread is contained in bionic(libc) -set(LIB_PTHREAD "") - # SIMD for aarch64 set(FLAGS_COMMON ${FLAGS_COMMON} "-ftree-vectorize" diff --git a/infra/nnfw/cmake/buildtool/config/config_linux.cmake b/infra/nnfw/cmake/buildtool/config/config_linux.cmake index 86dd0f217..01b47ef4a 100644 --- a/infra/nnfw/cmake/buildtool/config/config_linux.cmake +++ b/infra/nnfw/cmake/buildtool/config/config_linux.cmake @@ -2,20 +2,11 @@ # linux common compile options # -# remove warning from arm cl +# Remove warning: ignoring attributes on template argument (ACL, Eigen, etc) # https://github.com/ARM-software/ComputeLibrary/issues/330 -set(GCC_VERSION_DISABLE_WARNING 6.0) -if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER GCC_VERSION_DISABLE_WARNING) - message(STATUS "GCC version higher than ${GCC_VERSION_DISABLE_WARNING}") - set(FLAGS_CXXONLY ${FLAGS_CXXONLY} - "-Wno-ignored-attributes" - ) -endif() +set(FLAGS_CXXONLY ${FLAGS_CXXONLY} "-Wno-ignored-attributes") # Disable annoying ABI compatibility warning. if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) list(APPEND FLAGS_CXXONLY "-Wno-psabi") endif() - -# lib pthread as a variable (pthread must be disabled on android) -set(LIB_PTHREAD pthread) diff --git a/infra/nnfw/cmake/buildtool/config/config_x86_64-darwin.cmake b/infra/nnfw/cmake/buildtool/config/config_x86_64-darwin.cmake index dbd45fc03..52d6c6b2b 100644 --- a/infra/nnfw/cmake/buildtool/config/config_x86_64-darwin.cmake +++ b/infra/nnfw/cmake/buildtool/config/config_x86_64-darwin.cmake @@ -7,6 +7,3 @@ message(STATUS "Building for x86-64 Darwin") set(FLAGS_COMMON ${FLAGS_COMMON} "-msse4" ) - -# lib pthread as a variable (pthread must be disabled on android) -set(LIB_PTHREAD pthread) diff --git a/infra/nnfw/cmake/buildtool/cross/toolchain_aarch64-linux.cmake b/infra/nnfw/cmake/buildtool/cross/toolchain_aarch64-linux.cmake index 3356aa72d..07b26a937 100644 --- a/infra/nnfw/cmake/buildtool/cross/toolchain_aarch64-linux.cmake +++ b/infra/nnfw/cmake/buildtool/cross/toolchain_aarch64-linux.cmake @@ -21,12 +21,6 @@ endif() set(CMAKE_SYSROOT ${ROOTFS_DIR}) set(CMAKE_FIND_ROOT_PATH ${ROOTFS_DIR}) -set(CMAKE_SHARED_LINKER_FLAGS - "${CMAKE_SHARED_LINKER_FLAGS} --sysroot=${ROOTFS_DIR}" - CACHE INTERNAL "" FORCE) -set(CMAKE_EXE_LINKER_FLAGS - "${CMAKE_EXE_LINKER_FLAGS} --sysroot=${ROOTFS_DIR}" - CACHE INTERNAL "" FORCE) # search for programs in the build host directories set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) diff --git a/infra/nnfw/cmake/buildtool/cross/toolchain_aarch64-tizen.cmake b/infra/nnfw/cmake/buildtool/cross/toolchain_aarch64-tizen.cmake index 4d5d7ac56..cab7325dd 100644 --- a/infra/nnfw/cmake/buildtool/cross/toolchain_aarch64-tizen.cmake +++ b/infra/nnfw/cmake/buildtool/cross/toolchain_aarch64-tizen.cmake @@ -23,12 +23,6 @@ endif() set(CMAKE_SYSROOT ${ROOTFS_DIR}) set(CMAKE_FIND_ROOT_PATH ${ROOTFS_DIR}) -set(CMAKE_SHARED_LINKER_FLAGS - "${CMAKE_SHARED_LINKER_FLAGS} --sysroot=${ROOTFS_DIR}" - CACHE INTERNAL "" FORCE) -set(CMAKE_EXE_LINKER_FLAGS - "${CMAKE_EXE_LINKER_FLAGS} --sysroot=${ROOTFS_DIR}" - CACHE INTERNAL "" FORCE) # search for programs in the build host directories set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) diff --git a/infra/nnfw/cmake/buildtool/cross/toolchain_armv7l-linux.cmake b/infra/nnfw/cmake/buildtool/cross/toolchain_armv7l-linux.cmake index 8f2cb6735..c69259f85 100644 --- a/infra/nnfw/cmake/buildtool/cross/toolchain_armv7l-linux.cmake +++ b/infra/nnfw/cmake/buildtool/cross/toolchain_armv7l-linux.cmake @@ -21,12 +21,6 @@ endif() set(CMAKE_SYSROOT ${ROOTFS_DIR}) set(CMAKE_FIND_ROOT_PATH ${ROOTFS_DIR}) -set(CMAKE_SHARED_LINKER_FLAGS - "${CMAKE_SHARED_LINKER_FLAGS} --sysroot=${ROOTFS_DIR}" - CACHE INTERNAL "" FORCE) -set(CMAKE_EXE_LINKER_FLAGS - "${CMAKE_EXE_LINKER_FLAGS} --sysroot=${ROOTFS_DIR}" - CACHE INTERNAL "" FORCE) # search for programs in the build host directories set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) diff --git a/infra/nnfw/cmake/buildtool/cross/toolchain_armv7l-tizen.cmake b/infra/nnfw/cmake/buildtool/cross/toolchain_armv7l-tizen.cmake index 72513cdc1..181415df2 100644 --- a/infra/nnfw/cmake/buildtool/cross/toolchain_armv7l-tizen.cmake +++ b/infra/nnfw/cmake/buildtool/cross/toolchain_armv7l-tizen.cmake @@ -23,12 +23,6 @@ endif() set(CMAKE_SYSROOT ${ROOTFS_DIR}) set(CMAKE_FIND_ROOT_PATH ${ROOTFS_DIR}) -set(CMAKE_SHARED_LINKER_FLAGS - "${CMAKE_SHARED_LINKER_FLAGS} --sysroot=${ROOTFS_DIR}" - CACHE INTERNAL "" FORCE) -set(CMAKE_EXE_LINKER_FLAGS - "${CMAKE_EXE_LINKER_FLAGS} --sysroot=${ROOTFS_DIR}" - CACHE INTERNAL "" FORCE) # search for programs in the build host directories set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) @@ -46,10 +40,6 @@ add_compile_options(-mfpu=neon-vfpv4) add_compile_options(-mfloat-abi=softfp) add_compile_options(--sysroot=${ROOTFS_DIR}) -set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --sysroot=${ROOTFS_DIR}") - -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --sysroot=${ROOTFS_DIR}") - include_directories(SYSTEM ${ROOTFS_DIR}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/) include_directories(SYSTEM ${ROOTFS_DIR}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/armv7l-tizen-linux-gnueabi) add_compile_options(-Wno-deprecated-declarations) # compile-time option diff --git a/infra/nnfw/cmake/options/options_aarch64-android.cmake b/infra/nnfw/cmake/options/options_aarch64-android.cmake index 9332f5299..e95ccca63 100644 --- a/infra/nnfw/cmake/options/options_aarch64-android.cmake +++ b/infra/nnfw/cmake/options/options_aarch64-android.cmake @@ -10,3 +10,5 @@ option(DOWNLOAD_NEON2SSE "Download NEON2SSE library source" OFF) option(DOWNLOAD_BOOST "Download boost source" ON) option(BUILD_BOOST "Build boost source" ON) option(BUILD_LOGGING "Build logging runtime" OFF) +# Do not support npud +option(BUILD_NPUD "Build NPU daemon" OFF) diff --git a/infra/nnfw/cmake/options/options_armv7l-tizen.cmake b/infra/nnfw/cmake/options/options_armv7l-tizen.cmake index eab3b0a92..9b487d93c 100644 --- a/infra/nnfw/cmake/options/options_armv7l-tizen.cmake +++ b/infra/nnfw/cmake/options/options_armv7l-tizen.cmake @@ -9,6 +9,7 @@ option(DOWNLOAD_GTEST "Download Google Test source and build Google Test" OFF) option(BUILD_LOGGING "Build logging runtime" OFF) option(GENERATE_RUNTIME_NNAPI_TESTS "Generate NNAPI operation gtest" OFF) option(ENVVAR_ONERT_CONFIG "Use environment variable for onert configuration" OFF) +option(ENVVAR_NPUD_CONFIG "Use environment variable for npud configuration" OFF) option(DOWNLOAD_OPENCL_HEADERS "Download Opencl_headers source" ON) option(DOWNLOAD_TENSORFLOW_GPU "Download Tensorflow GPU delegate source" ON) diff --git a/infra/nnfw/cmake/options/options_x86_64-tizen.cmake b/infra/nnfw/cmake/options/options_x86_64-tizen.cmake index 31b7fd6fb..eea37224d 100644 --- a/infra/nnfw/cmake/options/options_x86_64-tizen.cmake +++ b/infra/nnfw/cmake/options/options_x86_64-tizen.cmake @@ -2,6 +2,7 @@ # x86_64 linux cmake options # option(BUILD_ARMCOMPUTE "Build ARM Compute from the downloaded source" OFF) +option(BUILD_TENSORFLOW_LITE "Build TensorFlow Lite from the downloaded source" OFF) option(DOWNLOAD_ARMCOMPUTE "Download ARM Compute source" OFF) option(DOWNLOAD_GTEST "Download Google Test source and build Google Test" OFF) diff --git a/infra/nnfw/cmake/packages/ARMComputeConfig.cmake b/infra/nnfw/cmake/packages/ARMComputeConfig.cmake index 6ae7dea34..f6a4efd96 100644 --- a/infra/nnfw/cmake/packages/ARMComputeConfig.cmake +++ b/infra/nnfw/cmake/packages/ARMComputeConfig.cmake @@ -90,11 +90,11 @@ function(_ARMCompute_Build ARMComputeInstall_DIR) return() endif(NOT SCONS_PATH) - if(CMAKE_BUILD_TYPE) - string(TOLOWER "${CMAKE_BUILD_TYPE}" SCON_BUILD_TYPE) - else(CMAKE_BUILD_TYPE) + if(DEBUG_ARMCOMPUTE) + set(SCON_BUILD_TYPE "debug") + else(DEBUG_ARMCOMPUTE) set(SCON_BUILD_TYPE "release") - endif(CMAKE_BUILD_TYPE) + endif(DEBUG_ARMCOMPUTE) #### Architecture-specific configurations diff --git a/infra/nnfw/cmake/packages/CpuInfoConfig.cmake b/infra/nnfw/cmake/packages/CpuInfoConfig.cmake index 878026d9a..dddec8988 100644 --- a/infra/nnfw/cmake/packages/CpuInfoConfig.cmake +++ b/infra/nnfw/cmake/packages/CpuInfoConfig.cmake @@ -16,14 +16,18 @@ function(_CpuInfo_Build) nnas_include(ExternalProjectTools) - set(CPUINFO_BUILD_TOOLS OFF CACHE BOOL "Build command-line tools") - set(CPUINFO_BUILD_BENCHMARKS OFF CACHE BOOL "Build cpuinfo unit tests") - set(CPUINFO_BUILD_UNIT_TESTS OFF CACHE BOOL "Build cpuinfo mock tests") - set(CPUINFO_BUILD_MOCK_TESTS OFF CACHE BOOL "Build cpuinfo micro-benchmarks") + # Set build option + # - Static (position independent) + # - No logging + # - Library only (CPUINFO_RUNTIME_TYPE is not used) + set(CPUINFO_LIBRARY_TYPE "static" CACHE STRING "") + set(CPUINFO_LOG_LEVEL "none" CACHE STRING "") + set(CPUINFO_BUILD_TOOLS OFF CACHE BOOL "") + set(CPUINFO_BUILD_BENCHMARKS OFF CACHE BOOL "") + set(CPUINFO_BUILD_UNIT_TESTS OFF CACHE BOOL "") + set(CPUINFO_BUILD_MOCK_TESTS OFF CACHE BOOL "") add_extdirectory("${CpuInfoSource_DIR}" cpuinfo EXCLUDE_FROM_ALL) set_target_properties(cpuinfo PROPERTIES POSITION_INDEPENDENT_CODE ON) - # Suppress warnings generated by clog - set_target_properties(clog PROPERTIES COMPILE_FLAGS "-Wno-unused-result") set(CpuInfoSource_DIR ${CpuInfoSource_DIR} PARENT_SCOPE) set(CpuInfo_FOUND TRUE PARENT_SCOPE) endfunction(_CpuInfo_Build) diff --git a/infra/nnfw/cmake/packages/GLib2.0Config.cmake b/infra/nnfw/cmake/packages/GLib2.0Config.cmake new file mode 100644 index 000000000..d4c6bf241 --- /dev/null +++ b/infra/nnfw/cmake/packages/GLib2.0Config.cmake @@ -0,0 +1,41 @@ +function(_GLIB_2_0_import) + find_library(GLIB_LIBRARIES + NAMES glib-2.0) + + get_filename_component(GLIB_LIBRARY_DIR ${GLIB_LIBRARIES} DIRECTORY) + find_path(GLIBCONFIG_INCLUDE_DIR + NAMES glibconfig.h + PATHS ${GLIB_LIBRARY_DIR} + PATH_SUFFIXES glib-2.0/include + NO_CMAKE_FIND_ROOT_PATH) + + find_path(GLIB_INCLUDE_DIR + NAMES glib.h + PATH_SUFFIXES glib-2.0) + + set(GLIB_FOUND TRUE) + + if(NOT GLIB_LIBRARIES) + set(GLIB_FOUND FALSE) + endif(NOT GLIB_LIBRARIES) + + if(NOT GLIBCONFIG_INCLUDE_DIR) + set(GLIB_FOUND FALSE) + endif(NOT GLIBCONFIG_INCLUDE_DIR) + + if(NOT GLIB_INCLUDE_DIR) + set(GLIB_FOUND FALSE) + endif(NOT GLIB_INCLUDE_DIR) + + set(GLIB_INCLUDE_DIRS ${GLIB_INCLUDE_DIR} ${GLIBCONFIG_INCLUDE_DIR}) + + if(NOT GLIB_FOUND) + message(STATUS "Failed to find GLib 2.0") + endif(NOT GLIB_FOUND) + + set(GLIB2.0_FOUND ${GLIB_FOUND} PARENT_SCOPE) + set(GLIB2.0_INCLUDE_DIRS ${GLIB_INCLUDE_DIRS} PARENT_SCOPE) + set(GLIB2.0_LIBRARIES ${GLIB_LIBRARIES} PARENT_SCOPE) +endfunction(_GLIB_2_0_import) + +_GLIB_2_0_import() diff --git a/infra/nnfw/cmake/packages/Ruy/CMakeLists.txt b/infra/nnfw/cmake/packages/Ruy/CMakeLists.txt index 9140a17a7..a1c4656e3 100644 --- a/infra/nnfw/cmake/packages/Ruy/CMakeLists.txt +++ b/infra/nnfw/cmake/packages/Ruy/CMakeLists.txt @@ -1,4 +1,4 @@ -set(RUY_BASE ${RuySource_DIR}/ruy) +set(RUY_BASE ${TensorFlowRuySource_DIR}/ruy) # # Ruy library @@ -14,7 +14,6 @@ list(REMOVE_ITEM RUY_SRCS "${RUY_BASE}/example_advanced.cc") list(REMOVE_ITEM RUY_SRCS "${RUY_BASE}/tune_tool.cc") list(REMOVE_ITEM RUY_SRCS "${RUY_BASE}/pmu.cc") list(REMOVE_ITEM RUY_SRCS "${RUY_BASE}/create_trmul_params.cc") -list(REMOVE_ITEM RUY_SRCS "${RUY_BASE}/prepare_packed_matrices.cc") list(APPEND RUY_INSTRUMENTATION_SRCS "${RUY_BASE}/profiler/instrumentation.cc") @@ -23,7 +22,7 @@ if(PROFILE_RUY) list(APPEND RUY_PROFILER_SRCS "${RUY_BASE}/profiler/treeview.cc") endif(PROFILE_RUY) -list(APPEND RUY_INCLUDES "${RuySource_DIR}") +list(APPEND RUY_INCLUDES "${TensorFlowRuySource_DIR}") add_library(ruy STATIC ${RUY_SRCS}) target_include_directories(ruy SYSTEM PUBLIC ${RUY_INCLUDES}) diff --git a/infra/nnfw/cmake/packages/RuyConfig.cmake b/infra/nnfw/cmake/packages/RuyConfig.cmake index 4e7cc24ac..6f5f4b71e 100644 --- a/infra/nnfw/cmake/packages/RuyConfig.cmake +++ b/infra/nnfw/cmake/packages/RuyConfig.cmake @@ -5,14 +5,14 @@ function(_Ruy_Build) return() endif(TARGET ruy) - nnas_find_package(RuySource QUIET) + nnas_find_package(TensorFlowRuySource EXACT 2.8 QUIET) nnfw_find_package(CpuInfo QUIET) - if(NOT RuySource_FOUND) + if(NOT TensorFlowRuySource_FOUND) message(STATUS "RUY: Source not found") set(Ruy_FOUND FALSE PARENT_SCOPE) return() - endif(NOT RuySource_FOUND) + endif(NOT TensorFlowRuySource_FOUND) if (NOT CpuInfo_FOUND) message(STATUS "RUY: CPUINFO not found") @@ -20,6 +20,17 @@ function(_Ruy_Build) return() endif(NOT CpuInfo_FOUND) + # Ruy's cmake requires cmake >= 3.14 + # If we ready cmake >= 3.14, enable below comment out code + #if(PROFILE_RUY) + # # Will be used on ruy build + # set(RUY_PROFILER ON) + #endif(PROFILE_RUY) + #add_extdirectory("${RuySource_DIR}" Ruy) + # + ## Ignore warning from ruy + #target_compile_options(ruy INTERFACE -Wno-comment) + add_extdirectory("${CMAKE_CURRENT_LIST_DIR}/Ruy" ruy) set(Ruy_FOUND TRUE PARENT_SCOPE) endfunction(_Ruy_Build) diff --git a/infra/nnfw/cmake/packages/TensorFlowLite-1.13.1/TensorFlowLite/CMakeLists.txt b/infra/nnfw/cmake/packages/TensorFlowLite-1.13.1/TensorFlowLite/CMakeLists.txt index 9a7b240e9..f872b88cd 100644 --- a/infra/nnfw/cmake/packages/TensorFlowLite-1.13.1/TensorFlowLite/CMakeLists.txt +++ b/infra/nnfw/cmake/packages/TensorFlowLite-1.13.1/TensorFlowLite/CMakeLists.txt @@ -52,6 +52,12 @@ target_compile_definitions(tensorflow-lite PUBLIC "GEMMLOWP_ALLOW_SLOW_SCALAR_FA set_property(TARGET tensorflow-lite PROPERTY POSITION_INDEPENDENT_CODE ON) target_link_libraries(tensorflow-lite eigen-tf-1.13.1 flatbuffers::flatbuffers ${LIB_PTHREAD} dl) +# Define TF_LITE_DISABLE_X86_NEON for debug build +# If we upgrade NEON2SSE version, we can remove below line +if(NEON2SSESource_FOUND) + target_compile_definitions(tensorflow-lite PRIVATE $<$<CONFIG:Debug>:TF_LITE_DISABLE_X86_NEON>) +endif(NEON2SSESource_FOUND) + if(ANDROID) target_link_libraries(tensorflow-lite log) target_include_directories(tensorflow-lite PUBLIC "${NDK_DIR}/..") diff --git a/infra/nnfw/cmake/packages/TensorFlowLite-2.3.0/TensorFlowLite/CMakeLists.txt b/infra/nnfw/cmake/packages/TensorFlowLite-2.8.0/TensorFlowLite/CMakeLists.txt index afee6e1cc..d7e1d0666 100644 --- a/infra/nnfw/cmake/packages/TensorFlowLite-2.3.0/TensorFlowLite/CMakeLists.txt +++ b/infra/nnfw/cmake/packages/TensorFlowLite-2.8.0/TensorFlowLite/CMakeLists.txt @@ -17,10 +17,14 @@ file(GLOB TFLITE_API_SRCS "${TENSORFLOW_LITE_BASE}/core/api/*.c" list(APPEND TFLITE_PROFILING_SRCS "${TENSORFLOW_LITE_BASE}/profiling/memory_info.cc") list(APPEND TFLITE_PROFILING_SRCS "${TENSORFLOW_LITE_BASE}/profiling/time.cc") +list(APPEND TFLITE_PROFILING_SRCS "${TENSORFLOW_LITE_BASE}/profiling/platform_profiler.cc") file(GLOB TFLITE_EXPERIMENTAL_SRCS "${TENSORFLOW_LITE_BASE}/experimental/resource/*.cc") -file(GLOB TFLITE_SPARSITY_SRCS "${TENSORFLOW_LITE_BASE}/tools/optimize/sparsity/*.cc") +file(GLOB TFLITE_SCHEMA_UTIL_SRCS "${TENSORFLOW_LITE_BASE}/schema/*.cc") + +# Moved to kerenls/internal/utils +#file(GLOB TFLITE_SPARSITY_SRCS "${TENSORFLOW_LITE_BASE}/tools/optimize/sparsity/*.cc") list(APPEND TFLITE_SRCS ${TFLITE_CORE_SRCS}) list(APPEND TFLITE_SRCS ${TFLITE_KERNEL_SRCS}) @@ -28,7 +32,8 @@ list(APPEND TFLITE_SRCS ${TFLITE_LIB_SRCS}) list(APPEND TFLITE_SRCS ${TFLITE_API_SRCS}) list(APPEND TFLITE_SRCS ${TFLITE_PROFILING_SRCS}) list(APPEND TFLITE_SRCS ${TFLITE_EXPERIMENTAL_SRCS}) -list(APPEND TFLITE_SRCS ${TFLITE_SPARSITY_SRCS}) +#list(APPEND TFLITE_SRCS ${TFLITE_SPARSITY_SRCS}) +list(APPEND TFLITE_SRCS ${TFLITE_SCHEMA_UTIL_SRCS}) # externals list(APPEND TFLITE_SRCS "${OouraFFTSource_DIR}/fftsg.c") @@ -49,6 +54,8 @@ set(BUILD_WITH_NNAPI TRUE) if(${BUILD_WITH_NNAPI}) list(APPEND TFLITE_SRCS "${TENSORFLOW_LITE_BASE}/delegates/nnapi/nnapi_delegate.cc") list(APPEND TFLITE_SRCS "${TENSORFLOW_LITE_BASE}/delegates/nnapi/quant_lstm_sup.cc") + list(APPEND TFLITE_SRCS "${TENSORFLOW_LITE_BASE}/delegates/utils.cc") + list(APPEND TFLITE_SRCS "${TENSORFLOW_LITE_BASE}/delegates/serialization.cc") list(APPEND TFLITE_SRCS "${TENSORFLOW_LITE_BASE}/nnapi/nnapi_implementation.cc") list(APPEND TFLITE_SRCS "${TENSORFLOW_LITE_BASE}/nnapi/nnapi_util.cc") else() @@ -71,26 +78,44 @@ file(GLOB_RECURSE TFLITE_EXCLS "${TENSORFLOW_LITE_BASE}/*test*.cc" "${TENSORFLOW_LITE_BASE}/*tool*.cc") list(REMOVE_ITEM TFLITE_SRCS ${TFLITE_EXCLS}) +# exclude some kernels (requires python3-dev package) +# TODO Enable these kernels by installing package on build system +file(GLOB_RECURSE TFLITE_KERNEL_EXCLS "${TENSORFLOW_LITE_BASE}/kernels/variable_ops_wrapper.cc" + "${TENSORFLOW_LITE_BASE}/kernels/gradient/*.cc" + "${TENSORFLOW_LITE_BASE}/kernels/perception/*.cc") +list(REMOVE_ITEM TFLITE_SRCS ${TFLITE_KERNEL_EXCLS}) + +# exclude kernel shim +file(GLOB_RECURSE TFLITE_SHIM_EXCLS "${TENSORFLOW_LITE_BASE}/kernels/shim/*.cc") +list(REMOVE_ITEM TFLITE_SRCS ${TFLITE_SHIM_EXCLS}) + # include headers list(APPEND TFLITE_INCLUDES "${TensorFlowSource_DIR}") list(APPEND TFLITE_INCLUDES "${TensorFlowGEMMLowpSource_DIR}") list(APPEND TFLITE_INCLUDES "${Fp16Source_DIR}/include") +#list(APPEND TFLITE_INCLUDES "${Pybind11Source_DIR}/include") if(NEON2SSESource_FOUND) list(APPEND TFLITE_INCLUDES "${NEON2SSESource_DIR}") endif(NEON2SSESource_FOUND) -add_library(tensorflow-lite-2.3.0 STATIC ${TFLITE_SRCS}) -target_include_directories(tensorflow-lite-2.3.0 SYSTEM PUBLIC ${TFLITE_INCLUDES}) -target_include_directories(tensorflow-lite-2.3.0 PRIVATE ${CpuInfoSource_DIR}) -target_compile_definitions(tensorflow-lite-2.3.0 PUBLIC "GEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK -DTFLITE_WITH_RUY -DTFLITE_WITH_RUY_GEMV -DRUY_HAVE_CPUINFO") -set_property(TARGET tensorflow-lite-2.3.0 PROPERTY POSITION_INDEPENDENT_CODE ON) -target_link_libraries(tensorflow-lite-2.3.0 eigen flatbuffers::flatbuffers ruy abseil farmhash ${LIB_PTHREAD} dl) +add_library(tensorflow-lite-2.8.0 STATIC ${TFLITE_SRCS}) +target_include_directories(tensorflow-lite-2.8.0 SYSTEM PUBLIC ${TFLITE_INCLUDES}) +target_include_directories(tensorflow-lite-2.8.0 PRIVATE ${CpuInfoSource_DIR}) +target_compile_definitions(tensorflow-lite-2.8.0 PUBLIC "GEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK -DTFLITE_WITH_RUY -DTFLITE_WITH_RUY_GEMV -DRUY_HAVE_CPUINFO") +set_property(TARGET tensorflow-lite-2.8.0 PROPERTY POSITION_INDEPENDENT_CODE ON) +target_link_libraries(tensorflow-lite-2.8.0 eigen flatbuffers::flatbuffers ruy abseil farmhash ${LIB_PTHREAD} dl) if(NOT ANDROID AND ${BUILD_WITH_NNAPI}) - target_link_libraries(tensorflow-lite-2.3.0 rt) + target_link_libraries(tensorflow-lite-2.8.0 rt) endif() +# Define TF_LITE_DISABLE_X86_NEON for debug build +# If we upgrade NEON2SSE version, we can remove below line +if(NEON2SSESource_FOUND) + target_compile_definitions(tensorflow-lite-2.8.0 PRIVATE $<$<CONFIG:Debug>:TF_LITE_DISABLE_X86_NEON>) +endif(NEON2SSESource_FOUND) + if(ANDROID) - target_link_libraries(tensorflow-lite-2.3.0 log) - target_include_directories(tensorflow-lite-2.3.0 PUBLIC "${NDK_DIR}/..") + target_link_libraries(tensorflow-lite-2.8.0 log) + target_include_directories(tensorflow-lite-2.8.0 PUBLIC "${NDK_DIR}/..") endif() diff --git a/infra/nnfw/cmake/packages/TensorFlowLite-2.3.0/TensorFlowLiteConfig.cmake b/infra/nnfw/cmake/packages/TensorFlowLite-2.8.0/TensorFlowLiteConfig.cmake index c81958cf4..1c8061812 100644 --- a/infra/nnfw/cmake/packages/TensorFlowLite-2.3.0/TensorFlowLiteConfig.cmake +++ b/infra/nnfw/cmake/packages/TensorFlowLite-2.8.0/TensorFlowLiteConfig.cmake @@ -1,8 +1,8 @@ -if(BUILD_TENSORFLOW_LITE_2_3_0) +if(BUILD_TENSORFLOW_LITE_2_8_0) macro(return_unless VAR) if(NOT ${VAR}) - message("TFLiteVanillaRun: ${VAR} NOT TRUE") - set(TensorFlowLite_2_3_0_FOUND FALSE PARENT_SCOPE) + message("TFLite 2.8: ${VAR} NOT TRUE") + set(TensorFlowLite_2_8_0_FOUND FALSE PARENT_SCOPE) return() endif(NOT ${VAR}) endmacro(return_unless) @@ -10,7 +10,7 @@ if(BUILD_TENSORFLOW_LITE_2_3_0) nnas_include(ExternalSourceTools) nnas_include(OptionTools) - nnas_find_package(TensorFlowSource EXACT 2.3.0 QUIET) + nnas_find_package(TensorFlowSource EXACT 2.8.0 QUIET) return_unless(TensorFlowSource_FOUND) # Below urls come from https://github.com/tensorflow/tensorflow/blob/v2.3.0/tensorflow/tensorflow/workspace.bzl @@ -22,7 +22,7 @@ if(BUILD_TENSORFLOW_LITE_2_3_0) return_unless(Farmhash_FOUND) nnfw_find_package(FlatBuffers QUIET) return_unless(FlatBuffers_FOUND) - nnas_find_package(TensorFlowGEMMLowpSource EXACT 2.3.0 QUIET) + nnas_find_package(TensorFlowGEMMLowpSource EXACT 2.8.0 QUIET) return_unless(TensorFlowGEMMLowpSource_FOUND) nnas_find_package(OouraFFTSource QUIET) return_unless(OouraFFTSource_FOUND) @@ -33,12 +33,18 @@ if(BUILD_TENSORFLOW_LITE_2_3_0) nnas_find_package(Fp16Source QUIET) return_unless(Fp16Source_FOUND) + # TensorFlow Lite requires Pybind11 library's header only + # But Pybind11 requires python3-dev package + # TODO Enable below by installing package on build system + #nnas_find_package(Pybind11Source QUIET) + #return_unless(Pybind11Source_FOUND) + # Optional packages nnas_find_package(NEON2SSESource QUIET) nnas_include(ExternalProjectTools) - add_extdirectory("${CMAKE_CURRENT_LIST_DIR}/TensorFlowLite" tflite-2.3.0) + add_extdirectory("${CMAKE_CURRENT_LIST_DIR}/TensorFlowLite" tflite-2.8.0) - set(TensorFlowLite_2_3_0_FOUND TRUE) + set(TensorFlowLite_2_8_0_FOUND TRUE) return() endif() diff --git a/infra/nnfw/cmake/packages/TensorFlowLite-2.3.0/TensorFlowLiteConfigVersion.cmake b/infra/nnfw/cmake/packages/TensorFlowLite-2.8.0/TensorFlowLiteConfigVersion.cmake index 08e637421..cd49d7b72 100644 --- a/infra/nnfw/cmake/packages/TensorFlowLite-2.3.0/TensorFlowLiteConfigVersion.cmake +++ b/infra/nnfw/cmake/packages/TensorFlowLite-2.8.0/TensorFlowLiteConfigVersion.cmake @@ -1,4 +1,4 @@ -set(PACKAGE_VERSION "2.3.0") +set(PACKAGE_VERSION "2.8.0") set(PACKAGE_VERSION_EXACT FALSE) set(PACKAGE_VERSION_COMPATIBLE FALSE) set(PACKAGE_VERSION_UNSUITABLE TRUE) diff --git a/infra/nnfw/config/gbs.conf b/infra/nnfw/config/gbs.conf index 1150a5fc8..2b5994a1b 100644 --- a/infra/nnfw/config/gbs.conf +++ b/infra/nnfw/config/gbs.conf @@ -3,20 +3,11 @@ profile = profile.tizen [profile.tizen] -user=obs_viewer -obs = obs.tizen -repos = repo.tizen_one,repo.tizen_base,repo.tizen_mobile +repos = repo.tizen_base,repo.tizen_mobile buildroot = /home/GBS-ROOT/ -[obs.tizen] -url = http://api.tizen.org - [repo.tizen_mobile] url = http://download.tizen.org/snapshots/tizen/unified/latest/repos/standard/packages/ [repo.tizen_base] url = http://download.tizen.org/snapshots/tizen/base/latest/repos/standard/packages/ - -[repo.tizen_one] -url = http://13.125.34.93/archive/tizen/ - diff --git a/infra/packaging/preset/20220323 b/infra/packaging/preset/20220323 index 421106c35..0eac1064f 100644 --- a/infra/packaging/preset/20220323 +++ b/infra/packaging/preset/20220323 @@ -20,21 +20,26 @@ function preset_configure() # loco IR and related utilities REQUIRED_UNITS+=("loco" "locop" "locomotiv" "logo-core" "logo") # Flatbuffer I/O - REQUIRED_UNITS+=("mio-tflite" "mio-tflite260" "mio-tflite280" "mio-circle04") + REQUIRED_UNITS+=("mio-tflite280" "mio-circle04") # Data I/O REQUIRED_UNITS+=("dio-hdf5") # Circle compiler library (.circle -> .circle) REQUIRED_UNITS+=("luci") # Tools - REQUIRED_UNITS+=("tflite2circle" "circle2circle" "tflchef" "circlechef") + REQUIRED_UNITS+=("tflite2circle" "circle2circle" "tflchef") REQUIRED_UNITS+=("circle-tensordump" "circledump") - REQUIRED_UNITS+=("tf2tfliteV2" "luci-interpreter" "circle-verify") + REQUIRED_UNITS+=("tf2tfliteV2" "luci-interpreter") REQUIRED_UNITS+=("luci-eval-driver") REQUIRED_UNITS+=("record-minmax" "circle-quantizer" "rawdata2hdf5") - REQUIRED_UNITS+=("circle-partitioner") + REQUIRED_UNITS+=("circle-eval-diff" "circle-interpreter") + REQUIRED_UNITS+=("circle-partitioner" "circle-operator") REQUIRED_UNITS+=("one-cmds") REQUIRED_UNITS+=("bcq-tools") + # Dependent modules needed for build + REQUIRED_UNITS+=("circlechef") + REQUIRED_UNITS+=("circle-verify") + NPROC=${NPROC:-$(cat /proc/cpuinfo | grep -c processor)} # TODO Use "nncc configure" and "nncc build" diff --git a/infra/packaging/preset/20220323_windows b/infra/packaging/preset/20220323_windows index 60500b1e0..14917b3dd 100644 --- a/infra/packaging/preset/20220323_windows +++ b/infra/packaging/preset/20220323_windows @@ -15,20 +15,26 @@ function preset_configure() # loco IR and related utilities REQUIRED_UNITS+=("loco" "locop" "locomotiv" "logo-core" "logo") # Flatbuffer I/O - REQUIRED_UNITS+=("mio-tflite" "mio-tflite260" "mio-tflite280" "mio-circle04") + REQUIRED_UNITS+=("mio-tflite280" "mio-circle04") # Data I/O REQUIRED_UNITS+=("dio-hdf5") # Circle compiler library (.circle -> .circle) REQUIRED_UNITS+=("luci") # Tools - REQUIRED_UNITS+=("tflite2circle" "circle2circle" "tflchef" "circlechef") - REQUIRED_UNITS+=("tf2tfliteV2" "luci-interpreter" "circle-verify") + REQUIRED_UNITS+=("tflite2circle" "circle2circle" "tflchef") + REQUIRED_UNITS+=("circle-tensordump" "circledump") + REQUIRED_UNITS+=("tf2tfliteV2" "luci-interpreter") REQUIRED_UNITS+=("luci-eval-driver") REQUIRED_UNITS+=("record-minmax" "circle-quantizer" "rawdata2hdf5") - REQUIRED_UNITS+=("circle-partitioner") + REQUIRED_UNITS+=("circle-eval-diff" "circle-interpreter") + REQUIRED_UNITS+=("circle-partitioner" "circle-operator") REQUIRED_UNITS+=("one-cmds") REQUIRED_UNITS+=("bcq-tools") + # Dependent modules needed for build + REQUIRED_UNITS+=("circlechef") + REQUIRED_UNITS+=("circle-verify") + NPROC=$(cat /proc/cpuinfo | grep -c processor) # TODO Use "nncc configure" and "nncc build" diff --git a/infra/packaging/res/tf2nnpkg.20220323 b/infra/packaging/res/tf2nnpkg.20220323 index 0d44818a1..5f43b2386 100644 --- a/infra/packaging/res/tf2nnpkg.20220323 +++ b/infra/packaging/res/tf2nnpkg.20220323 @@ -104,6 +104,6 @@ fi ${ONE_IMPORT_BCQ_SCRIPT} # optimize -"${ROOT}/bin/circle2circle" --O1 "${TMPDIR}/${MODEL_NAME}.tmp.circle" "${TMPDIR}/${MODEL_NAME}.circle" +"${ROOT}/bin/circle2circle" --resolve_customop_add "${TMPDIR}/${MODEL_NAME}.tmp.circle" "${TMPDIR}/${MODEL_NAME}.circle" "${ROOT}/bin/model2nnpkg.sh" -o "${OUTPUT_DIR}" "${TMPDIR}/${MODEL_NAME}.circle" diff --git a/infra/scripts/compiler_modules.sh b/infra/scripts/compiler_modules.sh index 6a857d2c8..51cba92f9 100644 --- a/infra/scripts/compiler_modules.sh +++ b/infra/scripts/compiler_modules.sh @@ -1,5 +1,8 @@ #!/bin/bash +# NOTE this file is sourced from, for the purpose of +# - configure_compiler_coverage.sh: to get test coverage for release criteria + # Don't run this script [[ "${BASH_SOURCE[0]}" == "${0}" ]] && echo "Please don't execute ${BASH_SOURCE[0]}, source it" && return @@ -8,13 +11,14 @@ DEBUG_BUILD_ITEMS+=";oops;pepper-assert;pepper-csv2vec" DEBUG_BUILD_ITEMS+=";hermes;hermes-std" DEBUG_BUILD_ITEMS+=";loco;locop;locomotiv;logo-core;logo" DEBUG_BUILD_ITEMS+=";foder;crew;souschef;arser;vconone" -DEBUG_BUILD_ITEMS+=";safemain;mio-circle04;mio-tflite;mio-tflite260;mio-tflite280" +DEBUG_BUILD_ITEMS+=";safemain;mio-circle04;mio-tflite280;dio-hdf5" DEBUG_BUILD_ITEMS+=";tflite2circle" DEBUG_BUILD_ITEMS+=";luci" DEBUG_BUILD_ITEMS+=";luci-interpreter" DEBUG_BUILD_ITEMS+=";luci-eval-driver;luci-pass-value-test;luci-value-test" DEBUG_BUILD_ITEMS+=";circle2circle;record-minmax;circle-quantizer" -DEBUG_BUILD_ITEMS+=";circle-partitioner;circle-part-driver" +DEBUG_BUILD_ITEMS+=";circle-eval-diff" +DEBUG_BUILD_ITEMS+=";circle-partitioner;circle-part-driver;circle-operator" DEBUG_BUILD_ITEMS+=";circle-verify" DEBUG_BUILD_ITEMS+=";circle-tensordump" DEBUG_BUILD_ITEMS+=";tflchef;circlechef" @@ -25,3 +29,5 @@ DEBUG_BUILD_ITEMS+=";tf2tfliteV2;tf2tfliteV2-conversion-test" DEBUG_BUILD_ITEMS+=";tflite2circle-conversion-test" DEBUG_BUILD_ITEMS+=";pota-quantization-value-test" DEBUG_BUILD_ITEMS+=";circle-part-value-test" +DEBUG_BUILD_ITEMS+=";circle-quantizer-dredd-recipe-test" +DEBUG_BUILD_ITEMS+=";circle-operator-test" diff --git a/infra/scripts/docker_build_nncc.sh b/infra/scripts/docker_build_nncc.sh index 7146141bb..2e603b550 100755 --- a/infra/scripts/docker_build_nncc.sh +++ b/infra/scripts/docker_build_nncc.sh @@ -27,13 +27,13 @@ else fi # prepare tensorflow -if [ -d $TENSORFLOW_PREFIX ]; then +if [ -n "$TENSORFLOW_PREFIX" ]; then DOCKER_OPTS+=" -v $TENSORFLOW_PREFIX:/opt/tensorflow" CONFIG_OPTIONS+=" -DTENSORFLOW_PREFIX=/opt/tensorflow" fi # prepare onnx -if [ -d $ONNXRUNTIME_PREFIX ]; then +if [ -n "$ONNXRUNTIME_PREFIX" ]; then DOCKER_OPTS+=" -v $ONNXRUNTIME_PREFIX:/opt/onnxruntime" CONFIG_OPTIONS+=" -DONNXRUNTIME_PREFIX=/opt/onnxruntime" fi diff --git a/infra/scripts/docker_build_test_x64.sh b/infra/scripts/docker_build_test_x64.sh index 26d8de4a9..b3428e083 100755 --- a/infra/scripts/docker_build_test_x64.sh +++ b/infra/scripts/docker_build_test_x64.sh @@ -32,8 +32,8 @@ pushd $ROOT_PATH > /dev/null export DOCKER_ENV_VARS export DOCKER_VOLUMES export BUILD_OPTIONS -# Disable nnpackage_run build: mismatch between buildtool for CI and installed hdf5 -CMD="export OPTIONS='-DBUILD_NNPACKAGE_RUN=OFF $BUILD_OPTIONS' && \ + +CMD="export OPTIONS='$BUILD_OPTIONS' && \ export BUILD_TYPE=Release && \ cp -nv Makefile.template Makefile && \ make all install build_test_suite" diff --git a/infra/scripts/docker_collect_nnpkg_resources.sh b/infra/scripts/docker_collect_nnpkg_resources.sh index 06cf8809a..afdd3b9cb 100755 --- a/infra/scripts/docker_collect_nnpkg_resources.sh +++ b/infra/scripts/docker_collect_nnpkg_resources.sh @@ -28,13 +28,13 @@ else fi # prepare tensorflow -if [ -d $TENSORFLOW_PREFIX ]; then +if [ -n "$TENSORFLOW_PREFIX" ]; then DOCKER_OPTS+=" -v $TENSORFLOW_PREFIX:/opt/tensorflow" CONFIG_OPTIONS+=" -DTENSORFLOW_PREFIX=/opt/tensorflow" fi # prepare onnx -if [ -d $ONNXRUNTIME_PREFIX ]; then +if [ -n "$ONNXRUNTIME_PREFIX" ]; then DOCKER_OPTS+=" -v $ONNXRUNTIME_PREFIX:/opt/onnxruntime" CONFIG_OPTIONS+=" -DONNXRUNTIME_PREFIX=/opt/onnxruntime" fi @@ -71,7 +71,7 @@ REQUIRED_UNITS+=("loco" "locop" "locomotiv" "logo-core" "logo") # Circle compiler library (.circle -> .circle) REQUIRED_UNITS+=("luci") # Flatbuffer I/O -REQUIRED_UNITS+=("mio-tflite" "mio-tflite260" "mio-tflite280" "mio-circle04") +REQUIRED_UNITS+=("mio-tflite280" "mio-circle04") # Tools REQUIRED_UNITS+=("tflite2circle" "circle2circle" "luci-interpreter") REQUIRED_UNITS+=("souschef" "tflchef" "circlechef" "circle-verify") diff --git a/infra/scripts/test_ubuntu_runtime_mixed.sh b/infra/scripts/test_ubuntu_runtime_mixed.sh index 697fed897..2510d9c85 100755 --- a/infra/scripts/test_ubuntu_runtime_mixed.sh +++ b/infra/scripts/test_ubuntu_runtime_mixed.sh @@ -55,8 +55,8 @@ echo "GeneratedTests.squeeze_relaxed" >> $SKIPLIST_PREFIX.union # Run the test export OP_BACKEND_Conv2D="cpu" -export OP_BACKEND_MaxPool2D="acl_cl" -export OP_BACKEND_AvgPool2D="acl_neon" +export OP_BACKEND_Pool2D="acl_cl" +export OP_BACKEND_FullyConnected="acl_neon" export ACL_LAYOUT="NCHW" export RUY_THREADS=4 NNAPIGTest "acl_cl;acl_neon;cpu" "Product/out/unittest/nnapi_gtest.skip.${TEST_ARCH}-${TEST_OS}.union" "report/mixed" diff --git a/infra/scripts/unittest_compiler_xml.sh b/infra/scripts/unittest_compiler_xml.sh index 46d3bc813..6e9e8ad7f 100755 --- a/infra/scripts/unittest_compiler_xml.sh +++ b/infra/scripts/unittest_compiler_xml.sh @@ -7,7 +7,9 @@ set -eo pipefail CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ROOT_PATH="$CURRENT_PATH/../../" NNCC_WORKSPACE=${NNCC_WORKSPACE:-${ROOT_PATH}build} -UNITTEST_REPORT_DIR=${NNCC_WORKSPACE}/unittest_compiler_xml + +# Use fixed absolute report dir for CI +UNITTEST_REPORT_DIR=${ROOT_PATH}build/unittest_compiler_xml for i in "$@" do @@ -25,5 +27,10 @@ fi for TEST_BIN in `find ${NNCC_WORKSPACE}/compiler -type f -executable -name *_test`; do TEST_NAME="$(basename -- $TEST_BIN)" - LUGI_LOG=999 $TEST_BIN --gtest_output="xml:$UNITTEST_REPORT_DIR/$TEST_NAME.xml" + TEST_DIR="$(dirname $TEST_BIN)" + + # Execute on test directory to find related file + pushd $TEST_DIR > /dev/null + LUGI_LOG=999 ./$TEST_NAME --gtest_output="xml:$UNITTEST_REPORT_DIR/$TEST_NAME.xml" + popd > /dev/null done |